X Y坐标切换
首先,定义
static int X_max=0;
static int Y_max=0;
之后在mt_touch_input_mapping函数中
case HID_UP_GENDESK:
switch (usage->hid) {HID_GD_Y 与 HID_GD_X 互换
case HID_GD_Y:
X_max = field->logical_maximum;
给 X_max 赋值
case HID_GD_X:
Y_max = field->logical_maximum;
给 Y_max 赋值
其次,修正坐标:
input_event(input, EV_ABS, ABS_MT_POSITION_X, s->x); -> input_event(input, EV_ABS, ABS_MT_POSITION_X, s->y);
input_event(input, EV_ABS, ABS_MT_POSITION_Y, s->y); -> input_event(input, EV_ABS, ABS_MT_POSITION_Y, Y_max-s->x);
最后,编译并将系统更新到设备调试,调试OK
USB触摸屏源文件:
hid-multitouch Modify.zip