我正在使用 VirtualBox,它具有“鼠标集成”功能,该功能可创建VirtualBox mouse integration
除现有指针输入之外的第二个指针输入。
$ xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ VirtualBox mouse integration id=9 [slave pointer (2)]
⎜ ↳ ImExPS/2 Generic Explorer Mouse id=11 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Sleep Button id=7 [slave keyboard (3)]
↳ Video Bus id=8 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)]
该线程有关于“VirtualBox 中的多个光标输入”问题的更多详细信息:移动鼠标时无法滚动 - Win10 上的 Fedora 28 VM guest 虚拟机
根据该线程,VirtualBox mouse integration
仅接收移动事件,而其他设备仅接收滚动事件。因此,鼠标移动时滚动不起作用,因为许多程序一次只允许一个活动输入设备。
是否有可能将这两个输入设备组合成一个“虚拟”输入设备,以便桌面程序可以使用该设备作为活动输入设备?
可以通过以下方式检查鼠标输入事件:
xinput test-xi2 --root
在我的机器上,它清楚地显示不同设备发送的鼠标位置和滚动事件:
EVENT type 17 (RawMotion)
device: 2 (9)
detail: 0
flags:
valuators:
0: 1704.97 (1704.97)
1: 39323.40 (39323.40)
EVENT type 6 (Motion)
device: 9 (9)
detail: 0
flags:
root: 55.23/570.23
event: 55.23/570.23
buttons:
modifiers: locked 0x10 latched 0 base 0 effective: 0x10
group: locked 0 latched 0 base 0 effective: 0
valuators:
0: 1704.97
1: 39323.40
windows: root 0x532 event 0x532 child 0x4600003
EVENT type 17 (RawMotion)
device: 2 (12)
detail: 0
flags:
valuators:
3: 15.00 (15.00)
EVENT type 6 (Motion)
device: 12 (12)
detail: 0
flags:
root: 55.23/571.23
event: 55.23/571.23
buttons:
modifiers: locked 0x10 latched 0 base 0 effective: 0x10
group: locked 0 latched 0 base 0 effective: 0
valuators:
3: -1470.00
windows: root 0x532 event 0x532 child 0x4600003
EVENT type 15 (RawButtonPress)
device: 2 (12)
detail: 5
flags: emulated
valuators:
EVENT type 4 (ButtonPress)
device: 12 (12)
detail: 5
flags: emulated
root: 55.23/571.23
event: 55.23/571.23
buttons:
modifiers: locked 0x10 latched 0 base 0 effective: 0x10
group: locked 0 latched 0 base 0 effective: 0
valuators:
windows: root 0x532 event 0x532 child 0x4600003
EVENT type 16 (RawButtonRelease)
device: 2 (12)
detail: 5
flags: emulated
valuators:
EVENT type 5 (ButtonRelease)
device: 12 (12)
detail: 5
flags: emulated
root: 55.23/571.23
event: 55.23/571.23
buttons: 5
modifiers: locked 0x10 latched 0 base 0 effective: 0x10
group: locked 0 latched 0 base 0 effective: 0
valuators:
windows: root 0x532 event 0x532 child 0x4600003