Interacting with keyboard LEDs

Chris Lasher chris.lasher at gmail.com
Sat Dec 9 13:33:03 EST 2006


Jonathan Curran wrote:
> 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

Thanks for your reply, Jonathan. The difficulty with setleds is that
only works from a virtual console (e.g., tty, CTRL+ALT+F1 through F6,
etc.), not from a terminal emulator inside X (e.g., pts, Xterm, Gnome
Terminal, Konsole, etc.), which is the environment where I'd like to
interact with the LEDs. The xlib package looks promising, though. One
thing I don't understand is the 32-bit mask. How does this represent
the LED states? I profess my ignorance.

Thanks!
Chris




More information about the Python-list mailing list