linux input如何固定设备event handler
2015-10-02 14:36
633 查看
于qt开发时间。遇到的问题,usb输入设备(鼠标器,usb 电容屏)在动力分配后自己主动input节点,实例usb鼠标停留电后,分配给自己的主动性/dev/input/event0 mouse0。第一插头后,加入自己主动节点在未来。变/dev/input/event1mouse1
对于鼠标类型的设备。/dev/input/mouseX 的全部消息都会汇总到/dev/input/mice,因此,qt的QWS_MOUSE_PROTO输入能够指定IntelliMouse=/dev/input/mice,鼠标插拔即使mouseX变化也都能使用。
可是,对于usb触控类型输入设备,使用的event接口,向应用层汇报的是绝对坐标信息。不是mouse的相对坐标信息,所以当eventX设备号变化后。应用层就无法识别了,由于没有像/dev/input/mice这种接口。而大部分应用触控都使用了tslib。TSLIB_TSDEVICE=/dev/input/event0,
直接给出须要改动的地方:
共同拥有3处:drivers/input/input.c input_register_device函数
![](http://img.blog.csdn.net/20140508094318015)
drivers/input/mousedev.c mousedev_connect函数
![](http://img.blog.csdn.net/20140508094403265)
drivers/input/evdev.c evdev_connect函数
![](http://img.blog.csdn.net/20140508094445500)
结果例如以下,我的三个设备都固定为event6 event7 event8 ,usb设备随意插拔,event handler也不会变化
/ #
/ # cat /proc/bus/input/devices
I: Bus=0018 Vendor=0000 Product=0000 Version=0000
N: Name="gt928 Touchscreen"
P: Phys=1-0014/input0
S: Sysfs=/devices/virtual/input/input6
U: Uniq=
H: Handlers=mouse6 event6
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="ADS7846 Touchscreen"
P: Phys=spi1.0/input0
S: Sysfs=/devices/platform/omap2_mcspi.1/spi1.0/input/input7
U: Uniq=
H: Handlers=mouse7 event7
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003
I: Bus=0003 Vendor=0eef Product=0001 Version=0100
N: Name="eGalax Inc. USB TouchController"
P: Phys=usb-ehci-omap.0-1.1/input0
S: Sysfs=/devices/platform/ehci-omap.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input8
U: Uniq=
H: Handlers=mouse8 event8
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003
/ #
对于鼠标类型的设备。/dev/input/mouseX 的全部消息都会汇总到/dev/input/mice,因此,qt的QWS_MOUSE_PROTO输入能够指定IntelliMouse=/dev/input/mice,鼠标插拔即使mouseX变化也都能使用。
可是,对于usb触控类型输入设备,使用的event接口,向应用层汇报的是绝对坐标信息。不是mouse的相对坐标信息,所以当eventX设备号变化后。应用层就无法识别了,由于没有像/dev/input/mice这种接口。而大部分应用触控都使用了tslib。TSLIB_TSDEVICE=/dev/input/event0,
直接给出须要改动的地方:
共同拥有3处:drivers/input/input.c input_register_device函数
drivers/input/mousedev.c mousedev_connect函数
drivers/input/evdev.c evdev_connect函数
结果例如以下,我的三个设备都固定为event6 event7 event8 ,usb设备随意插拔,event handler也不会变化
/ #
/ # cat /proc/bus/input/devices
I: Bus=0018 Vendor=0000 Product=0000 Version=0000
N: Name="gt928 Touchscreen"
P: Phys=1-0014/input0
S: Sysfs=/devices/virtual/input/input6
U: Uniq=
H: Handlers=mouse6 event6
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="ADS7846 Touchscreen"
P: Phys=spi1.0/input0
S: Sysfs=/devices/platform/omap2_mcspi.1/spi1.0/input/input7
U: Uniq=
H: Handlers=mouse7 event7
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003
I: Bus=0003 Vendor=0eef Product=0001 Version=0100
N: Name="eGalax Inc. USB TouchController"
P: Phys=usb-ehci-omap.0-1.1/input0
S: Sysfs=/devices/platform/ehci-omap.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input8
U: Uniq=
H: Handlers=mouse8 event8
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003
/ #
相关文章推荐
- Linux上iptables防火墙的基本应用教程
- Centos 7 系统安装完毕修改网卡名为eth0
- Linux<三>文件的基本操作
- linux文件处理命令——命令格式与目录处理命令 ls
- linux ethtool
- 挖墙脚?Linux 基金会让 Chromebook 用户安装 Linux
- Linux 下编译自己的 OpenJDK7 包括JVM和JDK API
- linux命令一
- Shark machine learning library在linux下的安装
- windows和linux服务器之间的通信
- 几种在Linux下查询外网IP的办法。
- linux中安装eclipse,安装好之后不能直接建servlet,不能直接在jsp页面中run on server.权限在作怪,我猜的,
- Linux系统下VI编辑器中如何删除整行
- Linux系统中设置串口属性的基本流程
- linux于test 订购具体解释
- linux创建文件
- 新装LINUX系统如何获得ROOT权限,图文教程
- linux at 无法使用的问题
- Linux 进程管理(一)
- centos 图形 命令行 界面切换