Hi, I'm an embedded developer and trying to write some python software for a personal project (A bot for an idle game).
One concept I'm struggling with is asynchronous behavior and interrupts on desktop systems. I'm not really finding any good resources. I'm hoping one of you guys can explain this in a way that I get it or provide me some good resources to read.
What I want to do is pretty simple. I want to have a super loop around my software which runs until a condition is met (A specific key is pressed). I'd rather not use polling, requesting an input will block the software and require user input each loop. I've tried reading the keyboard state directly but the packages I used either didn't find my keyboard or required root access.
My preferred attempt would have been to register something like an interrupt handler which is called when a keyboard event is detected. The general suggestion on the internet for interrupts in python is the signal package. This however seems to only be for dealing with exceptions, not general interrupts.
Are interrupts for general events like I/O even a thing on desktops? And if so, how would I go about interacting with them from my code?
I feel with you but I think it also brought some benefits. Finding time to meet up with my friends has become harder and harder with everyone growing up, studying, getting jobs.
The influx of people during covid catapulted the virtual tabletop solutions ahead and now we regularly play again using foundry vtt since everyone can just sit at home.
But yeah, online everyone just talks about DnD or Critical Roll it feels like and unless you're on reddit there's very few communities left.