
Advanced Wiimote remapping software
[!IMPORTANT] Это программное обеспечение требует обновленного/исправленного драйвера ядра Wiimote, доступного здесь.
После установки выполните
sudo sed -i '/ATTR{inhibited}="1"/s/^/#/' /etc/udev/rules.d/99-wiimote.rules, чтобы разблокировать события ИК и акселерометра.
Основанная на системе ввода esperto, esperto-wiimote — это продвинутый маппер Wiimote. Он обладает точной калибровкой акселерометра, хорошим отслеживанием ИК и мощными возможностями переназначения с поддержкой комбинаций. Он практически не добавляет задержек, в основном определяемых самим API evdev/uinput ядра.
Эта программа включает порт++ алгоритма отслеживания двухточечного ИК от Гектора Мартина, встроенный для справки.
Доступно на 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Полный список доступных выходных кодов находится здесь. Если имя скан-кода не распознается, числовой идентификатор все равно будет работать.
Мастер калибровки акселерометра можно запустить, выполнив esperto-wiimote calibration.
Вам нужно будет разместить Wiimote на шести сторонах, как будет предложено, и подождать, пока инструмент соберет достаточно показаний. Результат будет добавлен в файл конфигурации (если он указан) или выведен на экран. При необходимости можно указать дополнительные расширенные параметры.
Мы настоятельно рекомендуем откалибровать ваш Wiimote перед использованием этой программы, иначе акселерометр может быть довольно ненадежным. Лучше калибровать после того, как пульт достигнет своей нормальной рабочей температуры. Помните, что показания датчика будут немного дрейфовать со временем и при изменении температуры, но перекалибровка, вероятно, не потребуется, так как программное обеспечение учитывает дрейф.