We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently listening for keyboard input in Bun either involves waiting for a user to hit enter after a prompt() or using process.stdin like this:
prompt()
process.stdin
process.stdin.setRawMode(true) process.stdin.on('data', (e) => { console.log(e) if (e[0] == 32) { console.log('Spacebar pressed') process.stdin.setRawMode(false) } })
What if Bun supported key events instead, like browsers.
onkeydown = (e) => { if (e.key === ' ') { console.log('Spacebar pressed') } }
No response
The text was updated successfully, but these errors were encountered:
interesting idea
it's a bit tricky because for terminals you need to enter "raw mode" which means you can't press ctrl + c anymore and a few other things
Sorry, something went wrong.
No branches or pull requests
What is the problem this feature would solve?
Currently listening for keyboard input in Bun either involves waiting for a user to hit enter after a
prompt()
or usingprocess.stdin
like this:What is the feature you are proposing to solve the problem?
What if Bun supported key events instead, like browsers.
What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: