2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

LinuxでもバランスWiiボードをゲーム操作に使いたい

2
Last updated at Posted at 2026-08-08

Ubuntu 26.04 でバランスWiiボード (Wii Balance Board) とのペアリングが安定するようになったので、それを普通のPCゲームでも使えるようにしてみました。

なおバランスWiiボードをジョイスティックに見せかける都合上、普通のゲームパッドと併用することが前提となっています。

1. バランスWiiボードの接続

まずBluetoothの設定を開いたら、バランスWiiボードの電源ボックスにある赤いSYNCボタンを押してペアリングを行います。

ちゃんと接続されたらまずはxwiimoteでPCからセンサーの値を読み込めるかを確認します。

$ sudo apt install xwiimote
$ xwiishow list
Listing connected Wii Remote devices:
  Found device #1: /sys/devices/virtual/misc/uhid/0005:057E:0306.XXXX
End of device list
$ sudo xwiishow 1:b # 引数は(デバイス番号):(バランスWiiボードを意味する'b')

うまく表示されて"Device: balanceboard"という表示があることを確認したら、「Balance Board」の項目が出るまで端末ソフトウェアのウインドウを拡大してください。かなり大きく拡大する必要があります。

「Balance Board」の項目が表示されたらバランスWiiボードに負荷を掛けて#1〜#4とSumがちゃんと増加することを確認してください。増加が確認できたら xwiishow を中断してxwiimoteを忘れます。

2. バランスWiiボードのセンサー入力をジョイスティック入力へと変換する

まずはバランスWiiボードのイベントハンドラ(?)の番号を取得します。

$ grep -A4 -i "Nintendo Wii Remote Balance Board" /proc/bus/input/devices
N: Name="Nintendo Wii Remote Balance Board"
P: Phys=
S: Sysfs=/devices/virtual/misc/uhid/0005:057E:0306.XXXX/input/inputXXX
U: Uniq=
H: Handlers=event7 js2

既にジョイスティックのハンドル (/dev/input/js2) が見えていますが、そのままだとバランスWiiボードの四箇所の重みしか取得できないため、ジョイスティックの二軸に変換するためのプログラムである wbb-uinput を導入します。

今回は座りながらバランスWiiボードを使うことにするので現在のディレクトリに下のパッチ seated_use_patch.diff を保存しておいてください。

seated_use_patch.diff
diff --git a/wbb-uinput.c b/wbb-uinput.c
index 775055c..69953d7 100644
--- a/wbb-uinput.c
+++ b/wbb-uinput.c
@@ -104,11 +104,11 @@ int main(int argc, char** argv)

                evw[0].type  = EV_ABS;
                evw[0].code  = ABS_Y;
-               evw[0].value = y;
+               evw[0].value = y * 50;

                evw[1].type  = EV_ABS;
                evw[1].code  = ABS_X;
-               evw[1].value = x;
+               evw[1].value = x * 50;

                evw[2].type  = EV_SYN;
                evw[2].code  = SYN_REPORT;

wbb-uinput のソースコードを取ってきてパッチを適用してコンパイルします。

$ git clone https://github.com/g-rden/wbb-uinput.git
$ cd wbb-uinput
$ ls ../seated_use_patch.diff
../seated_use_patch.diff
$ git apply ../seated_use_patch.diff
$ gcc wbb-uinput.c -o wbb-uinput

wbb-uinput のコンパイルができたらその実行をします。

$ sudo -s
# grep -A4 -i "Nintendo Wii Remote Balance Board" /proc/bus/input/devices | grep event
H: Handlers=event7 js2
# ./wbb-uinput /dev/input/event7 > /dev/null &
# grep -A4 -i "wbb" /proc/bus/input/devices | grep event
H: Handlers=event8 js3

これでバランスWiiボードの入力をジョイスティックの入力に変換できました。ちゃんと使えるかどうかをテストするにはjstest-gtkなどを使うと良いでしょう。

3. ジョイスティック入力と普通のゲームパッドの複合デバイスを作成する

ジョイスティック単独のままでは一般のPCゲームで使いにくいため、普通のゲームパッドとwbbの複合デバイスを作成します。

まずは interception-tools を導入して設定ファイルを作成します。

$ sudo apt install interception-tools interception-tools-compat
$ grep -A4 -i "GameSir T4 Kaleid" /proc/bus/input/devices | grep event # 自分のコントローラーの機種名に変更する
H: Handlers=event6 js1
$ grep -A4 -i "wbb" /proc/bus/input/devices | grep event
H: Handlers=event8 js3
$ sudo uinput -p -d /dev/input/event6 -d /dev/input/event8 > wbb_mux.yaml
$ sed -i wbb_mux.yaml -e 's/NAME: .*/NAME: wbb_mux/'

作成した設定ファイルを使って複合デバイスを作成します。

$ sudo -s
# mux -c wbb_mux
# mux -i wbb_mux | uinput -c wbb_mux.yaml &
# intercept -g /dev/input/event6 | mux -o wbb_mux &
# intercept -g /dev/input/event8 | mux -o wbb_mux &

これでバランスWiiボードのジョイスティック入力と普通のゲームパッドを複合デバイスへと変換できました。TODO: L2が動作しない?する?再確認。

4. バランスWiiボードを使って普通のPCゲームを遊ぶ

作成した複合デバイスは Steam でも普通に認識されるため、バランスWiiボードはゲームパッドに対応する多くのPCゲームでそのまま使えるはずです。

まずはスキーゲームで使うのが良いかなと思ってChatGPTにおすすめされた『Lonely Mountains: Snow Riders』のデモ版を試してみたものの、何故か途中でコントローラが途切れてキーボード操作に移されるため断念しました。

とりあえずシリアスすぎないゲームということで『閃乱カグラ Burst Re:Newal』の雑魚戦を遊んでみましたが、細かな操作は難しいにしても思った以上にちゃんと遊べるようです。楽しい。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?