-
Notifications
You must be signed in to change notification settings - Fork 159
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
[BUG] Sequences like 'g' then '1' kills every other hotkeys after first execution #255
Comments
Update As it turnt out there is a key always stuck in the listening queue and as a result the previous key sequence's last key will be the "base" for next key events |
I've been running into this as well. It seems to be the same underlying problem as #219, though I like the solution you have here more. Any details on how to explicitly import |
@rmadsen yes, there is no public export of KeyEventManager class, so you have to import it either from cjs or es module depending on how your project is configured. I have imported from the es directory from 'react-hotkeys/es/lib/KeyEventManager' path. Later on I have abandoned the idea of using this library - due no respnse at all - and created custom by using hotkeys-js which this library using too. |
Thanks for posting your issue. Unfortunately I do not have the time to actively work on this package, but I am seeking other active maintainers. If you are willing to create a pull request or help out, that would be an excellent way of moving this forward. |
@rmadsen @dannystyleart could either of you explicitly tell me how to import KeyEventManager.. I'm getting an error with: error:
|
@v-bbrady this is because you are using typescript. I was using this package in an ES project so I did not face this problem but I think the solution for your problem would be:
@greena13 I have moved away from that feature but as soon as I have time for it I'll try to make a fix and PR for it. |
@dannystyleart your solution works, but unfortunately, if you keep holding down a modifier key from the previous hotkey, and then press another key for another hotkey that has the same modifier, the modifier key gets erased from the listening queue. Given Case 1: Case 2: Looks like getting around this requires a more robust fix in the codebase itself. |
FYI I was getting errors from Jest with this fix unless I imported
|
Describe the bug
A clear and concise description of what the bug is.
If we want to create vim like 'g' then '1' hotkeys where the user presses letter g, releases and then presses number 1 are not working.
After first execution of any hotkey mapped, the one letter ones are unbinded
How are you using react hotkeys components? (HotKeys, GlobalHotKeys, IgnoreKeys etc)
I would like to register global hotkeys via GlobalHotKeys component that are having sequences like:
and one letter ones too like 'c' to create message or 'v' to create not and 'b' to tasklist.
Expected behavior
A clear and concise description of what you expected to happen.
Should work for sequences correctly without unbinding others.
Platform (please complete the following information):
Codesandbox for reproduction
https://codesandbox.io/s/react-hotkeys-issue-v6gvy
The text was updated successfully, but these errors were encountered: