You are hereTech Projects / XWii / Documentation
Documentation
Building XWii from Source
Extract the source distribution (.tar.gz file) to some folder and run the commands:
make
./start_xwii.py
make compiles the source code of xwii into an
executable program (I distribute it as source because that way, people
on 64-bit architecture, etc. can use the same archive. I can also
include a version of wiiuse (the library xwii is based on) compiled for
the necessary platform this way. This requires the necessary BlueZ
bluetooth libraries to be available on your system.
start_xwii.py runs a python script that lets you
select one of the available profiles (a profile defines mappings of the
wii remote buttons, joysticks, etc. to mouse/keyboard input) for xwii
to use. This requires python to be installed on your system.
Creating Config Profiles
When you start XWii, the command takes this form:
xwii path/to/config/file.xwii
XWii config files are made up of BBCode style “tags” like this:
[a]KEYBOARD Return[/a]
The following is a list of supported tags:
Wii Remote tags
- [a] - the Wii Remote A button
- [b] - the Wii Remote B (trigger) button
- [up] - Up on the Wii Remote D-Pad
- [down] - Down on the Wii Remote D-Pad
- [left] - Left on the Wii Remote D-Pad
- [right] - Right on the Wii Remote D-Pad
- [plus] - “+” button on the Wii Remote
- [minus] - “-” button on the Wii Remote
- [home] - Home button on the Wii Remote
- [1] - 1 button on the Wii Remote
- [2] - 2 button on the Wii Remote
- [flick] - Triggered when any of the Wii Remote’s accelerometers registers a high G force (someone flicked the remote in the air)
- [acc_mouse] - if set to 1, the Wii Remote’s tilt sensors will control mouse movement.
-
[ir_mouse] - takes the form
[ir_mouse]WIDTHxHEIGHT[/ir_mouse] where WIDTH and HEIGHT are the screen
resolution being used (eg. “1280×1024″). Enables IR-Pointer mouse. - [led1] - set to 1 if you want LED 1 on the wiimote to be lit.
- [led2] - set to 1 if you want LED 2 on the wiimote to be lit.
- [led3] - set to 1 if you want LED 3 on the wiimote to be lit.
- [led4] - set to 1 if you want LED 4 on the wiimote to be lit.
- [tilt_left] - When the wiimote is tilted to the left.
- [tilt_right] - When the wiimote is tilted to the right.
- [tilt_forward] - When the wiimote is tilted forward.
- [tilt_back] - When the wiimote is tilted back.
Classic Controller tags:
- [cc_a] - The Classic Controller A button
- [cc_b] - The Classic Controller B button
- [cc_x] - The Classic Controller X button
- [cc_y] - The Classic Controller Y button
- [cc_plus] - The Classic Controller “+” button
- [cc_minus] - The Classic Controller “-” button
- [cc_home] - The Classic Controller Home button
- [cc_zl] - The Classic Controller left Z button
- [cc_zr] - The Classic Controller right Z button
- [cc_l] - The Classic Controller L shoulder button
- [cc_r] - The Classic Controller R shoulder button
- [cc_dpad_up] - Up on the Classic Controller D-Pad
- [cc_dpad_down] - Down on the Classic Controller D-Pad
- [cc_dpad_left] - Left on the Classic Controller D-Pad
- [cc_dpad_right] - Right on the Classic Controller D-Pad
- [cc_ls_up] - Up on the Classic Controller’s left thumbstick
- [cc_ls_down] - Down on the Classic Controller’s left thumbstick
- [cc_ls_left] - Left on the Classic Controller’s left thumbstick
- [cc_ls_right] - Right on the Classic Controller’s left thumbstick
- [cc_rs_up] - Up on the Classic Controller’s right thumbstick
- [cc_rs_down] - Down on the Classic Controller’s right thumbstick
- [cc_rs_left] - Left on the Classic Controller’s right thumbstick
- [cc_rs_right] - Right on the Classic Controller’s right thumbstick
Nun-Chuck Tags:
- [nc_stick_up] - Up on the Nunchuk control stick
- [nc_stick_down] - Down on the Nunchuk control stick
- [nc_stick_left] - Left on the Nunchuk control stick
- [nc_stick_right] - Right on the Nunchuk control stick
- [nc_c] - Nunchuk C button
- [nc_z] - Nunchuk Z button
- [nc_flick] - Event triggered when the Nunchuk accelerometers register a high Gforce (someone flicked the nunchuk in the air).
Guitar Hero 3 Controller Tags:
- [gtr_stick_up] - Up on the Guitar control stick
- [gtr_stick_down] - Down on the Guitar control stick
- [gtr_stick_left] - Left on the Guitar control stick
- [gtr_stick_right] - Right on the Guitar control stick
- [green] - green fret button
- [red] - red fret button
- [yellow] - yellow fret button
- [blue] - blue fret button
- [orange] - orange fret button
- [gtr_minus] - guitar minus button
- [gtr_plus] - guitar plus button
- [whammy] - triggered when you press down the whammy bar
General Tags:
- [title] - Set this profile’s title, no real use yet, but maybe later.
Usage:
All tags must have the opening and closing tag on the same line of
the file. This is because XWii reads the config file one line at a time.
Whatever is between the opening and closing tags is executed as a system command unless it is one of the following:
- KEYBOARD - maps this Wii button to the specified keyboard key(s)
- MOUSECLICK - maps this Wii button to a click of the specified mouse button
- SWITCHPROFILE - loads the config file specified
See the config files included in the “profiles” folder of the source
distribution for examples. The complete list of possible keyboard codes
is viewable in your /usr/include/X11/keysymdef.h.