我有一台带触摸屏的 HP Spectre x360 笔记本电脑,还配有 HP 触控笔用于输入。目前,触控笔无法使用,也就是说,我用它触摸屏幕,但它不会移动光标,也不会产生点击等。触摸屏对于手指触摸来说工作正常。
我想知道是否有一个命令可以显示来自触摸屏/手写笔的原始输入,这样我就可以判断问题是否是输入没有被正确解释,或者根本没有接收到输入?
答案1
答案2
使用新输入在终端窗口中找到手写笔设备;例如,
$ xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=14 [slave pointer (2)]
⎜ ↳ ELAN Touchscreen Pen id=9 [slave pointer (2)]
⎜ ↳ ELAN Touchscreen id=11 [slave pointer (2)]
然后,您可以使用xinput test-xi2 <device-ID>
显示该设备的原始输入(或跳过该设备以显示所有事件);例如,
$ xinput test-xi2 9
ELAN Touchscreen Pen id=9 [slave pointer (2)]
Reporting 4 classes:
Class originated from: 9. Type: XIButtonClass
Buttons supported: 7
Button labels: "Button Unknown" "Button Unknown" "Button Unknown" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right"
Button state:
Class originated from: 9. Type: XIValuatorClass
Detail for Valuator 0:
Label: Abs X
Range: 0.000000 - 32256.000000
Resolution: 110000 units/m
Mode: absolute
Current value: 1280.000000
Class originated from: 9. Type: XIValuatorClass
Detail for Valuator 1:
Label: Abs Y
Range: 0.000000 - 17920.000000
Resolution: 108000 units/m
Mode: absolute
Current value: 720.000000
Class originated from: 9. Type: XIValuatorClass
Detail for Valuator 2:
Label: Abs Pressure
Range: 0.000000 - 255.000000
Resolution: 0 units/m
Mode: absolute
Current value: 0.000000
您可以使用Ctrl+C退出事件显示。