Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcuts / Basic shortcuts #214

Open
jerrygreen opened this issue Nov 3, 2018 · 2 comments
Open

Shortcuts / Basic shortcuts #214

jerrygreen opened this issue Nov 3, 2018 · 2 comments
Labels

Comments

@jerrygreen
Copy link

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:

  1. Is it possible to enable such basic hotkeys? (⌘C, ⌘V, etc)
  2. How to properly handle inputs? (to send forms with Enter on any input instead of pressing buttons with cursor)
  3. 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)
@ptmt
Copy link
Owner

ptmt commented Nov 3, 2018

  1. Yes. You need to add TextInput, and if you have a menu Edit in your app, it'll provide all such functionality.
  2. 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.
  3. 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.

@jerrygreen
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants