You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Works just fine (even though the type of View doesn't specify it ... however it only works after I e.g. click a specific TextInput (even if I move it out of focus later).
Is there an updated workaround to getting global keyboard listening to work (thus allowing things like hotkeys/shortcuts) ?
The text was updated successfully, but these errors were encountered:
onKeyPress is a TextInput only prop / event which I suppose bubbled up without us realizing.. I wouldn't rely on that. We inherit that prop from React Native on mobile, and it doesn't really fit into the desktop keyboard API.
For global keyboard listening, since React Native is mostly only Root view and down, I think you still have to rely on implementing that natively with something like https://github.com/sindresorhus/KeyboardShortcuts unfortunately.
Reading through #966 and https://github.com/microsoft/react-native-macos/issues/823
It seemed that the recommended way to get global keyboard listeners was using
onKeyDown
on a top-levelView
This seems not to work however I found:
Works just fine (even though the type of
View
doesn't specify it ... however it only works after I e.g. click a specificTextInput
(even if I move it out of focus later).Is there an updated workaround to getting global keyboard listening to work (thus allowing things like hotkeys/shortcuts) ?
The text was updated successfully, but these errors were encountered: