-
-
Notifications
You must be signed in to change notification settings - Fork 733
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
allow use of linux Super key for shortcuts #2524
Comments
I looked at this a little bit, and I'm not sure what would be needed to support this. Internally, Min has two separate keyboard event handlers, depending on which part of the UI you're in: The first is Mousetrap - I think the Linux super key would be equivalent to the Windows key, but that apparently isn't supported, and it wasn't added because "Unfortunately this means it is not going to be a simple thing to add to the core library since the windows key is not treated as meta, shift, ctrl, or alt" (ccampbell/mousetrap#81) The usage of Mousetrap is mostly just a leftover legacy thing - it would make sense to refactor everything to use the Electron input system, which we also use in some places. If we did that, then these docs apply: https://www.electronjs.org/docs/latest/api/web-contents#event-before-input-event That page doesn't mention the super key specifically, but the linked keyboardEvent.metaKey docs say:
Which seems to contradict what the Mousetrap issue says. I only have Apple keyboards to test this on (so nothing with a super key), but if you have time, could you try this? Then, while the keyboard focus is in the browser UI (like the searchbar, not a webpage), try pressing super+any key, copy the resulting input object from the devtools, and paste it here. |
Thanks for your detailed response! I'm not sure I follow 100% of what you said about Mousetrap vs Electron but it sounds like there's hope maybe. I'd be happy to try what you suggest... I edited the I have a separate machine that runs Ubuntu so hopefully it will work there. (Will try again and update soon)
|
Okay so I was able to update Min works fine (using I thought maybe my assumption was wrong about printing to stdout so I also checked recursively for modified files using |
Nope.
You'll need to look for developer > inspect browser > console in the application menu. Sorry for not mentioning that. |
Got it, thanks! If I try to use a Meta like shortcut in the Min searchbar nothing prints to the console but the same is true for shortcuts that are actively working for me (ctrl+T to open a new tab). However, if I shift focus off the search bar and press, say, Meta+T and then release the following is printed to the console:
There's also the option to expand each of these lines for key down/up like:
Which then have the option to be expanded further so let me know if any of that info is helpful too or if there are any other tests I could try. |
Thanks! I've created a branch here with what I think is the correct mapping, can you try it? https://github.com/minbrowser/min/tree/linux-super-key I think the right combination is:
(does that sound right?) |
I just checked out the new branch and it worked! Specifically if I assign "super+t" in the shortcuts and then restart Min, that shortcut now works. This totally resolves my request (many thanks) but just for your reference, I'm finding that "mod" is not an accepted shortcut. If I type that for a shortcut and restart Min it seems to default back to whatever the previous shortcut was. This is a non-issue for me as I can still simply use "Ctrl" directly (instead of "mod") which works fine and appears to be the default for most shortcuts when running Min under Linux. Please let me know if you need any other tests/info from me and thanks again for making the needed changes to get this to work! |
Edit: I see now that in |
Oh, right, I forgot that we actually display "mod" in the UI as either command or ctrl, depending on your OS. I've created a PR #2543; I'll merge it in a bit assuming there are no comments. |
I love everything about Min. Great functionality; very sleek.
I can easily find how to set custom shortcuts on the settings page but as far as I can tell, the only recognized modifiers are "ctrl" and "alt" (which map to "mod" and "option", respectively in the
settings.json
file)I attempted to write in "super" as a short cut (e.g.
super+t
for new tab) but it didn't seem to register.I also tried "meta" since that's how the super key is recognized in Vivaldi and "m" which is used for super in Chromium.
Is using the Super key currently possible in Min?
Would it be feasible to implement?
Could one develop a userscript to make it work or are modifiers too "low level"?
The text was updated successfully, but these errors were encountered: