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

Add useInput hook to handle user input #227

Merged
merged 22 commits into from
Sep 26, 2019
Merged

Add useInput hook to handle user input #227

merged 22 commits into from
Sep 26, 2019

Conversation

vadimdemedes
Copy link
Owner

Follow up to #147. Thanks to @jedahan for implementing the initial useKeypress hook. This PR changes it to listen to data event instead of keypress and renames the hook to useInput.

index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@sindresorhus sindresorhus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

index.d.ts Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
examples/useinput/useinput.js Outdated Show resolved Hide resolved
src/hooks/useInput.js Outdated Show resolved Hide resolved
src/hooks/useInput.js Outdated Show resolved Hide resolved
@vadimdemedes
Copy link
Owner Author

@sindresorhus Great feedback, fixed everything! Regarding #227 (comment), I was unable to reproduce meta detection, no idea how to trigger it. Google says it's Cmd key on Mac, but terminal seems to ignore it.

@sindresorhus
Copy link
Collaborator

@vadimdemedes
Copy link
Owner Author

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.

@vadimdemedes
Copy link
Owner Author

@sindresorhus Meta key is in.

index.d.ts Outdated Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
Vadim Demedes and others added 2 commits September 25, 2019 20:43
Co-Authored-By: Sindre Sorhus <sindresorhus@gmail.com>
@vadimdemedes vadimdemedes merged commit 4960ff7 into master Sep 26, 2019
@vadimdemedes vadimdemedes deleted the useinput branch September 26, 2019 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants