红旗linux6.0鼠标单击变双击如何处理

红旗linux6.0鼠标单击变双击如何处理,第1张

鼠标用的时间长了吧,按键下面的微动开关的簧片表面氧化会造成接触不良导致单击被鼠标内的电路判决为双击,解决方法:

1、拆开鼠标,再把里面的微动开关拆开,把簧片表面用小刀刮一刮就行了。

2、当1不能解决时,去电子商城买一个同型号的微动开关回来,把原来那个换掉,一般来说鼠标的PCB版简单焊点大,自己动手换还是比较容易的

3、当1和2都不行的时候就换鼠标吧……

一、先列下linux自带的触控板手势 单指单击不说了 双指上下滑上下滚动 双指左右滑左右滚动 双指单击相当于鼠标右键 三指双击(单击无效果)切换窗口 四指单击相当于super 2、ctrl + Alt +T打开终端,输入sudo apt-get install libinput-tools,我已经安装过了,所以你们的结果可能和我的不一样,如果出现了error,尝试sudo apt update,之后重新输入运行 3、输入sudo apt-get install xdotool 4、输入sudo su root。输入密码,之后变成了这个样子,再输入gem install fusuma,不出意外的话就安装完毕啦! 二、自定义手势 1、打开资源管理器,找到home下面的.config目录 2、找不到请在菜单栏依次找到edit->preferences(就是edit下面的最后一个),勾上显示隐藏文件 3、在.config下面新建一个fusuma目录,打开它。新建一个文件,名字是config.yml(抱歉图中我打错了) 4、双击打开文件粘贴下面这段 swipe: 3: left: shortcut: 'alt+Left'right: shortcut: 'alt+Right'up: shortcut: 'ctrl+t'down: shortcut: 'ctrl+w' 4:left: shortcut: 'ctrl+super+Down'right: shortcut: 'alt+F4'up: shortcut: 'ctrl+super+Up'down: shortcut: 'alt+m'pinch: in:shortcut: 'ctrl+plus' out: shortcut: 'ctrl+minus'threshold: swipe: 1 pinch:

我在3.2内核下做的,配合Xorg 1.2.4,Xinput2,Qt5.2.1。

首先,驱动程序probe的时候要声明成多点触摸的:

input_set_abs_params(input, ABS_X, 0, pdata->x_res - 1, 0, 0)

input_set_abs_params(input, ABS_Y, 0, pdata->y_res - 1, 0, 0)

input_set_abs_params(input, ABS_MT_POSITION_X,

0, pdata->x_res - 1, 0, 0)

input_set_abs_params(input, ABS_MT_POSITION_Y,

0, pdata->y_res - 1, 0, 0)

error = input_mt_init_slots(input, MAX_SUPPORT_POINTS)

pdata是board-[mach].c里面定义的platform data,如果是3.8以上的内核,你可以用device tree。

其次,提交触摸数据的时候,要提交成多点的:

for (i = 0i <MAX_SUPPORT_POINTSi++)

{

type = posdata.touch[i].xh >>6

if (type == TOUCH_EVENT_RESERVED)

continue

x = ((posdata.touch[i].xh <<8) | (posdata.touch[i].xl)) &0x0fff

y = ((posdata.touch[i].yh <<8) | (posdata.touch[i].yl)) &0x0fff

id = (posdata.touch[i].yh >>4) &0x0f

down = (type != TOUCH_EVENT_UP)

input_mt_slot(tsdata->input, id)

input_mt_report_slot_state(tsdata->input, MT_TOOL_FINGER, down)

if (!down)

continue

input_report_abs(tsdata->input, ABS_MT_POSITION_X, x)

input_report_abs(tsdata->input, ABS_MT_POSITION_Y, y)

}

input_mt_report_pointer_emulation(tsdata->input, true)

input_sync(tsdata->input)

然后,Buildroot做根文件系统的时候要选上Target packages >Libraries >Hardware handling >mtdev和Target packages >Graphic libraries and applications (graphic/text) >X.org X Window System >X11R7 Drivers >xf86-input-evdev,网上有很多文章说如何让X支持多点触摸的,那都是过去式了,现在的X和xf86-input-evdev都支持多点触摸。

最后,编译Qt开发包的时候要加上-xinput2选项,在qtbase/examples/touch里能找到触摸屏的样例代码。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/8423088.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-16
下一篇 2023-04-16

发表评论

登录后才能评论

评论列表(0条)

保存