Invoking GUI for app running in background with a keypress
donald.welch at NOSPAM.hp.com
Tue Aug 16 00:03:33 CEST 2005
Mathias Dahl wrote:
> Jeremy Moles <jeremy at emperorlinux.com> writes:
>> If you want to get crazy you can poll() on one of the evdev nodes
>> (/dev/input/event*) and behave accordingly. I do this in a C application
>> we use to do the exact same thing you're talking about.
>> Each successful read from the device returns a 16-byte input_event
>> struct (or similar, I'm going from memory here) that represents a key
>> A google search returned this:
> Thanks for the pointer. That sounds crazy indeed! Maybe a bit too
> crazy (low-level) for me... :)
> I tested the code very briefly:
> $ python evdev.py /dev/input/event0
> Traceback (most recent call last):
> File "evdev.py", line 549, in ?
> File "evdev.py", line 35, in demo
> dev = Device(sys.argv)
> File "evdev.py", line 91, in __init__
> self.fd = os.open(filename, os.O_RDWR | os.O_NONBLOCK)
> OSError: [Errno 13] Permission denied: '/dev/input/event0'
> Loggin in (su:ing) as root solves that problem but I'm not sure I want
> to require the user being root to be able to run my program.
> Anyway, thanks again for the hint!
Could you make the script setuid?
More information about the Python-list