Hi-*_*gel 51
只需强制指针跳过像素,方法如下:
首先列出输入设备:
$ xinput list
? Virtual core pointer id=2 [master pointer (3)]
? ? Virtual core XTEST pointer id=4 [slave pointer (2)]
? ? PixArt USB Optical Mouse id=10 [slave pointer (2)]
? ? ETPS/2 Elantech Touchpad id=15 [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)]
? Video Bus id=7 [slave keyboard (3)]
? Sleep Button id=8 [slave keyboard (3)]
? USB2.0 UVC 2M WebCam id=9 [slave keyboard (3)]
? Asus Laptop extra buttons id=13 [slave keyboard (3)]
? AT Translated Set 2 keyboard id=14 [slave keyboard (3)]
? USB Keyboard id=11 [slave keyboard (3)]
? USB Keyboard id=12 [slave keyboard (3)]
Run Code Online (Sandbox Code Playgroud)
在示例中,我们看到鼠标是PixArt USB Optical Mouse。接下来列出它的属性:
$ xinput list-props "PixArt USB Optical Mouse"
Device 'PixArt USB Optical Mouse':
Device Enabled (140): 1
Coordinate Transformation Matrix (142): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (265): 0
Device Accel Constant Deceleration (266): 1.000000
Device Accel Adaptive Deceleration (267): 1.000000
Device Accel Velocity Scaling (268): 10.000000
Device Product ID (260): 2362, 9488
Device Node (261): "/dev/input/event5"
Evdev Axis Inversion (269): 0, 0
Evdev Axes Swap (271): 0
Axis Labels (272): "Rel X" (150), "Rel Y" (151), "Rel Vert Wheel" (264)
Button Labels (273): "Button Left" (143), "Button Middle" (144), "Button Right" (145), "Button Wheel Up" (146), "Button Wheel Down" (147), "Button Horiz Wheel Left" (148), "Button Horiz Wheel Right" (149)
Evdev Middle Button Emulation (274): 0
Evdev Middle Button Timeout (275): 50
Evdev Third Button Emulation (276): 0
Evdev Third Button Emulation Timeout (277): 1000
Evdev Third Button Emulation Button (278): 3
Evdev Third Button Emulation Threshold (279): 20
Evdev Wheel Emulation (280): 0
Evdev Wheel Emulation Axes (281): 0, 0, 4, 5
Evdev Wheel Emulation Inertia (282): 10
Evdev Wheel Emulation Timeout (283): 200
Evdev Wheel Emulation Button (284): 4
Evdev Drag Lock Buttons (285): 0
Run Code Online (Sandbox Code Playgroud)
通过更改“坐标变换矩阵”属性,我们可以提高指针速度。文档说它用于计算指针移动。引用:
默认情况下,X 中每个输入设备的 CTM 都是单位矩阵。例如,假设您在屏幕上的 (400, 197) 点触摸触摸屏:
Run Code Online (Sandbox Code Playgroud)? 1 0 0 ? ? 400 ? ? 400 ? ? 0 1 0 ? · ? 197 ? = ? 197 ? ? 0 0 1 ? ? 1 ? ? 1 ?设备事件的 X 和 Y 坐标输入到计算的第二个矩阵中。计算的结果是事件的 X 和 Y 坐标映射到屏幕的位置。如图所示,单位矩阵将设备坐标映射到屏幕坐标,没有任何变化。
因此,我们要增加X和Y值,其余保持不变。我电脑上的一个例子:
$ xinput set-prop "PixArt USB Optical Mouse" "Coordinate Transformation Matrix" 2.4 0 0 0 2.4 0 0 0 1
Run Code Online (Sandbox Code Playgroud)
稍微玩一下,直到您对速度感到满意为止。
感谢来自 Xorg 邮件列表的 Simon Thum 提供有关矩阵的提示。
UPD:请注意,在 Wine 中运行的一些 Windows 游戏可能会开始表现出奇怪的指针行为(例如,有人注意到无论您如何移动鼠标,反恐精英 1.6 中的十字准线都会下降直到盯着地板),在这种情况下只需重置X和在运行游戏之前,CTM 的Y回到1。
ter*_*don 21
以下内容是从@Luke在 Ask Ubuntu 上发布的答案中逐字复制的。我将其作为社区 wiki 答案发布,因此该信息也可以在此站点上。
KDE 尚未将其内置到其控制中心,但您可以从命令行使用 xinput。首先,运行
xinput list以查找鼠标的设备号:Run Code Online (Sandbox Code Playgroud)$ xinput list ? Virtual core pointer id=2 [master pointer (3)] ? ? Virtual core XTEST pointer id=4 [slave pointer (2)] ? ? SynPS/2 Synaptics TouchPad id=10 [slave pointer (2)] ? Virtual core keyboard id=3 [master keyboard (2)] ? Virtual core XTEST keyboard id=5 [slave keyboard (3)] ? AT Translated Set 2 keyboard id=9 [slave keyboard (3)]在我的笔记本电脑上,我想要的设备 ID 是 10(SynPS/2 Synaptics TouchPad)。在您的系统上,您必须决定哪个设备是正确的。接下来,运行
xinput list-props <your device id>以查看该设备的当前设置:Run Code Online (Sandbox Code Playgroud)$ xinput list-props 10 Device 'SynPS/2 Synaptics TouchPad': Device Enabled (144): 1 Device Accel Profile (266): 1 Device Accel Constant Deceleration (267): 2.500000 Device Accel Adaptive Deceleration (268): 1.000000 Device Accel Velocity Scaling (269): 12.500000 [ many more settings omitted ]您感兴趣的属性是“Device Accel Constant Deceleration (267)”。要减慢鼠标速度,必须通过运行来增加该值
xinput set-prop <your device id> <property id> <value>:Run Code Online (Sandbox Code Playgroud)$ xinput set-prop 10 267 5.0在本例中,该值从 2.5 增加到 5.0,鼠标以半速移动。
可以在X.org找到对属性的解释。
如果在脚本中使用它,则使用全名可能会有所帮助,因为 id 等可以更改。例如:
xinput --set-prop "SynPS/2 Synaptics TouchPad" "Device Accel Constant Deceleration" 1
Run Code Online (Sandbox Code Playgroud)
小智 6
如果您使用 Xorg.conf 来设置您的 X 服务器,您可以使用它来设置加速或减速。只需添加一些效果:
Section "InputDevice"
Identifier "name"
Driver "evdev"
Option "ConstantDeceleration" "multiplier"
EndSection
Run Code Online (Sandbox Code Playgroud)
其中 multiplier 是您希望鼠标移动的速度慢多少倍。0.5 会使速度加倍,或者 2 会使速度减半。同样,虽然更复杂:
Section "InputDevice"
Identifier "name"
Driver "evdev"
Option "TransformationMatrix" "a b c d e f g h i"
EndSection
Run Code Online (Sandbox Code Playgroud)
其中“a”到“i”是转换矩阵,如其他答案中所述。
来源:xorg.conf 联机帮助页