What I'm trying to do is have a key that, when pressed, performs an action. This works fine expect the program will be running in the background. I came across the function "registerHotKey" but because my ability to understand easily from documentation isn't very good I'm struggling. Documentation here.
I'd appreciate if someone could give me a basic example of how I would use this, thankyou