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-level View
This seems not to work however I found:
onKeyPress={(e)=> {
console.log(e.nativeEvent.key)
}}
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) ?
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
onKeyDownon a top-levelViewThis seems not to work however I found:
Works just fine (even though the type of
Viewdoesn'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) ?