-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
feat: "write" keystroke event in process.stdin #43137
Comments
Do I summarize correctly you want a way to inject key strokes? I won't bore you with details but this is one of those seemingly simple things that gets horrendously complex in practice. I don't see Node.js adopting a general solution because you're usually better off with a narrower scoped custom solution like xdotool. |
Hey @bnoordhuis 👋 Thanks for your answer 🔝 I have already tried to take a look at
Please do ^^ Before sending this issue I was thinking that I mixed up apples and pears. Please let me know if it's the case :) |
So, one problem is that xdotool works on a completely different level (the X protocol) than the tty. Key stroke injection for ttys is restricted to the byte-at-a-time And that's Unices. Windows is its own can of worms. |
@bnoordhuis Thanks a lot for these insights ^^ |
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document. |
There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment. For more information on how the project manages feature requests, please consult the feature request management document. |
What is the problem this feature will solve?
Hey Node.js family 💚
The purpose is to be able to simulate user keystrokes in
process.stdin
.What is the feature you are proposing to solve the problem?
I observed that we could switch
stdin
torawMode
and listen for keypress events. Try to run this piece of code:Now, press the right arrow of your keyboard and you should observe in the console:
So, the idea is to be able to pass/write/append this keystroke event into
process.stdin
:(Maybe the
.write
API should be reserved forString
ofBuffer
, I probably make some confusion here, sorry for that)What alternatives have you considered?
During my search, I found this tool: https://github.com/jordansissel/xdotool (and found a Node.js binding).
But I thought that it should more convenient to have it in Node.
The text was updated successfully, but these errors were encountered: