nearform / react-browser-hooks

React Browser Hooks
https://react-browser-hooks.netlify.com
Other
127 stars 10 forks source link

Keyboard events keyup/down etc. #21

Open cianfoley-nearform opened 5 years ago

cianfoley-nearform commented 5 years ago

Investigate and integrate...

jh3y commented 5 years ago

Not sure if this one's necessary. User would likely just opt for onKeyPress, onKeyUp etc.

cianfoley-nearform commented 5 years ago

maybe global hook could be useful for detecting browser wide key events (i.e. when nothing in focus someone might need to detect keypresses for shortcuts on web app)...

jh3y commented 5 years ago

Yep. That's a good use case. Will remove the labels. Just wanted to get some triage/discussions on some of the issues so it's clear what the idea or intention could be 👍

tbrd commented 5 years ago

I found the big trick with keyboard shortcuts is determining which component has focus. Up/Down has a different effect depending on context. Hooks could be a useful way to manage this.