uterm_input_uxkb: update leds to match keyboard state
authorRan Benita <ran234@gmail.com>
Fri, 26 Oct 2012 16:14:32 +0000 (18:14 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 27 Oct 2012 16:12:59 +0000 (18:12 +0200)
commitb5c05dd5f1523fafded15297001b44efebab9914
treee8765fc104fcac5adb32830f4f6600dfe5bc6b5e
parent28c8d07109eb2de866a15c4ddfdf46351288374a
uterm_input_uxkb: update leds to match keyboard state

Upon device wakeup or led state changes, we update the keyboard LEDs to
match the new xkb state.

This means that every kmscon instance retains its own LED state, in the
users eyes. In other words, if you had Num Lock set on one kmscon, switched
to an X VT where it's off, and come back, then Num Lock will be set as
when you left. This is what X server, linux VT, etc. do.

Note that since we need to write the LED events to the evdev devices, we
need to open them RDWR. But since we don't really care what happens to
that write(), that's fine.

Also note that this means NumLock is off by default, which might be
annoying. We need to think how to get some 'setleds' or 'numlockx'
equivalent functionality.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/uterm_input.c
src/uterm_input_uxkb.c