Missing sys/stat.h header
[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.
25
26 ## Usage
27
28 Associate your Wiimote with your computer (details on how to do this are
29 not discussed here, but you may want to look at [xwiimote][]'s page for
30 additional information), then start the program. As long as the program
31 is running, a virtual controller (called “Nintendo Remote in gamepad
32 mode”) will be available. Just press Ctrl+C to terminate the program and
33 ‘disconnect’ the virtual controller.
34
35 Syntax:
36
37         wiimote-pad [device]
38
39 where _device_ is the path to a Linux-created device associated with the
40 Wiimote (e.g. `/dev/input/js0` or something like that). If no _device_
41 is specified, the program will look for the first device that it can
42 associate with and use that.
43
44 ### Note
45
46 `wiimote-pad` is _specifically_ designed to expose the sideways Wiimote
47 as a gamepad. All other Wiimote uses (especially the ones involving
48 the infrared (IR) sensor) are outside of its scope. Please refer to the
49 `xwiimote` and `xf86-input-wiimote` projects for those.
50
51 ## `udev` rules
52
53 This repository also provides a set of `udev` rules to:
54
55 * change the group and the permissions of all Wiimote-related devices
56   (both the kernel ones and the virtual one created by `wiimote-pad`);
57 * create descriptive symlinks for the event devices associated with
58   Wiimotes.
59
60 By default the group assigned to Wiimote devices is `bluetooth`, you
61 might need to tune it for your system. The group and permission change
62 is needed so that applications that use the event interface instead of
63 the joystick interface can still access the Wiimote.
64
65 ## Requirements
66
67 Dependencies for `wiimote-pad` are `libudev` and `libxwiimote`. The
68 latter should be version 2 or higher.
69
70 ## Compile
71
72 Just running
73
74         make
75
76 should work.
77
78 If you compiled and built `libxwiimote` yourself, you might
79 need to fix the include path in the `Makefile` to point to the correct
80 locations to look for the headers, or run
81
82         make XWIIMOTE=/path/to/xwiimote/sources
83
84 instead. By default, aside from standard locations, the `Makefile` will
85 look for an `xwiimote` source directory in the parent of the
86 `wiimote-pad` directory.
87
88 [xwiimote]: http://dvdhrm.github.io/xwiimote