Linux Input / evdev イベントを確認する方法

evtest コマンドを使う。

# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:  Power Button
/dev/input/event1:  Sleep Button
/dev/input/event2:  AT Translated Set 2 keyboard
/dev/input/event3:  ImExPS/2 Generic Explorer Mouse
/dev/input/event4:  VirtualBox USB Tablet
/dev/input/event5:  Video Bus
/dev/input/event6:  VirtualBox mouse integration
Select the device event number [0-6]: 6
Input driver version is 1.0.1
Input device ID: bus 0x1 vendor 0x80ee product 0xcafe version 0x501
Input device name: "VirtualBox mouse integration"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 272 (BTN_LEFT)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value  41138
      Min        0
      Max    65535
    Event code 1 (ABS_Y)
      Value  46799
      Min        0
      Max    65535
Properties:
Testing ... (interrupt to exit)
Event: time 1522805653.320397, type 3 (EV_ABS), code 1 (ABS_Y), value 46557
Event: time 1522805653.320397, -------------- SYN_REPORT ------------
Event: time 1522805653.328192, type 3 (EV_ABS), code 1 (ABS_Y), value 46071
Event: time 1522805653.328192, -------------- SYN_REPORT ------------