|
|
|
@@ -492,7 +492,7 @@ setModifiers(PuglView* view, unsigned xstate, unsigned xtime) |
|
|
|
static unsigned |
|
|
|
scancodeToHID(unsigned scancode) |
|
|
|
{ |
|
|
|
const unsigned char KEYCODE_LINUX_TO_HID[256] = { |
|
|
|
static const unsigned char KEYCODE_LINUX_TO_HID[256] = { |
|
|
|
0,41,30,31,32,33,34,35,36,37,38,39,45,46,42,43,20,26,8,21,23,28,24,12,18,19, |
|
|
|
47,48,158,224,4,22,7,9,10,11,13,14,15,51,52,53,225,49,29,27,6,25,5,17,16,54, |
|
|
|
55,56,229,85,226,44,57,58,59,60,61,62,63,64,65,66,67,83,71,95,96,97,86,92, |
|
|
|
@@ -505,8 +505,11 @@ scancodeToHID(unsigned scancode) |
|
|
|
}; |
|
|
|
|
|
|
|
//On Linux, the keycodes are offset by KEYCODE_EVDEV_OFFSET when they are sent by evdev |
|
|
|
const unsigned KEYCODE_EVDEV_OFFSET = 8; |
|
|
|
static const unsigned KEYCODE_EVDEV_OFFSET = 8; |
|
|
|
|
|
|
|
if (scancode < KEYCODE_EVDEV_OFFSET) |
|
|
|
return 0; |
|
|
|
|
|
|
|
scancode -= KEYCODE_EVDEV_OFFSET; |
|
|
|
|
|
|
|
if (scancode >= 256) |
|
|
|
|