github / hotkey

Trigger an action on an element with a keyboard shortcut.
https://github.github.com/hotkey/
MIT License
3.21k stars 96 forks source link

The / hotkey does not work #88

Open Artur- opened 1 year ago

Artur- commented 1 year ago

In the readme there is

<a href="/search" data-hotkey="s,/">Search</a>

the same code is used in the GitHub toolbar that says "Type / to search".

The problem is that pressing / (shift + 7 on a finnish keyboard) does not trigger the search. It does nothing. Pressing "s" does trigger it.

keithamus commented 1 year ago

For shortcuts like these to work, you must have "Character keys" enabled within the accessibility options within your GitHub settings. Please also make sure you're not using a browser extension that might override these, such as vim-mode extensions.

a screenshot of the accessibility section in GitHub settings. It shows the title "Accessibility", the subtitle "Keyboard Shortcuts" followed by the subheading "General". There is a checkbox labelled "Character Keys" which has been checked. The description for Character keys says "Enable GitHub shortcuts that don't use modifier keys in their activation. For example, the g n shortcut to navigate notifications, or question mark ? to view context relevant shortcuts. Learn more about character key shortcuts."

Artur- commented 1 year ago

Uh... so to use the shortcut mentioned by default on the frontpage of all repositories in GitHub, I must configure something?

Artur- commented 1 year ago

Seems like they are enabled by default though image

Artur- commented 1 year ago

Removing all extension make no difference either

keithamus commented 1 year ago

Uh... so to use the shortcut mentioned by default on the frontpage of all repositories in GitHub, I must configure something?

The option is enabled by default.

Could you please visit https://www.toptal.com/developers/keycode and press the / key, and take a screenshot of the values that come back. Thank you.

Artur- commented 1 year ago

image

formspiel commented 1 year ago

Hi, I can confirm that the same code is true on the German keyboard.

It's super awesome that the icon is visually present to support learnability, but I tried so often, and it never worked. It's a bit disappointing. Hope I can also help to get this to work.

Yes, accessibility option is enabled.

keithamus commented 1 year ago

Can you please visit this page: https://github.github.io/hotkey/examples/hotkey_mapper.html and, once loaded, tap the desired key and report back with a screenshot - and perhaps copy the code? Thanks.

formspiel commented 1 year ago

To achieve "/" on a German keyboard, I've to press "shift" and "7" The Hotkey Mapper output is: Shift+/

image

cmawhorter commented 1 month ago

shift seems like a problematic hotkey target. here's some results from the mapper on my mac en-US keyboard:

obviously caps lock is an edge case, but it exemplifies the problem that the keyboard event key and shift aren't much related.

github.com should have the same problem as OP for me with the ? hotkey since that results in "Shift+?" in the mapper, but i'm guessing that hotkey is handled differently.

looking through the vscode keyboard shortcuts, i don't see any using shift and i'd bet this is why.