react-native-macos
react-native-macos copied to clipboard
Shortcuts / Basic shortcuts
There are some basic shortcuts like ⌘C
, ⌘V
, etc
Also, in web there are form
tags which helps to handle Enter
key – to send the form. Is there a good way to handle this with react-native-macos
?
So the issue is more like 3 questions:
- Is it possible to enable such basic hotkeys? (
⌘C
,⌘V
, etc) - How to properly handle inputs? (to send forms with
Enter
on any input instead of pressing buttons with cursor) - What about custom hotkeys? It looks like it's possible. Any examples? Any docs? (I feel some lack of docs for
react-native-macos
– this is pretty sad because I really like this project)
- Yes. You need to add TextInput, and if you have a menu Edit in your app, it'll provide all such functionality.
- Right now it requires some tweak in the core or writing your own native code. I can help with that, if you have a demo project.
- Hotkeys are definitely possible. It's again can be achieved with the menu https://github.com/ptmt/react-native-macos/blob/master/RNTester/js/MenuExample.macos.js#L25 or with the global hotkey handler even when your app is in background. Let me know if you're interested in a custom native module for that.
and if you have a menu Edit in your app
How do I have it? I have TextInput but should I somehow enable these menus?