diff options
author | marha <marha@users.sourceforge.net> | 2009-07-25 19:39:46 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-07-25 19:39:46 +0000 |
commit | 4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05 (patch) | |
tree | c1e02b9d3509aa97703aa4b540d4cd22ec4600ed /xorg-server/hw/kdrive/linux/keyboard.c | |
parent | dc3c299dd0995549e2a6973ca0f25b254afd38a5 (diff) | |
download | vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.tar.gz vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.tar.bz2 vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.zip |
Added xorg-server-1.6.2.tar.gz
Diffstat (limited to 'xorg-server/hw/kdrive/linux/keyboard.c')
-rw-r--r-- | xorg-server/hw/kdrive/linux/keyboard.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/xorg-server/hw/kdrive/linux/keyboard.c b/xorg-server/hw/kdrive/linux/keyboard.c index 3193ab761..ae981b776 100644 --- a/xorg-server/hw/kdrive/linux/keyboard.c +++ b/xorg-server/hw/kdrive/linux/keyboard.c @@ -42,6 +42,8 @@ #include <sys/ioctl.h> extern int LinuxConsoleFd; +static unsigned char mediumraw_data, mediumraw_up; +static enum { DEFAULT, EXTBYTE1, EXTBYTE2 } mediumraw_state = DEFAULT; static const KeySym linux_to_x[256] = { NoSymbol, NoSymbol, NoSymbol, NoSymbol, @@ -701,7 +703,29 @@ LinuxKeyboardRead (int fd, void *closure) else #endif scancode = b[0] & 0x7f; - KdEnqueueKeyboardEvent (closure, scancode, b[0] & 0x80); + /* This is extended medium raw mode interpreter + see linux/drivers/keyboard.c (kbd->kbdmode == VC_MEDIUMRAW) */ + switch (mediumraw_state) + { + case DEFAULT: + if (scancode == 0) + { + mediumraw_state = EXTBYTE1; + mediumraw_up = b[0] & 0x80; + } + else + KdEnqueueKeyboardEvent (closure, scancode, b[0] & 0x80); + break; + case EXTBYTE1: + mediumraw_data = scancode; + mediumraw_state = EXTBYTE2; + break; + case EXTBYTE2: + /* Note: Only codes < 256 will pass correctly through KdEnqueueKeyboardEvent() */ + KdEnqueueKeyboardEvent (closure, (int)mediumraw_data << 7 | scancode, mediumraw_up); + mediumraw_state = DEFAULT; + break; + } b++; } } |