11
[question] curses getch() is too slow
(lemmy.world)
Welcome to the Python community on the programming.dev Lemmy instance!
Past
November 2023
October 2023
July 2023
August 2023
September 2023
I believe you are using it wrong. I assume Linux ofc.
You need to poll/wait on it, and it is immediate and never loses one press if you use it properly.
Otherwise look into raw mode, you will need to change the input mode and will be able to read keypresses "as in videogames".
If you need I can point you to some code, bit since you didn't post any I assume you want to do it by yourself
the problem was that that i was evaluating the output of getch() in every if statement inside my main loop instead of defining it as a variable inside the loop and checking that variable