Interacting with keyboard LEDs

Jonathan Curran jonc at icicled.net
Sat Dec 9 00:35:50 EST 2006


On Friday 08 December 2006 23:18, Chris Lasher wrote:
> Is there a way to interact with keyboard LEDs (for Caps/Scroll/Num
> Lock) in Python? I'd like to achieve an effect similar to the *NIX
> command "setleds -L", but I'm not sure where to start, but I figured
> someone out there would have an idea or maybe experience with something
> similar. Thanks very much in advance for your help!
>
> Chris

Spur of the moment answer: call setleds program from within your program

better answer (fox X11): 
http://python-xlib.sourceforge.net/doc/html/python-xlib_16.html

Take a look at get_keyboard_control() and change_keyboard_control(). As far as 
knowing how to properly invoke them, I have no idea, maybe you could google 
for examples or take a look at the setleds source?

- Jonathan



More information about the Python-list mailing list