= wiipresent(1)
Dag Wieers <dag@wieers.com>
v0.7, August 2009


== NAME
wiipresent - tool to control applications using a Nintendo wiimote


== SYNOPSIS
wiipresent [options]...


== DESCRIPTION
wiipresent is a tool to control applications using the wiimote. It was
originally developed for using the wiimote to give presentations using
openoffice or xpdf, but is now turned into a tool to control your mouse
and/or other applications.


== OPTIONS
-b bt-address, --bluetooth=bt-address::
    Wiimote bluetooth addresses (use hcitool scan to find yours)

-d name, --display=name::
    X display to use

-i, --infrared::
    use infrared sensor to move mouse pointer (NOT IMPLEMENTED)

-l length, --length=minutes::
    presentation length in minutes

-r, --reconnect::
    on disconnect, wait for reconnect

-t, --tilt::
    use tilt sensors to move mouse pointer

-h, --help::
    display this help and exit

-v, --verbose::
    increase verbosity

--version::
    output version information and exit


== USAGE
You can simply start +wiipresent+ and it will scan for nearby wiimotes.

In case you want to force a specific wiimote, you need to know the bluetooth
address of the wiimote you want to use. You can scan your bluetooth viscinity
by using hcitool like:
----
hcitool scan
----

after having pressed the 1 and 2 keys on your wiimote once. You will then see
something like:
----
[root@moria ~]# hcitool scan
Scanning ...
00:21:64:EF:62:F5       Nokia E71
00:1B:7A:F8:B5:64       Nintendo RVL-CNT-01
----

Then start wiipresent using the following syntax:
----
[dag@moria ~]# wiipresent -b 00:1B:7A:F8:B5:64
Please press 1+2 on the wiimote with address 00:1B:7A:F8:B5:64...
Battery level now is 81%.
----

You can also provide more than one bluetooth address if you have more than one
wiimote and it will then limit itself to one from the list.


== KEY MAPPINGS
When you press a button on your Nintendo Wiimote, WiiPresent sends a Key event
to the application that has the focus. Depending on the application, the
buttons have a different meaning even though there is some consistency to what
happens.

Currently the key mappings for each application is hard-coded in the
wiipresent tool, but in the future we plan to make this dynamically
configurable so you have more control over the behaviour of your wiimote
for your favorite applications.

Since we have a limited number of buttons on a Ninendo Wiimote we are limited
in functionality we can map to the application, however to overcome this
limitation combinations of keys have a special meaning.

When you press any button, you are using NORMAL mode. If you keep the B
button pressed together with other buttons, you are in WINDOW mode. If you
press button B and button A together you toggle between MOUSE mode and
NORMAL mode.


== NORMAL MODE
The following keys are mapped in NORMAL mode, depending on the application
that has the focus this may vary.

Left/Right buttons::
    change slide, change channel, change tab

Up/Down buttons::
    change volume, change links

'-'/'+' buttons::
    change volume, zoom out/in

'A' button::
    toggle play/pause, change source

'1' button::
    toggle fullscreen

'2' button::
    change aspect ratio

'home' button::
    go back, home key

'exit' button::
    exit wiipresent (not implemented yet due to libwiimote bug)


== WINDOW MODE
The following keys are mapped in WINDOW mode, depending on the application
that has the focus this may vary. *The B button is pressed together with the
buttons below.*

Up/Down buttons::
    scroll up/down, page up/down

Left/Right buttons::
    switch between applications (window manager)

'-'/'+' buttons::
    change workspace

'A' button::
    toggle MOUSE mode

'2' button::
    blank screen, mute audio (censor info)


== MOUSE MODE
The following keys are mapped in MOUSE mode, depending on the application
that has the focus this may vary. *MOUSE mode is toggled by pressing the 'A'
button and 'B' button at the same time.*

Up/Down buttons::
    scroll up/down

Left/Right buttons::
    switch between applications

'-'/'+' buttons::
    left/right mouse buttons

'A' button::
    leave mouse button


== BUGS
This program is free of bugs. Yeah right.

If you have improvements or bugreports, please send them to:
mailto:dag@wieers.com[]

[NOTE]
Please see the TODO file for known bugs and future plans.


== SEE ALSO
    hcitool(1)


== HISTORY
The idea of using the wiimote for giving presentations was devised at LinuxTag
2008 in Berlin and a basic hack (based on WMD) was showcased at LinuxTag the
second day at the CentOS booth. It included infrared mouse support and was
written by Dag Wieers.

Because we need deadlines for getting anything done, we instantly submitted a
paper for FrOSCon 2008 that was selected. And a second hack written in C
(using cwiid) implemented tilt mouse support and timely rumbles was showcased
at FrOSCon and was written by Geerd-Dietger Hoffman.

At FOSDEM 2009 the current version was written from scratch at the CentOS
booth (in C using libwiimote) and demonstrated before a live audience. Nobody
(that we know of) was injured during this demonstration.


== AUTHOR
Written by Dag Wieers mailto:dag@wieers.com[]

Homepage at http://dag.wieers.com/home-made/wiipresent/[]
