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

The / hotkey does not work #88

Open
Artur- opened this issue Jun 27, 2023 · 11 comments
Open

The / hotkey does not work #88

Artur- opened this issue Jun 27, 2023 · 11 comments

Comments

@Artur-
Copy link

Artur- commented Jun 27, 2023

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
Copy link
Member

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-
Copy link
Author

Artur- commented Jun 27, 2023

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

@Artur-
Copy link
Author

Artur- commented Jun 27, 2023

Seems like they are enabled by default though
image

@Artur-
Copy link
Author

Artur- commented Jun 27, 2023

Removing all extension make no difference either

@keithamus
Copy link
Member

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-
Copy link
Author

Artur- commented Jun 27, 2023

image

@formspiel
Copy link

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
Copy link
Member

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
Copy link

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

image

@cmawhorter
Copy link

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

  • Shift + a = Shift+A
  • caps lock enabled; a = A
  • caps lock enabled; Shift + a = Shift+A (IIRC on windows, caps lock + shift will result in lowercase? if that's still true then Shift+a is possible)

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.

@formspiel
Copy link

formspiel commented Oct 10, 2024

Hi.
I stumbled across hotkey again and the issue still exists but slightly different (weird) on a Mac (my former comment was on Windows).

My user agent
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0

Use case
Using "/" to open search on a non-US keyboard with a Mac

Test
type Shift + / into the Mapper and the output is: Shift+?

Behaviour on Github
Typing Shift + / opens the keyboard help (which makes sense, but it's wrong)

I have the feeling that this is an Apple issue. E.g., if you operate on a Mac before installing the OS any (even build-in) keyboard is US. What a stupid and egoistic view. :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants