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

Suggestion. Could we have a keyCode map? #168

Closed
fernandosouza opened this issue Oct 25, 2016 · 5 comments
Closed

Suggestion. Could we have a keyCode map? #168

fernandosouza opened this issue Oct 25, 2016 · 5 comments

Comments

@fernandosouza
Copy link
Contributor

In order to work easily with keyboard events, it will be nice to have a keyCode map like http://yuilibrary.com/yui/docs/event/key.html

@yuchi
Copy link
Contributor

yuchi commented Oct 25, 2016

You can steal this as a starting point: https://github.com/smclab/react-faceted-token-input/blob/master/src/key-codes.js

Of course you'd also need the reversed map (code -> key).

@fernandosouza
Copy link
Contributor Author

Cool, @yuchi! Thank you! :)

@yuchi
Copy link
Contributor

yuchi commented Oct 26, 2016

You can access them as a single object with import * as codes from ….

@fernandosouza
Copy link
Contributor Author

I began to implement.

@mairatma
Copy link
Contributor

Just FYI, Fernando added this as a separate module called metal-key.

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

No branches or pull requests

3 participants