Section 1 - Building Xwii

1.1 Build Essentials
1.2 Terminal Commands for Build Essentials (Debian and Derivatives)
1.3 Build Xwii



Section 2 - Running Xwii

2.1 Run Xwii from the terminal
2.2 Run Xwii using the Xwii.py file



Section 3 - Profiles (or, making the wiimote do stuff)

3.1 Tag list for Wiimote buttons
3.2 Tag list for Wiimote properties
3.3 Classic controller tags
3.4 Nunchuck tags
3.5 Guitar hero guitar tags
3.6 General tags



Section 4 - Tag Usage

4.1 How to use tags
4.2 Technical notes on using tags




------------------------------------------------------------

Section 1 - Building Xwii:

------------------------------------------------------------

1.1 Build Essentials


Here are a list of all dependencies needed for Ubuntu from a cold install:

libbluetooth-dev

libxtst-dev

freeglut3-dev

cl-sdl-opengl

build-essential


------------------------------------------------------------

1.2 Terminal Commands for Build Essentials (Debian & Derivatives)


To make it a little easier, Xwii needs these terminal commands to build:

sudo apt-get install libbluetooth-dev

sudo apt-get install libxtst-dev

sudo apt-get install freeglut3-dev

sudo apt-get install cl-sdl-opengl

sudo apt-get install build-essential

------------------------------------------------------------

1.3 Build Xwii

After these steps are complete, open a terminal and go to the directory that you placed xwii in, then type:

make



------------------------------------------------------------

Section 2 - Running Xwii

------------------------------------------------------------

2.1 Run Xwii using the terminal


When you start XWii, the command takes this form:

xwii path/to/config/file.xwii


------------------------------------------------------------

2.2 Run Xwii using the xwii.py file


Double click start_xwii.py (Located in the folder that you built Xwii in)
Click "Run in Terminal"


------------------------------------------------------------

Section 3 - Profiles (or, making the wiimote do stuff)

------------------------------------------------------------

3.1 Tag list for Wiimote buttons


XWii config files are made up of BBCode style “tags” like this:
[a]KEYBOARD Return[/a]

Note: For a list of examples, skip this section and head to Usage: Examples:

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. Tilt it up and the mouse moves up, down and the mouse moves down. Rotate to either side and the mouse moves left or right.
    * [ir_mouse] - takes the form [ir_mouse]WIDTHxHEIGHT[/ir_mouse] where WIDTH and HEIGHT are the screen resolution being used (eg. “[ir_mouse]1280×1024[/ir_mouse]″). Enables IR-Pointer mouse.
    * [ir_game] - takes the form [ir_game]WIDTHxHEIGHT[/ir_game] where WIDTH and HEIGHT are the screen resolution being used (eg. “[ir_game]1280×1024[/ir_game]″). Enables IR-game mouse. The game mouse is different than the IR mouse in that there is a dead zone created in the center of the screen so that when playing an FPS, if you focus the Wiimote toward the center of the screen, the motion will stop in the center. This makes it easier to target in FPS.
    * [acc_wheel] - If set to 1, the Wii Remote's tilt sensors will control the mouse movement. Tilt it up and the mouse moves left, tilt it down and the mouse moves right. Rotate to either side to move up or down.
    * [acc_analog] - Makes the wiimote's accelerometer control the mouse pointer like an analog joystick. Set like the IR mouse, for example [acc_analog]1024x768[/acc_analog]. This is useful for some games and flight sims that use the mouse to control movement.
    * [acc_analog_wheel] - Makes the wiimote's accelerometer control the mouse pointer like an analog wheel. Set like the IR mouse, for example [acc_analog]1024x768[/acc_analog]. This is useful for some games and flight sims that use the mouse to control movement.
    * [dpad_mouse] - Sets the dpad on the wiimote to control the mouse
    * [dpad_sensitivity] - Sets the mouse sensitivity for the dpad.
    * [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.
    * [flick_up] - When the wiimote is raised quickly in the air.
    * [flick_down] - When the wiimote is dropped to the ground quickly.
    * [flick_left] - When the wiimote is quickly moved to the left.
    * [flick_right] - When the wiimote is quickly moved to the right.
    * [flick_forward] - When the wiimote is moved quickly moved forward.
    * [flick_back] - When the wiimote is quickly moved backward.


------------------------------------------------------------

3.2 Tag list for Wiimote properties


These tags have to do with other properties of the Wii Remote:

    * [stick_sensitivity] - Sets the sensitivity of the nunchuck stick.
    * [acc_sensitivity] - Sets the sensitivity of the accelerometer. Lower is more sensitive, except for the analog mouse wheel. In that case higher is better.
    * [roll_threshold] - Sets the number of degrees that the wiimote has to be turned on it's side before it registers an event. (Values between 0 and 180 work best here)
    * [pitch_threshold] - Sets the number of degrees that the wiimote has to be turned up or down before it registers an event. (Values between 0 and 180 work best here)
    * [flick_threshold] - Sets the amount of g-force required to trigger a flick event.
    * [ir_shake] - The degree of tracking accuracy of the IR remote. If the tracking value is higher, the shakiness will be reduced, but the motion will be less smooth
    * [ir_deadzone_x] - For the IR_GAME setting, this the factor the X deadzone is divided by. Higher equals a smaller deadzone. Setting it to 1 would make the entire X plane a deadzone. Setting it to 2 would make half the plane a deadzone. 3 = 1/3. 15 (1/15th) is the default.
    * [ir_deadzone_y] - For the IR_GAME setting, this the factor the Y deadzone is divided by. Higher equals a smaller deadzone. Setting it to 1 would make the entire Y plane a deadzone. Setting it to 2 would make half the plane a deadzone. 3 = 1/3. 15 (1/15th) is the default.
    * [ir_game_x_offset] - For some strange reason, the center of the screen X value is off in some (all?) games so it needs to be moved with this. For example, in Savage 2, I found that setting it to about 20 will make the screen center.


------------------------------------------------------------

3.3 Classic controller tags


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


------------------------------------------------------------

3.4 Nunchuck tags


Nunchuck 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).
    * [nc_mouse] - Set the nunchuck joystick as a mouse.


------------------------------------------------------------

3.5 Guitar hero guitar tags


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


------------------------------------------------------------

3.6 General tags

General Tags:

    * [title] - Set this profile’s title, no real use yet, but maybe later.
    * [scan_time] - Sets the amount of seconds between scans for a Wii Remote (The program only scans if no Wii Remote is connected).


------------------------------------------------------------

Section 4 - Tag Usage

------------------------------------------------------------

4.1 How to use tags


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.

Examples:

[dpad_mouse]1[/dpad_mouse]	# Turns on the Wiimote Direction Pad mouse.
[a]KEYBOARD a[/a]			# Sets keyboard key lowercase 'a' to the button 'A' on the wiimote.
[b]MOUSECLICK 1[/b]			# Sets the left mouse click to the button 'B' on the wiimote.
[up]KEYBOARD Up[/up]		# Sets keyboard up arrow key to the button 'up' on the wiimote.
[1]KEYBOARD 1[/1]			# Sets keyboard key number '1' to the button '1' on the wiimote.
[2]KEYBOARD KP_2[/2]		# Sets keyboard number pad key '2' to the button '2' on the wiimote.

See the config files included in the “profiles” folder of the source distribution for further examples.


* See Xwii_Keymappings for specific key codes.

OR

* The complete list of possible keyboard codes is viewable in your /usr/include/X11/keysymdef.h.


------------------------------------------------------------

4.2 Technical notes on using tags


Note: 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

