触摸屏相对坐标
我在触摸屏设备上使用 xrandr -o left|right|inverse|normal 旋转了 X 环境。除了触摸之外一切正常。当在屏幕上移动手指时,它会获取手指的绝对坐标,如果旋转方向相反,则将光标向相反方向移动。所以如果我向上滑动,它实际上会向下滑动。那么有没有办法配置触摸屏输入来读取相对坐标而不是绝对坐标。触摸屏驱动程序是evdev。
问候, 莱文
I've rotated X environment with xrandr -o left|right|inverse|normal on touch screen device. Everything is working OK beside touch. When moving finger on the screen, it takes absolute coordinates of finger and moves cursor in opposite direction if the rotation is inverse. So if I slide up actually it slides down. So is there a way to configure Touch screen input to read relative coordinates not absolute. Touch screen driver is evdev.
Regards,
Levon
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只要方向不改变,相对/绝对仍然不会做你想做的事。没有通用机制告诉 X 服务器以不同的方向解释指针设备。您需要以某种方式让底层设备以不同的方式报告。然而,有一种与底层设备通信的通用机制。
我的笔记本电脑内置了 Wacom 手写笔。要恢复正常方向,我可以执行以下操作:
xsetwacom set "stylus" Rotate NONE
直接与底层驱动程序对话。我还可以执行以下操作:
xinput set-int-prop stylus 'Wacom Rotation' '8' 0
通过 XInput“属性”与 X 驱动程序通信以执行相同的操作。
幸运的是,“evdev”确实允许这种重新映射。
xinput list
,除了手写笔之外,还显示我的笔记本电脑的轨迹点和外部鼠标,它们均通过 evdev 运行:xinput list-props 'HID 0430:0100'
xinput set-int-prop 'HID 0430:0100' 'Evdev Axis Inversion' 8 1 1
反转我的外部鼠标。要设置为正常:
旋转 90 度:
反转:
反向旋转 90 度: 当然,
您需要某种方法来选择要在哪个设备上放置属性。
Relative/Absolute still won't do what you want, so long as the orientation isn't changed too. There is no generic mechanism to tell the X server to interpret pointer devices in a different orientations. You'll need to somehow get the underlying device to report differently. There is a generic mechanism for communicating with the underlying device, however.
I have a Wacom stylus built in to my laptop. To restore normal orientation, I can do the following:
xsetwacom set "stylus" Rotate NONE
which directly talks to the underlying driver. I can also do the following:
xinput set-int-prop stylus 'Wacom Rotation' '8' 0
which communicates with the X driver via XInput "properties" to do the same thing.
The "evdev" is fortunately one that does allow such remapping.
xinput list
, in addition to the stylus shows my laptop's trackpoint and an external mouse which are both run via evdev:xinput list-props 'HID 0430:0100'
xinput set-int-prop 'HID 0430:0100' 'Evdev Axis Inversion' 8 1 1
inverts my external mouse.To set to normal:
Rotated by 90 degrees:
Inverted:
Rotated by 90 degrees the other way:
You will need some way of picking out what device to put the properties on, of course.