rk3288 7.1 usb触摸上下左右反

本文介绍了一种解决屏和触摸板位置颠倒问题的方法,通过修改hid-multitouch驱动,实现触摸位置的180度翻转,确保触摸输入与屏幕显示匹配。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

因为客户模具已经固定好了,屏和触摸颠倒180度,导致触摸方位不准,可以通过修改驱动校正,修改如下:

diff --git a/kernel/drivers/hid/hid-multitouch.c b/kernel/drivers/hid/hid-multitouch.c

--- a/kernel/drivers/hid/hid-multitouch.c

+++ b/kernel/drivers/hid/hid-multitouch.c

@@ -649,8 +649,8 @@ static void mt_complete_slot(struct mt_device *td, struct input_dev *input)

int major = max(s->w, s->h) >> 1;

int minor = min(s->w, s->h) >> 1;

- input_event(input, EV_ABS, ABS_MT_POSITION_X, s->x);

- input_event(input, EV_ABS, ABS_MT_POSITION_Y, s->y);

+ input_event(input, EV_ABS, ABS_MT_POSITION_X, 2048-s->x);

+ input_event(input, EV_ABS, ABS_MT_POSITION_Y, 2048-s->y);

input_event(input, EV_ABS, ABS_MT_TOOL_X, s->cx);

input_event(input, EV_ABS, ABS_MT_TOOL_Y, s->cy);

input_event(input, EV_ABS, ABS_MT_DISTANCE,

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值