-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add “Show Current File in Finder” menu item (#5001) #5005
base: develop
Are you sure you want to change the base?
Conversation
@svobs Should be able to explain how to add the shortcut for the menu item. |
I think adding the keybinding in "IINA Default" input config and it can be automatically matched and show up in the menu. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from what @low-batt has indicated, I have nothing to say. We should consider adding this into the default configuration, and we can add after merging this PR. The problem is should we add this to all default configs (mpv, VLC, Movist)?
54b5e93
to
1e8c04a
Compare
We do need to get the menu shortcut working. The one suggested is ⌘R. I checked Mac keyboard shortcuts and this is how Apple uses that key:
I don't think it is unreasonable to use ⌘R, but I'm not that familiar with IINA's key binding code. Need to hear from @svobs and @lhc70000. |
6aa33e3
to
784f781
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with the changes. I'll try to abstract the logic of @IBAction func contextMenuShowInFinder(_ sender: NSMenuItem)
after merging this PR. Not sure whether or not that's worthwhile
Add the 2 lines below to the case statement of internal func handleIINACommand(_ cmd: IINACommand) {
switch cmd {
// […]
case .showCurrentFileInFinder:
menuActionHandler.menuShowCurrentFileInFinder(.dummy)
// […]
|
Having connectivity problems here...strange... After adding the code I posted above, everything will be in place for the end user to add a row like this one to your Key Bindings configuration: |
The shortcut key still needs to be added to |
I was in a little bit of a hurry when I wrote that, but I found time to re-evaluate and have determined that adding a case to I filed a PR, #5012, which has more info if curious. |
Co-authored-by: low-batt <[email protected]>
I'm not sure that Cmd+R fits here, because it's usually used to refresh (in browsers, XCode, etc.) |
I too am concerned about the choice of key. From Spotlight keyboard shortcuts on Mac:
So we have an Apple example of ⌘R being used to bring up I need to defer to @svobs and @lhc70000 on the choice of key. |
I do want to note that this is feature already pretty much available because we present a document proxy icon, which makes it easy to locate the file and open a Finder window for it. I’m not opposed to also adding a “Reveal in Finder” menu item but it definitely should not be squatting on shortcut prime real estate like ⌘R by default. |
The document icon is not available in legacy full screen or in music mode. It is lost when either the |
Also agree that ⌘R is probably not the best default. I would associate it more with Reload or Refresh or some other command starting with R, particularly since the action is no longer called "Reveal in Finder". But I wouldn't use anything with S or F either as those have much stronger existing associations. Maybe just add another modifier key? ⇧⌘R? Looking at the existing IINA defaults, there doesn't seem to be a strong pattern to follow for which modifier(s) to add. |
Apple guidance on custom keyboard shortcuts can be found here. Don't be confused by the entries in the
Focusing on the keys that trigger IINA actions we can see there isn't a consistent pattern but many use ⇧⌘: So ⇧⌘ and one of the keys not already used seems right. |
Not meant to divert the discussion too much, but there's an alternative is to not set any default keybindings for that and let the user to set whatever they want. |
I thought about that, but configuring key bindings is a bit advanced. I would not be surprised if many users looked at the new menu item, saw there was no keyboard shortcut and gave up. Therefore I think it is important we provide a default key binding. I'm thinking ⌃⌘R due to the use of ⌘R by Spotlight. |
I suggest ⇧⌘R. We use ⇧⌘ when possible and I prefer it over ⌃⌘ because it's more comfortable when pressing. The reason we have other modifiers for some shortcuts are
|
I agree, ⇧⌘R. |
We also use the ⇧⌘ convention for the mpv defaults as well, but it looks like we switched to ⌥⌘ for Movist and VLC. So ⌥⌘R for Moviest and VLC? |
Description:
Adds a menu bar item (under
File
) to reveal the current file in Finder.For some reason I was unable to set a Cmd+R shortcut, even though I set it through the interface builder, the shortcut doesn't work, so the PR does not currently include a shortcut.Built and tested with XCode 15.1, on MacOS 14.5.