Comments (3)
After a bit of investigation, this sort of makes sense. When pressing combo keys, the following is (roughly) registered:
- Add
shift
- Add
?
- Remove
shift
- Remove
/
<= that's the issue ; it's because without theshift
, the?
key is now registered as a/
key. So?
is never removed from the currently pressed keys, and any press toshift
triggers the combo again.
This is on a en-US keyboard, but I suspect it's true for any shift
combo on any keyboard. The particular key here is:
┌─────┐
│ ? │
│ / │
└─────┘
Not sure how best to fix this, as I don't fully understand the entire implementation logic.
Incidentally, pressing /
then shift
, which should (could?) produce the shift+?
, does not work either.
from react-hotkeys-hook.
I solved this by doing the same as for the command key. On macOS the keyup event of letters and digits is not triggering while holding the command key down. That's why you can't just remove single keys of the array but need to clear it. The way I solved this also worked for the shift key!
Set a timeout each time shift is pressed. When it is released, instead of trying to remove the specific characters which were pressed with the shift key, the array of pressed keys is cleared completely. This ensures that you have no characters left in the pressed keys array.
from react-hotkeys-hook.
Yes this is currently a problem, because the library mixes the produces symbol with the produced key code. This will be fixed in version 5.
from react-hotkeys-hook.
Related Issues (20)
- [BUG] Hotkeys for 'z' and 'y' not working correctly when using ISO keyboard layout HOT 4
- Add 'mod' modificator to the official doc HOT 1
- [BUG] Unclear mention of filterPreventDefault in the documentation HOT 2
- [V5] Remove references to keyCode HOT 2
- [V5] Add keyboard layout section to Docs
- [DOCS] [BUG] isHotkeyPressed example not working
- [BUG] Selecting a Suggestion Bubble on a Text Field throws an error HOT 1
- [BUG] Scoped hotkeys still trigger when scope is not active HOT 2
- [BUG] keyup doesn't get fired for combinations HOT 1
- [BUG] `useHotkeys` Triggers Incorrectly when in Fullscreen Mode HOT 3
- [BUG] `mod` matches both `command` and `control` modifier key on Mac OS HOT 5
- [QUESTION] - Keys doesn't include modifiers? HOT 1
- [BUG] "ctrl" alone not triggered HOT 2
- [BUG] `requestFullScreen` causes keys to stick HOT 2
- [BUG] Ctrl + Alt + alphabetic key shortcut won't work on Firefox on some international layouts
- [BUG] All components that use `useHotkeysContext()` is re-rendered when scopes change HOT 2
- Call ignoreEventWhen only if KeyboardEvent matches a hotkey HOT 2
- [BUG] isHotkeyPressed does not recognize arrow keys (ex: "ArrowLeft"), but useHotkeys does
- `useHotkeysContext` is missing in docs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-hotkeys-hook.