How to Use a Nintendo Wii Controller to Play Linux Games

You can even play Wii games on Linux with the Wii remote

Girl using laptop
g&l images / Getty Images

You can play Nintendo Wii games on Linux if you know how to use the Wii remote with your computer. You can also use the Wii remote instead of a PC game controller to play any game using an emulator.

Instructions in this article apply to Debian-based Linux distributions such as Debian, Mint, and Ubuntu.

What You Need to Use a Wii Remote With Linux

In addition to a Wii controller, you will need to install the following Linux packages:

You can get all of these tools by entering a single sudo command in the Linux command terminal:

sudo apt-get install lswm wminput libcwiid1

If you are using an RPM-based Linux distribution, you can use YUM or a similar tool to get these applications.

How to Connect a Wii Remote to Linux

You can configure the Wii remote from the command line:

  1. Open the Linux command terminal and enter the following command to get the Bluetooth address of your Wii controller:

    lswm

  2. Press and hold the 1 and 2 buttons on the Wii controller at the same time when prompted. If done correctly, a set of numbers and letters should appear in the terminal like this:

    00:1B:7A:4F:61:C4

    Make sure you have Bluetooth enabled on your computer. You may have to try a couple of times before your PC detects the Wii remote.

  3. Enter the following into the terminal window to open the Nano editor so that you can setup a configuration file to map the Wii buttons to keys:

    sudo nano /etc/cwiid/wminput/gamepad

  4. Copy and paste the following into the bottom of the Nano editor file:

    Wiimote.Down = KEY_RIGHT
    Wiimote.Left = KEY_DOWN
    Wiimote.Right = KEY_UP
    Wiimote.1 = KEY_SPACE
    Wiimote.2 = KEY_LEFTCTRL
    Wiimote.A = KEY_LEFTALT
    Wiimote.B = KEY_RIGHTCTRL
    Wiimote.Plus = KEY_LEFTSHIFT
  5. Press CTRL + O on the keyboard to save the configuration file.

  6. Press CTRL + X to close Nano.

  7. After configuring the button mapping, run the following command:

    sudo wminput -c /etc/cwiid/wminput/gamepad

  8. Press and hold the 1 and 2 buttons on the Wii controller at the same time again when prompted. The word "ready" will appear if the connection is successful. Start any game to play with the Wii remote.

One major advantage of the Wii controller is the D-pad, which works much better for old school games than the Xbox One thumb stick because it isn't quite as sensitive.

Configuring the Wii Remote for Linux

When you create your configuration file, it should already contain some text such as the following:

# gameport
Classic.Dpad.X = ABS_X
Classic.Dpad.Y = ABS_Y
Classic.A = BTN_A

The format for each line in the file is Wii controller button = keyboard button. For example:

Wiimote.Up = KEY_UP

The above command maps the Up button on the Wii remote to the up arrow on the keyboard. However, since you must hold the Wii remote on its side to play most games, you may want to map the Up button to the left arrow key:

Wiimote.Up = KEY_LEFT
The settings recommended in step four of the instructions above results in the following configuration:
Wii Remote Button Linux Keyboard
Up Left Arrow
Down Right Arrow
Left Down Arrow
Right Up Arrow
1 Space
2 Left CTRL
A Left ALT
B Right CTRL
Plus (+) Left Shift

Most emulators streamline the button mapping process, so after you've connected your Wii remote to Linux, you can further customize the controls for specific games and consoles. Some PC games even allow you to map mouse keys to the Wii controller.

You can see recommend controller settings for retro games at the Internet Archive Arcade website.

Wii Remote Buttons

You can use multiple Wii accessories with Linux including the Wii Classic Controller and the Wii Nunchuk. Below is a list of all the Wii controller buttons you can configure in the gamepad file:

Wii Remote

  • Wiimote.Up
  • Wiimote.Down
  • Wiimote.Left
  • Wiimote.Right
  • Wiimote.A
  • Wiimote.B
  • Wiimote.1
  • Wiimote.2
  • Wiimote.Plus
  • Wiimote.Minus
  • Wiimote.Home
  • Wiimote.Dpad.X
  • Wiimote.Dpad.Y

Wii Nunchuk

  • Nunchuk.C
  • Nunchuk.Z
  • Nunchuk.Stick.X
  • Nunchuk.Stick.Y

Wii Classic Controller

  • Classic.Up
  • Classic.Down
  • Classic.Left
  • Classic.Right
  • Classic.Minus
  • Classic.Plus
  • Classic.Home
  • Classic.A
  • Classic.B
  • Classic.X
  • Classic.Y
  • Classic.ZL
  • Classic.ZR
  • Classic.L
  • Classic.R
  • Classic.Dpad.X
  • Classic.Dpad.Y
  • Classic.LStick.X
  • Classic.LStick.Y
  • Classic.RStick.X
  • Classic.RStick.Y
  • Classic.LAnalog
  • Classic.RAnalog

Unfortunately, it is not possible to configure the Wii remote's motion controls with Linux, but you can still play ROMs of Wii games that don't require motion controls.

Keyboard Mappings

Below is a guide for the Linux keyboard to help you set up your configuration file.

Key Code
Escape KEY_ESC
0 KEY_0
1 KEY_1
2 KEY_2
3 KEY_3
4 KEY_4
5 KEY_5
6 KEY_6
7 KEY_7
8 KEY_8
9 KEY_9
- (minus symbol) KEY_MINUS
= (equals symbol) KEY_EQUAL
BackSpace KEY_BACKSPACE
Tab KEY_TAB
Q KEY_Q
W KEY_W
E KEY_E
R KEY_R
T KEY_T
Y KEY_Y
U KEY_U
I KEY_I
O KEY_O
P KEY_P
[ KEY_LEFTBRACE
] KEY_RIGHTBRACE
Enter KEY_ENTER
CTRL (Left side of keyboard) KEY_LEFTCTRL
A KEY_A
S KEY_S
D KEY_D
F KEY_F
G KEY_G
H KEY_H
J KEY_J
K KEY_K
L KEY_L
; (Semi Colon) KEY_SEMICOLON
' (Apostrophe) KEY_APOSTROPHE)
#  
Shift (Left side of keyboard) KEY_LEFTSHIFT
\ KEY_BACKSLASH
Z KEY_Z
X KEY_X
C KEY_C
V KEY_V
B KEY_B
N KEY_N
M KEY_M
, (comma) KEY_COMMA
. (full stop) KEY_DOT
/ (forward slash) KEY_SLASH
Shift (right side of keyboard KEY_RIGHTSHIFT
ALT (left side of keyboard

KEY_LEFTALT

Space bar KEY_SPACE
Caps Lock KEY_CAPSLOCK
F1 KEY_F1
F2 KEY_F2
F3 KEY_F3
F4 KEY_F4
F5 KEY_F5
F6 KEY_F6
F7 KEY_F7
F8 KEY_F8
F9 KEY_F9
F10 KEY_F10
F11 KEY_F11
F12 KEY_F12
Num Kock KEY_NUMLOCK
Shift Lock KEY_SHIFTLOCK
0 (keypad) KEY_KP0
1 (keypad) KEY_KP1
2 (keypad) KEY_KP2
3 (keypad) KEY_KP3
4 (keypad) KEY_KP4
5 (keypad) KEY_KP5
6 (keypad) KEY_KP6
7 (keypad) KEY_KP7
8 (keypad) KEY_KP8
9 (keypad) KEY_KP9
. (keypad dot) KEY_KPDOT
+ (keypad plus symbol) KEY_KPPLUS
- (keypad minus symbol) KEY_KPMINUS
Left arrow KEY_LEFT
Right arrow KEY_RIGHT
Up arrow KEY_UP
Down arrow KEY_DOWN
Home KEY_HOME
Insert KEY_INSERT
Delete KEY_DELETE
Page Up KEY_PAGEUP
Page Down KEY_PAGEDOWN