924de508e73618a457f502af6d338f0b3ebe9a6b
[wiimote-pad] / README.md
1 # Wiimote-Pad
2
3 This is a small tool to use a Wiimote as a gamepad.
4
5 ## Introduction
6
7 Linux has had built-in support for the Wii Remote (Wiimote for short)
8 since v3.1, support which was significantly cleaned up and improved
9 since v3.11. However, the low-level kernel driver exposes each component
10 of the Wiimote (accelerator, buttons, IR camera), as well as each
11 extension, as a distinct device, none of which is (fully) functional as
12 a controller ‘out of the box’ (the ‘buttons’ device —which the driver
13 calls the controller ‘proper’— does appear as a joystick device to
14 Linux, since it has a BTN\_A mapping, but it's a device with no axes and
15 thus not really usable).
16
17 A higher level interface (built on top of the Linux driver) is provided
18 by [xwiimote][], which provides a library for ‘coalesced’ access to the
19 Wiimote and its extension. As programs need to be designed specifically
20 to make use of the library, this still doesn't allow an ‘out of the box’
21 experience.
22
23 The purpose of this tool is to allow any application to use a Wiimote
24 —held sideways— as if it were a standard gamepad, with a 2-axes joystick
25 (using the accelerometer), and a D-Pad.
26
27 ## Usage
28
29 Associate your Wiimote with your computer (details on how to do this are
30 not discussed here, but you may want to look at [xwiimote][]'s page for
31 additional information), then start the program. As long as the program
32 is running, a virtual controller (called “Nintendo Remote in gamepad
33 mode”) will be available. Just press Ctrl+C to terminate the program and
34 ‘disconnect’ the virtual controller.
35
36 Syntax:
37
38         wiimote-pad [device]
39
40 where _device_ is the path to a Linux-created device associated with the
41 Wiimote (e.g. `/dev/input/js0` or something like that). If no _device_
42 is specified, the program will look for the first device that it can
43 associate with and use that.
44
45 ### Note
46
47 `wiimote-pad` is _specifically_ designed to expose the sideways Wiimote
48 as a gamepad. All other Wiimote uses (especially the ones involving
49 the infrared (IR) sensor) are outside of its scope. Please refer to the
50 `xwiimote` and `xf86-input-wiimote` projects for those.
51
52 ## `udev` rules
53
54 This repository also provides a set of `udev` rules to:
55
56 * change the group and the permissions of all Wiimote-related devices
57   (both the kernel ones and the virtual one created by `wiimote-pad`);
58 * create descriptive symlinks for the event devices associated with
59   Wiimotes.
60
61 By default the group assigned to Wiimote devices is `bluetooth`, you
62 might need to tune it for your system. The group and permission change
63 is needed so that applications that use the event interface instead of
64 the joystick interface can still access the Wiimote.
65
66 ## Requirements
67
68 Dependencies for `wiimote-pad` are `libudev` and `libxwiimote`. The
69 latter should be version 2 or higher.
70
71 ## Compile
72
73 Just running
74
75         make
76
77 should work.
78
79 If you compiled and built `libxwiimote` yourself, you might
80 need to fix the include path in the `Makefile` to point to the correct
81 locations to look for the headers, or run
82
83         make XWIIMOTE=/path/to/xwiimote/sources
84
85 instead. By default, aside from standard locations, the `Makefile` will
86 look for an `xwiimote` source directory in the parent of the
87 `wiimote-pad` directory.
88
89 [xwiimote]: http://dvdhrm.github.io/xwiimote