xpl_happy_pedals
Toto je starší verze dokumentu!
Happy pedals XPL issue
- X-Plane od 10.10 nepoužívá linuxové rozhraní /dev/input/jsX.
- protože js rozhraní omezuje: podléhá kalibraci, zavádí například null zóny atd…
- Místo toho /dev/input/eventX
- vyžaduje oprávnění na eventX
- stačí chmod o+r
- machři to dělají přes udev rule
- eventX lze identifikovat podle id nebo path, podle id takto:
Pharaon:/dev/input/by-id# ls -la /dev/input/by-id/ celkem 0 drwxr-xr-x 2 root root 240 zář 3 21:04 . drw-rw-r-x 4 root root 320 zář 3 20:49 .. lrwxrwxrwx 1 root root 9 zář 3 20:49 usb-Arduino_LLC_Arduino_Leonardo-event-if02 -> ../event7 lrwxrwxrwx 1 root root 9 zář 3 19:47 usb-Logitech_Gaming_Mouse_G300-event-mouse -> ../event2 lrwxrwxrwx 1 root root 9 zář 3 19:47 usb-Logitech_Gaming_Mouse_G300-if01-event-kbd -> ../event3 lrwxrwxrwx 1 root root 9 zář 3 19:47 usb-Logitech_Gaming_Mouse_G300-mouse -> ../mouse0 lrwxrwxrwx 1 root root 9 zář 3 19:47 usb-Logitech_Logitech_Extreme_3D-event-joystick -> ../event6 lrwxrwxrwx 1 root root 6 zář 3 19:47 usb-Logitech_Logitech_Extreme_3D-joystick -> ../js0 lrwxrwxrwx 1 root root 9 zář 3 19:47 usb-Logitech_USB_Keyboard-event-if01 -> ../event5 lrwxrwxrwx 1 root root 9 zář 3 19:47 usb-Logitech_USB_Keyboard-event-kbd -> ../event4
* eventX lze číst přes evtest nástroj
* příklad logitech:
Pharaon:/dev/input/by-id# evtest /dev/input/event6
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x46d product 0xc215 version 0x110
Input device name: "Logitech Logitech Extreme 3D"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 288 (BTN_TRIGGER)
Event code 289 (BTN_THUMB)
Event code 290 (BTN_THUMB2)
Event code 291 (BTN_TOP)
Event code 292 (BTN_TOP2)
Event code 293 (BTN_PINKIE)
Event code 294 (BTN_BASE)
Event code 295 (BTN_BASE2)
Event code 296 (BTN_BASE3)
Event code 297 (BTN_BASE4)
Event code 298 (BTN_BASE5)
Event code 299 (BTN_BASE6)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 508
Min 0
Max 1023
Fuzz 3
Flat 63
Event code 1 (ABS_Y)
Value 516
Min 0
Max 1023
Fuzz 3
Flat 63
Event code 5 (ABS_RZ)
Value 128
Min 0
Max 255
Flat 15
Event code 6 (ABS_THROTTLE)
Value 213
Min 0
Max 255
Flat 15
Event code 16 (ABS_HAT0X)
Value 0
Min -1
Max 1
Event code 17 (ABS_HAT0Y)
Value 0
Min -1
Max 1
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
- happy pedals
Pharaon:/dev/input/by-id# evtest /dev/input/event7
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x2341 product 0x8036 version 0x101
Input device name: "Arduino LLC Arduino Leonardo"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 288 (BTN_TRIGGER)
Event code 289 (BTN_THUMB)
Event type 3 (EV_ABS)
Event code 2 (ABS_Z)
Value 480
Min 0
Max 1023
Fuzz 3
Flat 63
Event code 3 (ABS_RX)
Value 20
Min 0
Max 1023
Fuzz 3
Flat 63
Event code 4 (ABS_RY)
Value 23
Min 0
Max 1023
Fuzz 3
Flat 63
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
zkoumání xpl
- jak X-Plane zjístí seznam events?
- on ví, že jich je max 32, tak to prostě zkusí
strace /opt/X-Plane\ 10/X-Plane-x86_64 2>&1 | grep -i "/dev/input"
open("/dev/input/event0", O_RDONLY) = 20
open("/dev/input/event1", O_RDONLY) = 20
open("/dev/input/event2", O_RDONLY) = 20
open("/dev/input/event3", O_RDONLY) = 20
open("/dev/input/event4", O_RDONLY) = 20
open("/dev/input/event5", O_RDONLY) = 20
open("/dev/input/event6", O_RDONLY) = 20
open("/dev/input/event7", O_RDONLY) = 28
open("/dev/input/event8", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event9", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event10", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event11", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event12", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event13", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event14", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event15", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event16", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event17", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event18", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event19", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event20", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event21", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event22", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event23", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event24", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event25", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event26", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event27", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event28", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event29", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event30", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/input/event31", O_RDONLY) = -1 ENOENT (No such file or directory)
- podle čeho se rozhodne, že se mu eventX líbí?
xpl_happy_pedals.1441309644.txt.gz · Poslední úprava: (upraveno mimo DokuWiki)
