WiimoteUserlandDriver is a lightweight macOS utility that allows a Nintendo Wiimote to be used as a standard input device for applications outside the Dolphin emulator. It operates entirely in user space using the macOS HID system, leveraging IOHIDManager to read input reports from the Wiimote and optionally translate them into keyboard events.
The driver works in tandem with tools like WiimotePair, which handle Bluetooth pairing and ensure the Wiimote remains connected and remembered by macOS. Once paired, WiimoteUserlandDriver reads the raw HID reports and reconstructs button states, including combined button presses and releases, allowing applications to respond to the Wiimote as if it were a standard game controller or keyboard.
- HID-Based Input: Uses IOHIDManager to access the Wiimote in its HID mode without requiring low-level Bluetooth manipulation.
- Full Button Support: Reads all standard Wiimote buttons, including D-Pad, A/B, 1/2, -, +, and HOME.
- Combination Detection: Correctly interprets multiple buttons pressed simultaneously and generates corresponding events.
- Keyboard Emulation: Can map Wiimote buttons to macOS keyboard keycodes for compatibility with games or applications that accept keyboard input.
- User-Space Operation: No kernel extensions or special drivers required; fully compatible with modern macOS versions.
- Pair the Wiimote using a tool like WiimotePair to ensure macOS recognizes it via Bluetooth.
- Compile the driver (or download from Releases):
clang wii.m -framework Foundation -framework IOKit -framework ApplicationServices -o wii
- Run the driver (you may also try double clicking but macOS is picky as hell):
./wii
- Interact: Press buttons on the Wiimote. Button presses will be translated into macOS keyboard events.
- Input Handling: Accumulates pairs of HID values from the Wiimote to reconstruct the state of buttons. Zero values are treated as releases.
- Event Translation: Button states are compared against the previous state to detect presses, releases, and combinations. These are then converted to console output or keyboard events.
- Mapping: Each Wiimote button is mapped to a corresponding macOS keycode for keyboard emulation.
- Certain buttons like -, +, and HOME may not combine with others due to hardware limitations; this is normal behavior.
- The driver does not attempt to modify the Wiimote’s LED state or other advanced features unless extended to send HID feature reports.
- Still needs to improve polling and long press.
This project is open-source and may be freely used or modified.