8000 Fix custom key binding ignored, #3692 by low-batt · Pull Request #3693 · iina/iina · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix custom key binding ignored, #3692 #3693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

low-batt
Copy link
Contributor

The commit in the pull request will:

  • Add swift-algorithms to the list of packages

  • Change MenuController.updateKeyEquivalentsFrom to ignore key bindings
    that have been overridden when searching for keys to be used as
    shortcuts for menu items

  • This change has been discussed with the author.

  • It implements / fixes issue Custom key binding ignored #3692.


Description:
Note the addition of Swift Algorithms.

The commit in the pull request will:
- Add swift-algorithms to the list of packages
- Change MenuController.updateKeyEquivalentsFrom to ignore key bindings
  that have been overridden when searching for keys to be used as
  shortcuts for menu items
@lhc70000
Copy link
Member
lhc70000 commented May 5, 2022

Please see my comments in #3692, I think that's a better fix. Would you like to update your PR or I push my proposed fix instead?

@low-batt
Copy link
Contributor Author
low-batt commented May 6, 2022

Caught me on a rare super busy day. Not sure how well the brain is working tonight. I say we toss my commit in the trash and go with your fix. BUT we should be coordinating with @svobs who has just proposed several fixes for key binding issues #3710, #3716 and #3718. See the PRs he posted. So lets close this PR.

@svobs
Copy link
Contributor
svobs commented May 6, 2022

Caught me on a rare super busy day. Not sure how well the brain is working tonight. I say we toss my commit in the trash and go with your fix. BUT we should be coordinating with @svobs who has just proposed several fixes for key binding issues #3710, #3716 and #3718. See the PRs he posted. So lets close this PR.

Hi @lhc70000! Let me just preface this by saying I'm a longtime Mac user, longtime developer, but very recent Mac developer. I'd tried several video players over the years and been kind of shocked at how mediocre they all were, and in fact had settled on bare-bones no-UI MPV for a long time before I discovered IINA :) Anyway, I'd like to help keep it going, and it's also a good chance to learn more about MPV integration.

So I understand the need to have a separate layer on top of MPV - must have been tons of work - but the hot reload of key bindings and smoother MacOS integration is excellent. Still, I get the sense that there are a small but very influential group of power users which it might be worth catering to in order to ensure IINA's ultimate success.

So my presumption is: IINA should behave as much like MPV as possible, unless there's a good reason not to. It seems like it should be able to support Lua scripts and other advanced things but still have a nice user experience for the more casual user. I'm willing to work on a lot of this stuff.

So, sorry for being so long-winded - was kinda making the case for my other PRs here as well since I just went and did them without much discussion, so let me know what you think.

As for this one - @lhc70000 would it be possible to implement both fixes for this issue? I agree that bumping the range to 60sec would be an improvement. But larger values will still lead to a discrepancy between IINA and MPV, like this:

f seek 5 exact     # iina will use this
f seek 80 exact    # mpv will use this

Specifically, the discrepancy arises when there are two lines with the same keysym, and the first is inside the matching range but the second is outside of it. The first one becomes attached to a menu item while the second does not, and at keyDown a menu item is always higher priority than a non menu item.

In the PR for #3710 I thought I independently fixed the problem by picking the last binding which matched, instead of the first. But that only fixed it in the case where they both matched. I did some testing and there is a small merge conflict with @low-batt's fix but it should be easy to remedy.

@lhc70000
Copy link
Member
lhc70000 commented May 7, 2022

would it be possible to implement both fixes for this issue?

Yes, of course, we don't want such a discrepancy. It's a bug. I will push a fix later to make sure the behavior is consistent with mpv as well as bumping the range (to make the shortcut displayed in the menu).

BTW,

It seems like it should be able to support Lua scripts and other advanced things but still have a nice user experience for the more casual user.

IINA supports mpv lua scripts and mpv config files in Preferences - Advanced. It supports all mpv arguments in the bundled iina-cli. I want to minimize the discrepancy between IINA and mpv, so if you found one feature that could be implemented in IINA, feel free to report it (or even submit a PR)!

There's a Javascript-based plugin system on the [plugin-system](https://github.com/iina/iina/tree/plugin-system) branch. It includes all mpv features, and you can also add video overlays, displaying custom window and sidebar, add subtitle downloaders, and even manage multiple player instances. Hopefully we can release it in 1.4.0…

@low-batt
Copy link
Contributor Author
low-batt commented May 7, 2022

The fix in this PR is not correct. This PR has been replaced by PR #3728. Closing this one.

@low-batt low-batt closed this May 7, 2022
@low-batt low-batt deleted the dupkeybind branch May 7, 2022 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0