Posts: 26
Joined: Dec 2010
Reputation:
0
hpooni
Junior Member
Posts: 26
Just wondering if its possible to capture key presses in a windowless script (ie. service). I would like to capture a key combination press and then popup a display. I did some searching but couldn't really find any examples.
Thanks.
Posts: 26
Joined: Dec 2010
Reputation:
0
hpooni
Junior Member
Posts: 26
Thank you. I will try that out.
Posts: 26
Joined: Dec 2010
Reputation:
0
hpooni
Junior Member
Posts: 26
Unfortunately that suggestion doesn't quite work as the invisible modal dialog steals the focus.
Posts: 1,355
Joined: Oct 2011
Reputation:
70
What key combination are you using, could you implement a custom keymap that runs your script when the correct key combination is pressed (although this would have to be restricted to a single key with an optional modifier)?
Posts: 26
Joined: Dec 2010
Reputation:
0
hpooni
Junior Member
Posts: 26
Hadn't decided on the key combination yet. I was actually hoping to make it user selectable. In my case the script (service) is already running and want to monitor keypresses inside it to activate a popup (display sports scores).
Posts: 1,355
Joined: Oct 2011
Reputation:
70
Does the service need to be running?
Could you use a custom keymap so that pressing S (or whatever key you choose) runs the script that displays your popup?