I am trying to do a project that prints something on an LCD and if I press a key on the remote control will stop printing that text and print something else. I am searching for something similar with the 'keyboard' package but I need it to work with external devices like IR remote or something similar not only with the keyboard.
Eg.: LCD prints: Hello StackOverflow!
and after 5 seconds LCD print: HI!
If I press any key on the remote: LCD prints: Hello StackOverflow!
key detected LCD prints: See you soon! without the last part.
I want to find a module/package or a command that can help me do this.
Just create a state machine and use it to decide whether running the code or not.
I implemented the code in C for an Arduino, but you can get the same in python for a raspberry pi. The concept of a state machine is the same.