Answer the question
In order to leave comments, you need to log in
How \ than to track the pressing of the arrow keys, etc.?
Hello.
I need to somehow track the pressing of the arrows and, depending on the key pressed, send a command to the port.
Once upon a time, I did something similar in VB via winAPI, now I use Debian - this option does not work.
1) Found a way through
tty.setcbreak(sys.stdin)
ord(sys.stdin.read(1))
XX
YY
ZZ
Answer the question
In order to leave comments, you need to log in
What application, console, with graphics?
Have you tried using curses ( stdscr.getch() )?
The application for controlling the machine via Wi-Fi - catches pressing the button, sends the command code through the socket, at the other end the server part throws bytes into the uart to the controller of the engines. In principle, I already did it on pygame, though during initialization a window opens, which should be in focus. In fact, you can leave it like that - I will do some kind of animation there later, if not lazy.
curses (stdscr.getch()) didn't try it - didn't know about it. I'll try, thanks for the advice.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question