jaywcjlove / react-hotkeys

React component to listen to keydown and keyup keyboard events, defining and dispatching keyboard shortcuts.

Home Page:https://jaywcjlove.github.io/react-hotkeys/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Holding modifier only reads as 1 event

chandlervdw opened this issue · comments

As it stands, a feature like copy + paste feels cumbersome, as you are required to release all keys before typing another combination. Most people will hold their finger on the modifier key while hitting c, then v. This only results in one event, at least when I use keyName="*" (using a specific list also doesn't work).

Am I missing something or is this just a limitation of the library?

This is not in the hotkeys-js lib, but in the react-hot-keys npm module. In that repo's readme, it says it's a fork of hotkeys-js.

I couldn't figure out how to properly import react-hot-keys into codepen (I used https://unpkg.com/react-hot-keys@1.3.0/umd/react-hot-keys.min.js). It kept complaining about

Cannot read property 'Component' of undefined

where undefined was react within react-hot-keys.

I'm not sure what to say other than your hotkeys-js implementation in the codepen worked but it does not work when using the <Hotkeys /> component.

Thanks, I'm unsure of what I had going that was breaking that functionality.