最終更新:2017-08-14 (月) 13:54:47 (2419d)
getevent
Top / getevent
provides information about input devices and a live dump of kernel input events.
https://source.android.com/devices/input/getevent.html
ログ表示
getevent -l
help
root@android:/ # getevent -help getevent -help Usage: getevent [-t] [-n] [-s switchmask] [-S] [-v [mask]] [-d] [-p] [-i] [-l] [-q] [-c count] [-r] [device] -t: show time stamps -n: don't print newlines -s: print switch states for given bits -S: print all switch states -v: verbosity mask (errs=1, dev=2, name=4, info=8, vers=16, pos. events=32, props=64) -d: show HID descriptor, if available -p: show possible events (errs, dev, name, pos. events) -i: show all device info and possible events -l: label event types and names in plain text -q: quiet (clear verbosity mask) -c: print given number of events then exit -r: print rate events are received
QUANTA OpticalTouchScreen
root@android:/ # getevent -lp /dev/input/event7 getevent -lp /dev/input/event7 add device 1: /dev/input/event7 name: "QUANTA OpticalTouchScreen" events: KEY (0001): BTN_TOUCH ABS (0003): ABS_X : value 1851, min 0, max 1920, fuzz 0, flat 0, resolution 0 ABS_Y : value 733, min 0, max 1080, fuzz 0, flat 0, resolution 0 ABS_MT_SLOT : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0 ABS_MT_POSITION_X : value 0, min 0, max 1920, fuzz 0, flat 0, resolution 0 ABS_MT_POSITION_Y : value 0, min 0, max 1080, fuzz 0, flat 0, resolution 0 ABS_MT_TRACKING_ID : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0 input props: INPUT_PROP_DIRECT
SC-05D
shell@android:/ $ getevent -l add device 1: /dev/input/event13 name: "compass_sensor" add device 2: /dev/input/event8 name: "fsa9480" add device 3: /dev/input/event12 name: "sec_e-pen" could not get driver version for /dev/input/mouse0, Not a typewriter add device 4: /dev/input/event11 name: "melfas_touchkey" add device 5: /dev/input/event10 name: "orientation_sensor" add device 6: /dev/input/event9 name: "gyro_sensor" add device 7: /dev/input/event7 name: "light_sensor" add device 8: /dev/input/event6 name: "proximity_sensor" add device 9: /dev/input/event5 name: "barometer_sensor" add device 10: /dev/input/event3 name: "sec_touchscreen" could not get driver version for /dev/input/mice, Not a typewriter add device 11: /dev/input/event1 name: "sec_jack" add device 12: /dev/input/event0 name: "sii9234_rcp" add device 13: /dev/input/event4 name: "pmic8xxx_pwrkey" add device 14: /dev/input/event2 name: "ffa-keypad"
出力
-lなし
printf("%04x %04x %08x", type, code, value);
- type
- とか
- code
メモ
$ getevent /dev/input/event7 0004 0004 00070028 0001 001c 00000001 0000 0000 00000000 0004 0004 00070028 0001 001c 00000000 0000 0000 00000000 $ getevent -l /dev/input/event7 EV_MSC MSC_SCAN 00070028 EV_KEY KEY_ENTER DOWN EV_SYN SYN_REPORT 00000000 EV_MSC MSC_SCAN 00070028 EV_KEY KEY_ENTER UP EV_SYN SYN_REPORT 00000000
メモ
/sys/kernel/debug/hid
ソースコード
- AOSP/system/core/toolbox/getevent.h?
- AOSP/system/core/toolbox/getevent.c