Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is silly, you can't detect key up or keyb down in a tty, you detect what the terminal emulator gives you: chars and Esc sequences.

It's as sane as asking why you can detect joystick movements or the kettle boiling.

It bothers me how little people understand about the terminal and "the command line", despite using it everyday.

If people read man bash from top to bottom they would probably get a feel for what is going on. Learn how changing the title of your tty works and there is not much left to _not_ understand.



Yeah, the author is not running into a Linux problem. He is running into an SSH problem.

>Something worth noting to avoid confusion is that if you run the example python keyboard example in the introductory paragraph of this article over an SSH connection, the code will still work and run, but when you type characters, nothing will happen.

>What gives?!? That's because it will be detecting 'local' keyboard events from the machine you just SSHed into! If it's a cloud server like EC2 or something, there probably aren't any keyboards attached to it!

"What gives?!?"? Is this supposed to be a joke? What else did you expect? Expecting your local keyboard to connect to the remote machine is as insane as expecting your keyboard to read the keys you want to press from your mind.

The problem he is running into is that SSH only forwards a character stream to the remote machine and that is entirely an SSH problem and the solution to forwarding the keyboard has been X forwarding. What he is asking is that SSH should be able to forward the keyboard without X.

He even mentioned a workaround that involves compensating the lack of this feature by forwarding the keyboard himself.

>Well, you have to build your own client/server application where a client/server listens locally on the machine with the keyboard, and then forwards these events to the remote machine where you're running the applications that needs to respond to these events.

My suggestion is that he should send an email to the openssh developers to add keyboard forwarding without X.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: