Moje HTPC i nie tylko

Takie tam…

Maxter Plus i XBMC-PVR

6 komentarzy

Aby korzystać z wszystkich przycisków pilota Maxter Plus pod XBMC, należy:

1. zmodyfikować driver evdev

2. Użyć zmodyfikowanych mapować klawiatury – gotowy plik keyboard.xml skopiować do /usr/share/xbmc/system/keymaps

Nie wszystkie przyciski są zmapowane lub ich mapowanie nie jest najlepsze – proszę o ewentualne uwagi.

Na przykład menu kontekstowe jest jako DVD Menu (czyli zielony  shift+play)

Written by Admin

13 listopada 2011 at 17:58

Napisane w Uncategorized

Pilot Elmak Maxter Plus pod linuxem

5 komentarzy

Pilot Maxter Plus jako urządzenie HID jest obsługiwany przez Linuksa bez specjalnych driverów. Jednakże nie wszystkie klawisze pilota działają zgodnie z naszymi życzeniami. (Dla niecierpliwych lekarstwo na końcu wpisu)

Zdarzenia generowane przez przyciski pilota

Na początek test – jakie zdarzenia powstają w wyniku naciśnięcia poszczególnych klawiszy pilota. Do tego celu używam programu evtest, który wymaga podania nazwy urządzenia. Aby ją znaleźć wykonuję:

dg@htpc:~$ uname -a
Linux htpc 2.6.32-34-generic #77-Ubuntu SMP Tue Sep 13 19:40:53 UTC 2011 i686 GNU/Linux

dg@htpc:~$ ls -l /dev/input/by-id/
razem 0
lrwxrwxrwx 1 root root 9 2011-11-10 23:49 usb-ELMAK.pl_irMAKbd_pl-event-mouse -> ../event5
lrwxrwxrwx 1 root root 9 2011-11-10 23:49 usb-ELMAK.pl_irMAKbd_pl-mouse -> ../mouse2

I potem mogę zrobić:

dg@htpc:~$ sudo evtest /dev/input/event5
Input driver version is 1.0.0
Input device ID: bus 0x3 vendor 0x18b1 product 0x37 version 0x100
Input device name: „ELMAK.pl irMAKbd pl”
Supported events:
Event type 0 (Sync)
Event type 1 (Key)
Event code 1 (Esc)
Event code 2 (1)
Event code 3 (2)
Event code 4 (3)
Event code 5 (4)
Event code 6 (5)
Event code 7 (6)
Event code 8 (7)
Event code 9 (8)
Event code 10 (9)
Event code 11 (0)
Event code 12 (Minus)
Event code 13 (Equal)
Event code 14 (Backspace)
Event code 15 (Tab)
Event code 16 (Q)
Event code 17 (W)
Event code 18 (E)
Event code 19 (R)
Event code 20 (T)
Event code 21 (Y)
Event code 22 (U)
Event code 23 (I)
Event code 24 (O)
Event code 25 (P)
Event code 26 (LeftBrace)
Event code 27 (RightBrace)
Event code 28 (Enter)
Event code 29 (LeftControl)
Event code 30 (A)
Event code 31 (S)
Event code 32 (D)
Event code 33 (F)
Event code 34 (G)
Event code 35 (H)
Event code 36 (J)
Event code 37 (K)
Event code 38 (L)
Event code 39 (Semicolon)
Event code 40 (Apostrophe)
Event code 41 (Grave)
Event code 42 (LeftShift)
Event code 43 (BackSlash)
Event code 44 (Z)
Event code 45 (X)
Event code 46 (C)
Event code 47 (V)
Event code 48 (B)
Event code 49 (N)
Event code 50 (M)
Event code 51 (Comma)
Event code 52 (Dot)
Event code 53 (Slash)
Event code 54 (RightShift)
Event code 55 (KPAsterisk)
Event code 56 (LeftAlt)
Event code 57 (Space)
Event code 58 (CapsLock)
Event code 59 (F1)
Event code 60 (F2)
Event code 61 (F3)
Event code 62 (F4)
Event code 63 (F5)
Event code 64 (F6)
Event code 65 (F7)
Event code 66 (F8)
Event code 67 (F9)
Event code 68 (F10)
Event code 69 (NumLock)
Event code 70 (ScrollLock)
Event code 71 (KP7)
Event code 72 (KP8)
Event code 73 (KP9)
Event code 74 (KPMinus)
Event code 75 (KP4)
Event code 76 (KP5)
Event code 77 (KP6)
Event code 78 (KPPlus)
Event code 79 (KP1)
Event code 80 (KP2)
Event code 81 (KP3)
Event code 82 (KP0)
Event code 83 (KPDot)
Event code 85 (Zenkaku/Hankaku)
Event code 86 (102nd)
Event code 87 (F11)
Event code 88 (F12)
Event code 89 (RO)
Event code 90 (Katakana)
Event code 91 (HIRAGANA)
Event code 92 (Henkan)
Event code 93 (Katakana/Hiragana)
Event code 94 (Muhenkan)
Event code 95 (KPJpComma)
Event code 96 (KPEnter)
Event code 97 (RightCtrl)
Event code 98 (KPSlash)
Event code 99 (SysRq)
Event code 100 (RightAlt)
Event code 102 (Home)
Event code 103 (Up)
Event code 104 (PageUp)
Event code 105 (Left)
Event code 106 (Right)
Event code 107 (End)
Event code 108 (Down)
Event code 109 (PageDown)
Event code 110 (Insert)
Event code 111 (Delete)
Event code 113 (Mute)
Event code 114 (VolumeDown)
Event code 115 (VolumeUp)
Event code 116 (Power)
Event code 117 (KPEqual)
Event code 119 (Pause)
Event code 121 (KPComma)
Event code 122 (Hanguel)
Event code 123 (Hanja)
Event code 124 (Yen)
Event code 125 (LeftMeta)
Event code 126 (RightMeta)
Event code 127 (Compose)
Event code 128 (Stop)
Event code 129 (Again)
Event code 130 (Props)
Event code 131 (Undo)
Event code 132 (Front)
Event code 133 (Copy)
Event code 134 (Open)
Event code 135 (Paste)
Event code 136 (Find)
Event code 137 (Cut)
Event code 138 (Help)
Event code 139 (Menu)
Event code 140 (Calc)
Event code 142 (Sleep)
Event code 143 (WakeUp)
Event code 150 (WWW)
Event code 152 (Coffee)
Event code 158 (Back)
Event code 159 (Forward)
Event code 161 (EjectCD)
Event code 163 (NextSong)
Event code 164 (PlayPause)
Event code 165 (PreviousSong)
Event code 166 (StopCD)
Event code 167 (Record)
Event code 168 (Rewind)
Event code 169 (Phone)
Event code 173 (Refresh)
Event code 174 (Exit)
Event code 176 (Edit)
Event code 177 (ScrollUp)
Event code 178 (ScrollDown)
Event code 179 (KPLeftParenthesis)
Event code 180 (KPRightParenthesis)
Event code 183 (F13)
Event code 184 (F14)
Event code 185 (F15)
Event code 186 (F16)
Event code 187 (F17)
Event code 188 (F18)
Event code 189 (F19)
Event code 190 (F20)
Event code 191 (F21)
Event code 192 (F22)
Event code 193 (F23)
Event code 194 (F24)
Event code 207 (Play)
Event code 208 (Fast Forward)
Event code 209 (Bass Boost)
Event code 240 (Unknown)
Event code 256 (Btn0)
Event code 272 (LeftBtn)
Event code 273 (RightBtn)
Event code 274 (MiddleBtn)
Event code 362 (Program)
Event code 366 (PVR)
Event code 376 (PC)
Event code 377 (TV)
Event code 378 (TV2)
Event code 379 (VCR)
Event code 380 (VCR2)
Event code 381 (Sat)
Event code 383 (CD)
Event code 384 (Tape)
Event code 385 (Radio)
Event code 386 (Tuner)
Event code 388 (Text)
Event code 389 (DVD)
Event code 396 (Memo)
Event code 398 (Red)
Event code 399 (Green)
Event code 400 (Yellow)
Event code 401 (Blue)
Event code 402 (ChannelUp)
Event code 403 (ChannelDown)
Event code 405 (Last)
Event code 407 (Next)
Event code 416 (?)
Event code 417 (?)
Event code 418 (?)
Event code 419 (?)
Event code 439 (?)
Event type 2 (Relative)
Event code 0 (X)
Event code 1 (Y)
Event code 8 (Wheel)
Event type 3 (Absolute)
Event code 32 (Volume)
Value      0
Min        0
Max      250
Event code 40 (Misc)
Value      1
Min        0
Max      255
Event code 41 (?)
Value     22
Min        0
Max      255
Event code 42 (?)
Value      0
Min        0
Max      255
Event code 43 (?)
Value      0
Min        0
Max      255
Event type 4 (Misc)
Event code 4 (ScanCode)
Event type 17 (LED)
Event code 0 (NumLock)
Event code 1 (CapsLock)
Event code 2 (ScrollLock)
Event code 3 (Compose)
Event code 4 (Kana)
Event type 20 (Repeat)
Testing … (interrupt to exit)

Teraz program czeka na zdarzenia. Poniżej wyniki – naciskałem po kolei klawisze od góry – komentarze (#) określają jaki klawisz został naciśnięty:

#RECTV
Event: time 1321196723.117724, type 3 (Absolute), code 41 (?), value 168
Event: time 1321196723.117768, ————– Report Sync ————
#GUIDE
Event: time 1321196723.797860, type 4 (Misc), code 4 (ScanCode), value c008d
Event: time 1321196723.797894, type 1 (Key), code 362 (Program), value 1
Event: time 1321196723.797902, ————– Report Sync ————
Event: time 1321196723.805857, type 3 (Absolute), code 41 (?), value 38
Event: time 1321196723.805891, ————– Report Sync ————
Event: time 1321196724.021914, type 4 (Misc), code 4 (ScanCode), value c008d
Event: time 1321196724.021955, type 1 (Key), code 362 (Program), value 0
Event: time 1321196724.021968, ————– Report Sync ————
#LIVETV
Event: time 1321196724.421947, type 3 (Absolute), code 41 (?), value 165
Event: time 1321196724.421989, ————– Report Sync ————

#1
Event: time 1321196766.117179, type 4 (Misc), code 4 (ScanCode), value 70059
Event: time 1321196766.117218, type 1 (Key), code 79 (KP1), value 1
Event: time 1321196766.117227, ————– Report Sync ————
Event: time 1321196766.125143, type 3 (Absolute), code 41 (?), value 1
Event: time 1321196766.125177, ————– Report Sync ————
Event: time 1321196766.349223, type 4 (Misc), code 4 (ScanCode), value 70059
Event: time 1321196766.349256, type 1 (Key), code 79 (KP1), value 0
#2
Event: time 1321196766.349263, ————– Report Sync ————
Event: time 1321196766.781323, type 4 (Misc), code 4 (ScanCode), value 7005a
Event: time 1321196766.781379, type 1 (Key), code 80 (KP2), value 1
Event: time 1321196766.781388, ————– Report Sync ————
Event: time 1321196766.789275, type 3 (Absolute), code 41 (?), value 130
Event: time 1321196766.789319, ————– Report Sync ————
Event: time 1321196767.005329, type 4 (Misc), code 4 (ScanCode), value 7005a
Event: time 1321196767.005365, type 1 (Key), code 80 (KP2), value 0
#3
Event: time 1321196767.005375, ————– Report Sync ————
Event: time 1321196767.293387, type 4 (Misc), code 4 (ScanCode), value 7005b
Event: time 1321196767.293429, type 1 (Key), code 81 (KP3), value 1
Event: time 1321196767.293440, ————– Report Sync ————
Event: time 1321196767.301348, type 3 (Absolute), code 41 (?), value 3
Event: time 1321196767.301398, ————– Report Sync ————
Event: time 1321196767.525450, type 4 (Misc), code 4 (ScanCode), value 7005b
Event: time 1321196767.525494, type 1 (Key), code 81 (KP3), value 0
Event: time 1321196767.525500, ————– Report Sync ————

#4
Event: time 1321196773.998542, type 4 (Misc), code 4 (ScanCode), value 7005c
Event: time 1321196773.998582, type 1 (Key), code 75 (KP4), value 1
Event: time 1321196773.998592, ————– Report Sync ————
Event: time 1321196774.006539, type 3 (Absolute), code 41 (?), value 132
Event: time 1321196774.006584, ————– Report Sync ————
Event: time 1321196774.230579, type 4 (Misc), code 4 (ScanCode), value 7005c
Event: time 1321196774.230619, type 1 (Key), code 75 (KP4), value 0
Event: time 1321196774.230628, ————– Report Sync ————
#5
Event: time 1321196774.662660, type 4 (Misc), code 4 (ScanCode), value 7005d
Event: time 1321196774.662709, type 1 (Key), code 76 (KP5), value 1
Event: time 1321196774.662722, ————– Report Sync ————
Event: time 1321196774.670633, type 3 (Absolute), code 41 (?), value 5
Event: time 1321196774.670680, ————– Report Sync ————
Event: time 1321196774.894694, type 4 (Misc), code 4 (ScanCode), value 7005d
Event: time 1321196774.894735, type 1 (Key), code 76 (KP5), value 0
Event: time 1321196774.894743, ————– Report Sync ————
#6
Event: time 1321196775.246790, type 4 (Misc), code 4 (ScanCode), value 7005e
Event: time 1321196775.246833, type 1 (Key), code 77 (KP6), value 1
Event: time 1321196775.246845, ————– Report Sync ————
Event: time 1321196775.254739, type 3 (Absolute), code 41 (?), value 134
Event: time 1321196775.254787, ————– Report Sync ————
Event: time 1321196775.478796, type 4 (Misc), code 4 (ScanCode), value 7005e
Event: time 1321196775.478839, type 1 (Key), code 77 (KP6), value 0
Event: time 1321196775.478848, ————– Report Sync ————

#7
Event: time 1321196778.159266, type 4 (Misc), code 4 (ScanCode), value 7005f
Event: time 1321196778.159311, type 1 (Key), code 71 (KP7), value 1
Event: time 1321196778.159322, ————– Report Sync ————
Event: time 1321196778.167253, type 3 (Absolute), code 41 (?), value 7
Event: time 1321196778.167302, ————– Report Sync ————
Event: time 1321196778.383302, type 4 (Misc), code 4 (ScanCode), value 7005f
Event: time 1321196778.383350, type 1 (Key), code 71 (KP7), value 0
Event: time 1321196778.383360, ————– Report Sync ————
#8
Event: time 1321196778.823377, type 4 (Misc), code 4 (ScanCode), value 70060
Event: time 1321196778.823420, type 1 (Key), code 72 (KP8), value 1
Event: time 1321196778.823443, ————– Report Sync ————
Event: time 1321196778.831358, type 3 (Absolute), code 41 (?), value 136
Event: time 1321196778.831406, ————– Report Sync ————
Event: time 1321196779.055420, type 4 (Misc), code 4 (ScanCode), value 70060
Event: time 1321196779.055465, type 1 (Key), code 72 (KP8), value 0
Event: time 1321196779.055474, ————– Report Sync ————
#9
Event: time 1321196779.439487, type 4 (Misc), code 4 (ScanCode), value 70061
Event: time 1321196779.439533, type 1 (Key), code 73 (KP9), value 1
Event: time 1321196779.439545, ————– Report Sync ————
Event: time 1321196779.447466, type 3 (Absolute), code 41 (?), value 9
Event: time 1321196779.447515, ————– Report Sync ————
Event: time 1321196779.663520, type 4 (Misc), code 4 (ScanCode), value 70061
Event: time 1321196779.663567, type 1 (Key), code 73 (KP9), value 0
Event: time 1321196779.663580, ————– Report Sync ————

#BACK
Event: time 1321196782.023906, type 4 (Misc), code 4 (ScanCode), value c00fa
Event: time 1321196782.023956, type 1 (Key), code 158 (Back), value 1
Event: time 1321196782.023967, ————– Report Sync ————
Event: time 1321196782.031903, type 3 (Absolute), code 41 (?), value 163
Event: time 1321196782.031942, ————– Report Sync ————
Event: time 1321196782.255933, type 4 (Misc), code 4 (ScanCode), value c00fa
Event: time 1321196782.255975, type 1 (Key), code 158 (Back), value 0
Event: time 1321196782.255989, ————– Report Sync ————
#0
Event: time 1321196782.720043, type 4 (Misc), code 4 (ScanCode), value 70062
Event: time 1321196782.720088, type 1 (Key), code 82 (KP0), value 1
Event: time 1321196782.720100, ————– Report Sync ————
Event: time 1321196782.728024, type 3 (Absolute), code 41 (?), value 63
Event: time 1321196782.728070, ————– Report Sync ————
Event: time 1321196782.952093, type 4 (Misc), code 4 (ScanCode), value 70062
Event: time 1321196782.952137, type 1 (Key), code 82 (KP0), value 0
Event: time 1321196782.952146, ————– Report Sync ————
#More
Event: time 1321196783.288115, type 4 (Misc), code 4 (ScanCode), value c00f6
Event: time 1321196783.288153, type 1 (Key), code 407 (Next), value 1
Event: time 1321196783.288168, ————– Report Sync ————
Event: time 1321196783.296143, type 3 (Absolute), code 41 (?), value 143
Event: time 1321196783.296199, ————– Report Sync ————
Event: time 1321196783.512151, type 4 (Misc), code 4 (ScanCode), value c00f6
Event: time 1321196783.512192, type 1 (Key), code 407 (Next), value 0
Event: time 1321196783.512210, ————– Report Sync ————

#Up
Event: time 1321196788.353029, type 4 (Misc), code 4 (ScanCode), value 70052
Event: time 1321196788.353081, type 1 (Key), code 103 (Up), value 1
Event: time 1321196788.353095, ————– Report Sync ————
Event: time 1321196788.361005, type 3 (Absolute), code 41 (?), value 30
Event: time 1321196788.361044, ————– Report Sync ————
Event: time 1321196788.585072, type 4 (Misc), code 4 (ScanCode), value 70052
Event: time 1321196788.585126, type 1 (Key), code 103 (Up), value 0
Event: time 1321196788.585136, ————– Report Sync ————
#Left
Event: time 1321196789.129158, type 4 (Misc), code 4 (ScanCode), value 70050
Event: time 1321196789.129209, type 1 (Key), code 105 (Left), value 1
Event: time 1321196789.129224, ————– Report Sync ————
Event: time 1321196789.137138, type 3 (Absolute), code 41 (?), value 160
Event: time 1321196789.137182, ————– Report Sync ————
Event: time 1321196789.353193, type 4 (Misc), code 4 (ScanCode), value 70050
Event: time 1321196789.353245, type 1 (Key), code 105 (Left), value 0
Event: time 1321196789.353256, ————– Report Sync ————
#Right
Event: time 1321196789.801283, type 4 (Misc), code 4 (ScanCode), value 7004f
Event: time 1321196789.801331, type 1 (Key), code 106 (Right), value 1
Event: time 1321196789.801343, ————– Report Sync ————
Event: time 1321196789.809260, type 3 (Absolute), code 41 (?), value 33
Event: time 1321196789.809316, ————– Report Sync ————
Event: time 1321196790.033310, type 4 (Misc), code 4 (ScanCode), value 7004f
Event: time 1321196790.033361, type 1 (Key), code 106 (Right), value 0
Event: time 1321196790.033373, ————– Report Sync ————
#Down
Event: time 1321196790.449401, type 4 (Misc), code 4 (ScanCode), value 70051
Event: time 1321196790.449458, type 1 (Key), code 108 (Down), value 1
Event: time 1321196790.449471, ————– Report Sync ————
Event: time 1321196790.457368, type 3 (Absolute), code 41 (?), value 159
Event: time 1321196790.457415, ————– Report Sync ————
Event: time 1321196790.673428, type 4 (Misc), code 4 (ScanCode), value 70051
Event: time 1321196790.673480, type 1 (Key), code 108 (Down), value 0
Event: time 1321196790.673493, ————– Report Sync ————
#OK
Event: time 1321196791.185530, type 4 (Misc), code 4 (ScanCode), value 70028
Event: time 1321196791.185590, type 1 (Key), code 28 (Enter), value 1
Event: time 1321196791.185598, ————– Report Sync ————
Event: time 1321196791.193485, type 3 (Absolute), code 41 (?), value 34
Event: time 1321196791.193529, ————– Report Sync ————
Event: time 1321196791.417539, type 4 (Misc), code 4 (ScanCode), value 70028
Event: time 1321196791.417579, type 1 (Key), code 28 (Enter), value 0
Event: time 1321196791.417585, ————– Report Sync ————

#VOL-
Event: time 1321196794.113987, type 4 (Misc), code 4 (ScanCode), value c00ea
Event: time 1321196794.114024, type 1 (Key), code 114 (VolumeDown), value 1
Event: time 1321196794.114035, ————– Report Sync ————
Event: time 1321196794.121986, type 3 (Absolute), code 41 (?), value 145
Event: time 1321196794.122028, ————– Report Sync ————
Event: time 1321196794.346021, type 4 (Misc), code 4 (ScanCode), value c00ea
Event: time 1321196794.346055, type 1 (Key), code 114 (VolumeDown), value 0
Event: time 1321196794.346064, ————– Report Sync ————
#VOL+
Event: time 1321196795.138164, type 4 (Misc), code 4 (ScanCode), value c00e9
Event: time 1321196795.138203, type 1 (Key), code 115 (VolumeUp), value 1
Event: time 1321196795.138210, ————– Report Sync ————
Event: time 1321196795.146169, type 3 (Absolute), code 41 (?), value 16
Event: time 1321196795.146215, ————– Report Sync ————
Event: time 1321196795.370196, type 4 (Misc), code 4 (ScanCode), value c00e9
Event: time 1321196795.370235, type 1 (Key), code 115 (VolumeUp), value 0
Event: time 1321196795.370248, ————– Report Sync ————
#CH-
Event: time 1321196796.138358, type 4 (Misc), code 4 (ScanCode), value 7004e
Event: time 1321196796.138403, type 1 (Key), code 109 (PageDown), value 1
Event: time 1321196796.138410, ————– Report Sync ————
Event: time 1321196796.146352, type 3 (Absolute), code 41 (?), value 147
Event: time 1321196796.146405, ————– Report Sync ————
Event: time 1321196796.362399, type 4 (Misc), code 4 (ScanCode), value 7004e
Event: time 1321196796.362443, type 1 (Key), code 109 (PageDown), value 0
Event: time 1321196796.362449, ————– Report Sync ————
#CH+
Event: time 1321196796.754484, type 4 (Misc), code 4 (ScanCode), value 7004b
Event: time 1321196796.754523, type 1 (Key), code 104 (PageUp), value 1
Event: time 1321196796.754530, ————– Report Sync ————
Event: time 1321196796.762444, type 3 (Absolute), code 41 (?), value 18
Event: time 1321196796.762478, ————– Report Sync ————
Event: time 1321196796.978508, type 4 (Misc), code 4 (ScanCode), value 7004b
Event: time 1321196796.978539, type 1 (Key), code 104 (PageUp), value 0
Event: time 1321196796.978545, ————– Report Sync ————

#Red/Record
Event: time 1321196799.650938, type 4 (Misc), code 4 (ScanCode), value c00b2
Event: time 1321196799.650980, type 1 (Key), code 167 (Record), value 1
Event: time 1321196799.650989, ————– Report Sync ————
Event: time 1321196799.658937, type 3 (Absolute), code 41 (?), value 151
Event: time 1321196799.658982, ————– Report Sync ————
Event: time 1321196799.882975, type 4 (Misc), code 4 (ScanCode), value c00b2
Event: time 1321196799.883018, type 1 (Key), code 167 (Record), value 0
Event: time 1321196799.883033, ————– Report Sync ————
#Green/MCE
Event: time 1321196800.291033, type 3 (Absolute), code 41 (?), value 13
Event: time 1321196800.291083, ————– Report Sync ————
#Yellow/Stop
Event: time 1321196800.891157, type 4 (Misc), code 4 (ScanCode), value c00b7
Event: time 1321196800.891205, type 1 (Key), code 166 (StopCD), value 1
Event: time 1321196800.891215, ————– Report Sync ————
Event: time 1321196800.899155, type 3 (Absolute), code 41 (?), value 153
Event: time 1321196800.899201, ————– Report Sync ————
Event: time 1321196801.115184, type 4 (Misc), code 4 (ScanCode), value c00b7
Event: time 1321196801.115227, type 1 (Key), code 166 (StopCD), value 0
Event: time 1321196801.115236, ————– Report Sync ————
#Blue/Menu
Event: time 1321196801.475259, type 4 (Misc), code 4 (ScanCode), value 700e2
Event: time 1321196801.475297, type 1 (Key), code 56 (LeftAlt), value 1
Event: time 1321196801.475306, type 4 (Misc), code 4 (ScanCode), value 700e3
Event: time 1321196801.475313, type 1 (Key), code 125 (LeftMeta), value 1
Event: time 1321196801.475335, type 4 (Misc), code 4 (ScanCode), value 70028
Event: time 1321196801.475339, type 1 (Key), code 28 (Enter), value 1
Event: time 1321196801.475344, ————– Report Sync ————
Event: time 1321196801.483255, type 3 (Absolute), code 41 (?), value 11
Event: time 1321196801.483304, ————– Report Sync ————
Event: time 1321196801.707297, type 4 (Misc), code 4 (ScanCode), value 700e2
Event: time 1321196801.707328, type 1 (Key), code 56 (LeftAlt), value 0
Event: time 1321196801.707336, type 4 (Misc), code 4 (ScanCode), value 700e3
Event: time 1321196801.707342, type 1 (Key), code 125 (LeftMeta), value 0
Event: time 1321196801.707363, type 4 (Misc), code 4 (ScanCode), value 70028
Event: time 1321196801.707368, type 1 (Key), code 28 (Enter), value 0
Event: time 1321196801.707372, ————– Report Sync ————

#Rewind
Event: time 1321196804.451767, type 4 (Misc), code 4 (ScanCode), value c00b4
Event: time 1321196804.451804, type 1 (Key), code 168 (Rewind), value 1
Event: time 1321196804.451811, ————– Report Sync ————
Event: time 1321196804.459771, type 3 (Absolute), code 41 (?), value 149
Event: time 1321196804.459821, ————– Report Sync ————
Event: time 1321196804.683800, type 4 (Misc), code 4 (ScanCode), value c00b4
Event: time 1321196804.683827, type 1 (Key), code 168 (Rewind), value 0
Event: time 1321196804.683835, ————– Report Sync ————
#Pause
Event: time 1321196805.067873, type 4 (Misc), code 4 (ScanCode), value c00b1
Event: time 1321196805.067901, type 1 (Key), code 119 (Pause), value 1
Event: time 1321196805.067906, ————– Report Sync ————
Event: time 1321196805.075881, type 3 (Absolute), code 41 (?), value 24
Event: time 1321196805.075923, ————– Report Sync ————
Event: time 1321196805.299908, type 4 (Misc), code 4 (ScanCode), value c00b1
Event: time 1321196805.299936, type 1 (Key), code 119 (Pause), value 0
Event: time 1321196805.299945, ————– Report Sync ————
#Fast Forward
Event: time 1321196805.683975, type 4 (Misc), code 4 (ScanCode), value c00b3
Event: time 1321196805.684008, type 1 (Key), code 208 (Fast Forward), value 1
Event: time 1321196805.684016, ————– Report Sync ————
Event: time 1321196805.691980, type 3 (Absolute), code 41 (?), value 148
Event: time 1321196805.692018, ————– Report Sync ————
Event: time 1321196805.908018, type 4 (Misc), code 4 (ScanCode), value c00b3
Event: time 1321196805.908053, type 1 (Key), code 208 (Fast Forward), value 0
Event: time 1321196805.908066, ————– Report Sync ————
#Esc
Event: time 1321196806.252104, type 4 (Misc), code 4 (ScanCode), value 70029
Event: time 1321196806.252144, type 1 (Key), code 1 (Esc), value 1
Event: time 1321196806.252151, ————– Report Sync ————
Event: time 1321196806.260098, type 3 (Absolute), code 41 (?), value 10
Event: time 1321196806.260150, ————– Report Sync ————
Event: time 1321196806.484179, type 4 (Misc), code 4 (ScanCode), value 70029
Event: time 1321196806.484237, type 1 (Key), code 1 (Esc), value 0
Event: time 1321196806.484248, ————– Report Sync ————

#Previous
Event: time 1321196808.732554, type 4 (Misc), code 4 (ScanCode), value c00b6
Event: time 1321196808.732612, type 1 (Key), code 165 (PreviousSong), value 1
Event: time 1321196808.732621, ————– Report Sync ————
Event: time 1321196808.740534, type 3 (Absolute), code 41 (?), value 155
Event: time 1321196808.740601, ————– Report Sync ————
Event: time 1321196808.956584, type 4 (Misc), code 4 (ScanCode), value c00b6
Event: time 1321196808.956660, type 1 (Key), code 165 (PreviousSong), value 0
Event: time 1321196808.956675, ————– Report Sync ————
#Play
Event: time 1321196809.284612, type 4 (Misc), code 4 (ScanCode), value c00cd
Event: time 1321196809.284670, type 1 (Key), code 164 (PlayPause), value 1
Event: time 1321196809.284680, ————– Report Sync ————
Event: time 1321196809.292619, type 3 (Absolute), code 41 (?), value 22
Event: time 1321196809.292671, ————– Report Sync ————
Event: time 1321196809.516650, type 4 (Misc), code 4 (ScanCode), value c00cd
Event: time 1321196809.516700, type 1 (Key), code 164 (PlayPause), value 0
Event: time 1321196809.516713, ————– Report Sync ————
#Next
Event: time 1321196809.860713, type 4 (Misc), code 4 (ScanCode), value c00b5
Event: time 1321196809.860757, type 1 (Key), code 163 (NextSong), value 1
Event: time 1321196809.860764, ————– Report Sync ————
Event: time 1321196809.868722, type 3 (Absolute), code 41 (?), value 154
Event: time 1321196809.868780, ————– Report Sync ————
Event: time 1321196809.980714, type 4 (Misc), code 4 (ScanCode), value c00b5
Event: time 1321196809.980755, type 1 (Key), code 163 (NextSong), value 0
Event: time 1321196809.980771, ————– Report Sync ————
#Mute
Event: time 1321196810.404815, type 4 (Misc), code 4 (ScanCode), value c00e2
Event: time 1321196810.404863, type 1 (Key), code 113 (Mute), value 1
Event: time 1321196810.404871, ————– Report Sync ————
Event: time 1321196810.412809, type 3 (Absolute), code 41 (?), value 14
Event: time 1321196810.412859, ————– Report Sync ————
Event: time 1321196810.636850, type 4 (Misc), code 4 (ScanCode), value c00e2
Event: time 1321196810.636900, type 1 (Key), code 113 (Mute), value 0
Event: time 1321196810.636916, ————– Report Sync ————

### Klawisze z Shiftem czyli zielonym przyciskiem

# *
Event: time 1321196818.118158, type 4 (Misc), code 4 (ScanCode), value 70055
Event: time 1321196818.118207, type 1 (Key), code 55 (KPAsterisk), value 1
Event: time 1321196818.118218, ————– Report Sync ————
Event: time 1321196818.134149, type 3 (Absolute), code 41 (?), value 221
Event: time 1321196818.134213, ————– Report Sync ————
Event: time 1321196818.368066, type 1 (Key), code 55 (KPAsterisk), value 2
Event: time 1321196818.368098, ————– Report Sync ————
Event: time 1321196818.404050, type 1 (Key), code 55 (KPAsterisk), value 2
Event: time 1321196818.404078, ————– Report Sync ————
Event: time 1321196818.440042, type 1 (Key), code 55 (KPAsterisk), value 2
Event: time 1321196818.440075, ————– Report Sync ————
Event: time 1321196818.476047, type 1 (Key), code 55 (KPAsterisk), value 2
Event: time 1321196818.476092, ————– Report Sync ————
Event: time 1321196818.494222, type 4 (Misc), code 4 (ScanCode), value 70055
Event: time 1321196818.494271, type 1 (Key), code 55 (KPAsterisk), value 0
Event: time 1321196818.494279, ————– Report Sync ————
#Clear
Event: time 1321196818.942320, type 4 (Misc), code 4 (ScanCode), value 7002a
Event: time 1321196818.942382, type 1 (Key), code 14 (Backspace), value 1
Event: time 1321196818.942394, ————– Report Sync ————
Event: time 1321196818.950278, type 3 (Absolute), code 41 (?), value 74
Event: time 1321196818.950333, ————– Report Sync ————
Event: time 1321196819.196076, type 1 (Key), code 14 (Backspace), value 2
Event: time 1321196819.196117, ————– Report Sync ————
Event: time 1321196819.236070, type 1 (Key), code 14 (Backspace), value 2
Event: time 1321196819.236111, ————– Report Sync ————
Event: time 1321196819.254374, type 4 (Misc), code 4 (ScanCode), value 7002a
Event: time 1321196819.254428, type 1 (Key), code 14 (Backspace), value 0
Event: time 1321196819.254439, ————– Report Sync ————
# # (hash)
Event: time 1321196819.606393, type 4 (Misc), code 4 (ScanCode), value 700e1
Event: time 1321196819.606438, type 1 (Key), code 42 (LeftShift), value 1
Event: time 1321196819.606477, type 4 (Misc), code 4 (ScanCode), value 70020
Event: time 1321196819.606482, type 1 (Key), code 4 (3), value 1
Event: time 1321196819.606487, ————– Report Sync ————
Event: time 1321196819.622394, type 3 (Absolute), code 41 (?), value 220
Event: time 1321196819.622445, ————– Report Sync ————
Event: time 1321196819.860041, type 1 (Key), code 4 (3), value 2
Event: time 1321196819.860070, ————– Report Sync ————
Event: time 1321196819.896060, type 1 (Key), code 4 (3), value 2
Event: time 1321196819.896090, ————– Report Sync ————
Event: time 1321196819.918447, type 4 (Misc), code 4 (ScanCode), value 700e1
Event: time 1321196819.918494, type 1 (Key), code 42 (LeftShift), value 0
Event: time 1321196819.918536, type 4 (Misc), code 4 (ScanCode), value 70020
Event: time 1321196819.918543, type 1 (Key), code 4 (3), value 0
Event: time 1321196819.918560, ————– Report Sync ————

#Help
Event: time 1321196832.200599, type 4 (Misc), code 4 (ScanCode), value 7003a
Event: time 1321196832.200654, type 1 (Key), code 59 (F1), value 1
Event: time 1321196832.200667, ————– Report Sync ————
Event: time 1321196832.216598, type 3 (Absolute), code 41 (?), value 100
Event: time 1321196832.216662, ————– Report Sync ————
Event: time 1321196832.452033, type 1 (Key), code 59 (F1), value 2
Event: time 1321196832.452061, ————– Report Sync ————
Event: time 1321196832.488064, type 1 (Key), code 59 (F1), value 2
Event: time 1321196832.488095, ————– Report Sync ————
Event: time 1321196832.488629, type 4 (Misc), code 4 (ScanCode), value 7003a
Event: time 1321196832.488662, type 1 (Key), code 59 (F1), value 0
Event: time 1321196832.488671, ————– Report Sync ————
#DVD Menu
Event: time 1321196832.880695, type 3 (Absolute), code 41 (?), value 164
Event: time 1321196832.880748, ————– Report Sync ————
#Resize
Event: time 1321196833.416786, type 4 (Misc), code 4 (ScanCode), value 700e2
Event: time 1321196833.416847, type 1 (Key), code 56 (LeftAlt), value 1
Event: time 1321196833.416891, type 4 (Misc), code 4 (ScanCode), value 70028
Event: time 1321196833.416898, type 1 (Key), code 28 (Enter), value 1
Event: time 1321196833.416904, ————– Report Sync ————
Event: time 1321196833.424780, type 3 (Absolute), code 41 (?), value 99
Event: time 1321196833.424831, ————– Report Sync ————
Event: time 1321196833.672069, type 1 (Key), code 28 (Enter), value 2
Event: time 1321196833.672103, ————– Report Sync ————
Event: time 1321196833.688805, type 4 (Misc), code 4 (ScanCode), value 700e2
Event: time 1321196833.688850, type 1 (Key), code 56 (LeftAlt), value 0
Event: time 1321196833.688886, type 4 (Misc), code 4 (ScanCode), value 70028
Event: time 1321196833.688901, type 1 (Key), code 28 (Enter), value 0
Event: time 1321196833.688909, ————– Report Sync ————
#Enter
Event: time 1321196833.944887, type 4 (Misc), code 4 (ScanCode), value 70028
Event: time 1321196833.944943, type 1 (Key), code 28 (Enter), value 1
Event: time 1321196833.944955, ————– Report Sync ————
Event: time 1321196833.952873, type 3 (Absolute), code 41 (?), value 234
Event: time 1321196833.952943, ————– Report Sync ————
Event: time 1321196834.196054, type 1 (Key), code 28 (Enter), value 2
Event: time 1321196834.196090, ————– Report Sync ————
Event: time 1321196834.232088, type 1 (Key), code 28 (Enter), value 2
Event: time 1321196834.232125, ————– Report Sync ————
Event: time 1321196834.240961, type 4 (Misc), code 4 (ScanCode), value 70028
Event: time 1321196834.241017, type 1 (Key), code 28 (Enter), value 0
Event: time 1321196834.241025, ————– Report Sync ————
^C

Typy przycisków

Jak widać przyciski można podzielić na dwie grupy.

Pierwsza grupa, to takie przyciski, które generują normalne kody naciśnięcia klawisza:

Event: time 1321196766.117179, type 4 (Misc), code 4 (ScanCode), value 70059
Event: time 1321196766.117218, type 1 (Key), code 79 (KP1), value 1
Event: time 1321196766.117227, ————– Report Sync ————
Event: time 1321196766.125143, type 3 (Absolute), code 41 (?), value 1
Event: time 1321196766.125177, ————– Report Sync ————
Event: time 1321196766.349223, type 4 (Misc), code 4 (ScanCode), value 70059
Event: time 1321196766.349256, type 1 (Key), code 79 (KP1), value 0

Jest sekwencja:

type 1 (Key), code .. (…), value 1 # naciśnięcie klawisza

type 1 (Key), code .. (…), value 0 # puszczenie klawisza

Te przyciski działają od razu – tak jak każda inna klawiatura. Niestety, niektóre z przycisków (zwłaszcza te multimedialne) generują kody klawiszy większe od 255, co jest i długo jeszcze będzie problemem pod X11 – patrz: http://www.mythtv.org/wiki/Remapping_remote_control_key_codes_greater_than_255 oraz http://www.thenautilus.net/SW/xf86-input-evdev/en

Druga grupa przycisków nie generuje zdarzeń naciśnięcia i puszczenia klawisza – tylko zdarzenia absolute z kodem 41 i różnymi wartościami np:

type 3 (Absolute), code 41 (?), value 168

Z tego co rozumiem to jakaś emulacja joysticka(?).

Aby poradzić sobie z obydwoma problemami w prymitywny sposób zmieniłem kod xserver-xorg-input-evdev, a konkretnie plik evdev.c

Modyfikacja drivera evdev

1. Należy pobrać źródła xserver-xorg-input-evdev np. ze strony https://launchpad.net/ubuntu/lucid/+source/xserver-xorg-input-evdev/1:2.3.2-5ubuntu1 i zmodyfikować plik evdev.c – dla wersji 2.3.2 można pobrać zmodyfikowany driver:

$ git clone git://github.com/dgolda/maxter-plus-linux.git

$ cd maxter-plus-linux

$ cd xserver-xorg-input-evdev-2.3.2

3. skompilować

$ ./configure
$ make

4. wyłączyć X11 np. sudo service gdm stop lub kill

5. zainstalować:

$ sudo make install

Driver powinien się skopiować do: /usr/local/lib/xorg/modules/input/evdev_drv.so

Następnie należy ustawić X by używamy zmodyfikowanego drivera – w pliku xorg.conf należy dodać ModulePath:

 Section „Files”

ModulePath „/usr/local/lib/xorg/modules,/usr/lib/xorg/extra-modules,/usr/lib/xorg/modules”

EndSection

Teraz należy zrestartować X lub cały komputer i sprawdzić czy zmieniony driver est używany:

grep evdev_drv /var/log/Xorg.0.log

Powinno się pojawić coś takiego:

(II) Loading /usr/local/lib/xorg/modules/input/evdev_drv.so

Co oznacza, że evdev driver jest ładowany z /usr/local/lib, a nie z /usr/lib.

Written by Admin

13 listopada 2011 at 17:47

Napisane w Uncategorized

Hello world!

leave a comment »

Parę informacji o moim HTPC

Written by Admin

10 listopada 2011 at 11:18

Napisane w Uncategorized