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
Related to #1220 - keyboard bindings/mnemonics #1221
Conversation
Modify top level menu elements with the shortcuts.
💖 Thanks for opening this pull request! 💖 To help make this a smooth process, please be sure you have first read the |
I think this PR looks pretty good so far! Just a few things.
|
Was looking how to implement a custom app menu and noticed the GitHub app is using mnemonics too! https://github.com/desktop/desktop/blob/e69467d1239c1b2cb0e290b61f8f703aaa9deeea/app/src/main-process/menu/build-default-menu.ts |
@gschier - thanks for looking over this! Sorry for the ghost - dealing with sudden death in the family. Happy to finally be getting back to normalcy though. In response to your questions: 1 - The '&' character in a menu label on Windows (and Linux I believe) denotes a 'mnemonic' for that menu label. It is used to indicate basically the ALT shortcut key for that menu item. In Windows, this is what drives the function where you see the underlines appear on a character of menu items when you press ALT, and natively makes the menu items focus when pressing ALT+{letter after mnemonic}. As for a link, you can check out this MSDN article on Mnemonics - https://docs.microsoft.com/en-us/cpp/windows/defining-mnemonics-access-keys?view=vs-2017 2 - I will definitely post a picture of this in the next revision of the PR (hopefully today) 3 - I only implemented mnemonics on the top level menu and the file menu as an example of mnemonic usage to see if you were OK with the method of implementation. I'm going to implement the rest of the menu items now and submit a PR. |
For some example images, (not quite sure how best to visualize this without a video) - but I'll try, here's the current application. When the user presses ALT, you can see that none of the menu bar items show any difference: With the updates, the menu bar displays underlines under the mnemonic keys: This allows me to press ALT+A for example (since A is the mnemonic specified for the Application menu), and it will open the Application menu, showing the mnemonics for the application menu-items as well: As well, I've bound a CMD/CTRL+SHIFT shortcut for the keyboard shortcuts list for usability, as well as F1 for the Help site to coincide with the standard for F1=help in an application. Last, I applied a minor style update to the tabs styling to highlight the tab with focus, so if you're tabbing through a modal/tab, you can tell when you reach the tab list, and can navigate via left/right when it is highlighted: I also looked into how to make the tab interfaces listen for CTRL+[SHIFT]+TAB navigation, but at this time am not able to see the best method to implement. I think this is good for now, unless you see any changes? |
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.
Thanks for this! Just a few minor comments.
Congrats on merging your first pull request! 🎉🎉🎉 You're helping make Insomnia awesome! 🙌 |
* Add constant for platform specific mnemonic for menu shortcuts. Modify top level menu elements with the shortcuts. * Add global hotkey to show keyboard shortcuts * Apply updates to mnemonics in menu bar allowing for alt-shortcuts * Mod to color a :focus tab, for visibility when tabbing through controls * Revert tabs style changes, focus F1 functionality for non-mac devices
This pull request begins to address adding mnemonics to insomnia menu items for easy accessibility on the Windows platform, as well as adding a global shortcut listener for a hotkey to access the insomnia shortcuts list. Most changes from this checkin appear to be from auto-linting.