-
-
Notifications
You must be signed in to change notification settings - Fork 619
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
Add useInput
hook to handle user input
#227
Conversation
82341aa
to
6214d00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sindresorhus Great feedback, fixed everything! Regarding #227 (comment), I was unable to reproduce |
62ad031
to
5ae2cc1
Compare
@vadimdemedes Look at how Node.js does the detection: https://github.com/nodejs/node/blob/ab841d5fbab1a9d2f8323d1ae3f71f37c6f636a1/lib/internal/readline/utils.js#L168-L172 |
I meant I wasn't able to trigger the meta key, not to implement the detection of it. I tried pressing Cmd + letter, but terminal seems to ignore that combination. |
5ae2cc1
to
460125e
Compare
@sindresorhus Meta key is in. |
Co-Authored-By: Sindre Sorhus <[email protected]>
Co-Authored-By: Sindre Sorhus <[email protected]>
Co-Authored-By: Sindre Sorhus <[email protected]>
Co-Authored-By: Sindre Sorhus <[email protected]>
ba3cf45
to
44e9fa5
Compare
Co-Authored-By: Sindre Sorhus <[email protected]>
Follow up to #147. Thanks to @jedahan for implementing the initial
useKeypress
hook. This PR changes it to listen todata
event instead ofkeypress
and renames the hook touseInput
.