[!IMPORTANT] 该软件需要一个更新/修复的 Wiimote 内核驱动,可在此处找到。
安装后,运行
sudo sed -i '/ATTR{inhibited}="1"/s/^/#/' /etc/udev/rules.d/99-wiimote.rules以取消阻止红外和加速度计事件。
基于 esperto 输入系统,esperto-wiimote 是一个高级 Wiimote 映射器。它具有精确的加速度计校准、良好的红外追踪和强大的重映射选项,并支持组合键。它几乎不增加延迟,延迟主要取决于内核自身的 evdev/uinput API。
本程序包含 Hector Martin 的 2 点红外追踪算法的 port++ 实现,并附带供参考。
可于 crates.io 获取。
配置文件通过 --config <FILE> 指定。如果未指定,程序将加载内置的媒体遥控器默认配置,位于 src/default.yaml。
以下是一个带说明的配置示例:
# Whether to grab the devices, so other software won't use them
grab: false
# Command to run when the first Wiimote connects, as list of arguments
# Useful for automation like powering on the sensor bar
on_connect: [ "echo", "hello", "world" ]
# Command to run when thelast Wiimote disconnected, as list of arguments
# Useful for automation like powering off the sensor bar
on_disconnect: [ "echo", "goodbye", "world" ]
# Options for the output device slot. For each Wiimote there are four available slots, from `slot1` to `slot4`.
# Slots are useful to isolate mouse/keyboard/joysticks inputs
slots:
slot1:
# Name of the wirtual device
name: "Esperto Wiimote mouse"
slot2:
name: "Esperto Wiimote keyboard"
# Whether the device should autorepeat held keys, this might get overruled by the compositor
repeating: true
# Accelerometer calibration data generated with the `esperto-wiimote calibration` command
accelerometer_calibration: [
1.0014056, -0.011690015, 0.009826779,
-0.02909683, 1.013545, 0.005751312,
-0.010004735, -0.012316463, 0.99458194,
28.481918, 33.827446, 30.468597 ]
# Margins of the mapped area. True margins are 0-4095 (regardless of screen resolution), but you will
# want to exceed those to account for the aspect ratio, and the IR sensor not reaching all the way to the margins.
# The same scaling will be applied to all axes
screen_limits:
north: -2000
south: 6569
west: -300
east: 4395
# Center an axis when it gets enabled
centering:
# Axes can be specified by name...
!Axis ABS_X: 2048
# Or by their real integer id
!CustomAxis 1: 2048
# Park an axis when it gets disabled
parking:
!CustomAxis 0: 4095
!Axis ABS_Y: 4095
# The physical dimensions of your sensorbar
sensor_bar:
width: 19.5
cluster_width: 4.5
cluster_height: 1.0
pixel_width: 256.0
# The smoothing parameters can be tuned
smoothing:
radius: 30.0
speed: 0.15
deadzone: 8.0
# esperto combos configuration, check https://github.com/KayJay7/esperto for more information
esperto:
modifiers:
- name: pointer
keys: [ B ]
actions:
- key: A
action:
# Actions must specify their output slot
slot: Slot2
# Keys can be specified by name...
code: !Key KEY_SPACE
modified:
- modifier: pointer
action:
slot: Slot1
# Or by their integer id
code: !CustomKey 0x110
可用的 Wiimote 按键完整列表:
ABUpDownLeftRightPlusMinusHomeBtn1Btn2以及轴:
IRAbsXIRAbsY可用输出码的完整列表见此处。如果某个扫描码名称无法识别,数字 ID 仍然有效。
可通过运行 esperto-wiimote calibration 启动加速度计校准向导。
你需要按照提示将 Wiimote 分别放置在 6 个面上,并等待工具收集足够的读数。输出将添加到配置文件(如果提供了的话),否则将打印在屏幕上。如有必要,可以通过参数提供一些高级覆盖项。
我们强烈建议在使用本程序之前校准你的 Wiimote,否则加速度计可能相当不可靠。最好在遥控器达到正常工作温度后再进行校准。 请记住,传感器读数会随时间及温度变化产生轻微漂移,但由于软件会考虑漂移因素,可能并不需要重新校准。