test@123:/data # getevent --help
getevent: invalid option --
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
/**
* struct input_value - input value representation
* @type: type of value (EV_KEY, EV_ABS, etc)
* @code: the value code
* @value: the value
struct input_value {
__u16 type;
__u16 code;
__s32 value;
此结构体不就是上述设备名字后面的三列数据的定义。 而所谓的事件类型定义如下:
#define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */
#define ABS_MT_POSITION_X 0x35 /* Center X touch position */
#define ABS_MT_POSITION_Y 0x36 /* Center Y touch position */
#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */
#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */
#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */
#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */
code=0x39代表一个唯一的ID。
code=0x35代表触摸器按下的x坐标。
code=0x36代表触摸屏按下的y坐标。
可以按到上述按下的触摸屏坐标是: (0x166,0x1c5)=十进制(358,453)。
执行getevent -p命令可以看到设备尺寸等信息。
代码语言:javascript
复制
add device 4: /dev/input/event1
name: "adaptive_ts"
events:
KEY (0001): 009e 00ac 014a 0244
ABS (0003): 0000 : value 0, min 0, max 0, fuzz 0, flat 0, resolution 0
0001 : value 0, min 0, max 0, fuzz 0, flat 0, resolution 0
002f : value 0, min 0, max 9, fuzz 0, flat 0, resolution 0
0035 : value 0, min 0, max 720, fuzz 0, flat 0, resolution 0
0036 : value 0, min 0, max 1280, fuzz 0, flat 0, resolution 0
0039 : value 0, min 0, max 65535, fuzz 0, flat 0, resolution 0
input props:
INPUT_PROP_DIRECT