Skip to content
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 access keys to tray menu #664

Merged
merged 8 commits into from Jan 16, 2023

Conversation

Susko3
Copy link
Contributor

@Susko3 Susko3 commented Jan 11, 2023

Access keys allow quickly selecting an option in a menu using only the keyboard. Access keys are defined with an ampersand & just before the desired character.

For my use case, this allows very quick access to toggling the theme and forcing light or dark theme. Previously, I would have to right click on the tray icon, and then snipe the buttons with my mouse. Access keys allow me to right click, and then press the desired key: T for Toggle theme, L for Force Light Theme, etc.

For me, using access keys is much faster, and adding access keys does not impede existing point-and-click usage.

How the access keys display (notice the underlined characters):

image

Please double-check that I've done the translations correctly, I've never used the translation system you use before.
Would it be possible to tag the copied translations as 'needs retranslation'? Or is that something that will happen automatically?

@Spiritreader
Copy link
Member

Spiritreader commented Jan 14, 2023

That's a really cool addition.
I'll take a look into merging asap!

Thank you!

Edit: Also, yes, weblate automatically detects if the translation key changes.

@Susko3
Copy link
Contributor Author

Susko3 commented Jan 14, 2023

Keep in mind you might need to enable 'Underline access keys when available' in Windows keyboard accessibility settings (found at ms-settings:easeofaccess-keyboard) to see the access keys. Or access the menu using only the keyboard: with a combination of Win+B and then Shift+F10 to open the tray menu of the focused icon.

@Spiritreader
Copy link
Member

Spiritreader commented Jan 14, 2023

Keep in mind you might need to enable 'Underline access keys when available' in Windows keyboard accessibility settings (found at ms-settings:easeofaccess-keyboard) to see the access keys. Or access the menu using only the keyboard: with a combination of Win+B and then Shift+F10 to open the tray menu of the focused icon.

Awesome, thanks.
Would it also work if we had for example a hotkey that opens the tray menu?

Also if accessibility keys show by default when holding alt, it may be possible to remove alt from the key listener such that they can be triggered even if it's off.

@Susko3
Copy link
Contributor Author

Susko3 commented Jan 14, 2023

Would it also work if we had for example a hotkey that opens the tray menu?

I think it should show the access keys, but I don't know how to test that.

Also if accessibility keys show by default when holding alt, it may be possible to remove alt from the key listener such that they can be triggered even if it's off.

Alt is only useful for when the access keys are in a toolbar / menu bar (tapping Alt will focus the toolbar and show the access keys). In my testing, pressing alt when a tray menu is open will close it (in Auto Dark Mode and all other tray programs).

Also the access keys can be used even if they are not shown/underlined.

Example menu bar:

image

@Spiritreader
Copy link
Member

Would it also work if we had for example a hotkey that opens the tray menu?

I think it should show the access keys, but I don't know how to test that.

Also if accessibility keys show by default when holding alt, it may be possible to remove alt from the key listener such that they can be triggered even if it's off.

Alt is only useful for when the access keys are in a toolbar / menu bar (tapping Alt will focus the toolbar and show the access keys). In my testing, pressing alt when a tray menu is open will close it (in Auto Dark Mode and all other tray programs).

Also the access keys can be used even if they are not shown/underlined.

Example menu bar:

image

Ah alright I see, thanks for the info.
I've found a way to always show access keys via userdll32. I'll add that with the merge.

@Spiritreader Spiritreader merged commit fd9b80d into AutoDarkMode:master Jan 16, 2023
@Susko3 Susko3 deleted the add-access-keys-to-tray branch January 16, 2023 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Available In Beta
Development

Successfully merging this pull request may close these issues.

None yet

2 participants