How to use a Nintendo Wiimote with Elisa
This guide will show how to get the Nintendo Wii Remote working with Elisa.
Hardware needed:
Nintendo Wii Remote (also called "Free hand controller" or "Wiimote") [http://en.wikipedia.org/wiki/Wiimote#Controller]
- GNU/Linux compatible bluetooth controller
Software needed:
- GNU/Linux operating system
- Elisa
wminput [http://www.wiili.org/index.php/Wminput]
General info
The Nintendo Wii Remote is a controller for the Nintendo Wii [http://en.wikipedia.org/wiki/Wii] console. Because the Wiimote communicates with the Nintendo Wii trough bluetooth, some hackers managed to write software that made possible the use of the Wiimote with the GNU/Linux operating system. Wminput allows us to assign a keyboard key to each Wiiremote button.
Wminput installation
To install Wminput in Ubuntu Gutsy, we need to activate the universe repository in the file /etc/apt/sources.list This is the line that should be included in the /etc/apt/sources.list:
deb http://archive.ubuntu.com/ubuntu/ gutsy universe
then the following commands must be run:
sudo apt-get update sudo apt-get install wminput
Wminput configuration file
Now we need to create a configuration file for wminput. The file contains info on how the keys of the wiimote are mapped. We start creating the directory /opt/etc/wiimote running:
sudo mkdir -p /opt/etc/wiimote
Then we can create the wminput-elisa file inside the /opt/etc/wiimote directory. The following is the content of the file:
# This is the /opt/etc/wiimote/wminput-elisa file Wiimote.A = KEY_ENTER Wiimote.B = KEY_SPACE Wiimote.Up = KEY_UP Wiimote.Down = KEY_DOWN Wiimote.Left = KEY_LEFT Wiimote.Right = KEY_RIGHT Wiimote.Minus = KEY_UP Wiimote.Plus = KEY_DOWN Wiimote.Home = KEY_F23 Wiimote.1 = KEY_SPACE #Wiimote.2 = KEY_Q
Start/Stop Elisa
The last thing we need is a script that starts Elisa, if Elisa isn't running, and stops Elisa, if it's running. We start by creating the directory /opt/bin using the following command:
sudo mkdir -p /opt/bin
In the /opt/bin directory we should create a file called elisa-mmplayer containing the following lines:
# This is the /opt/bin/elisa-mmplayer file if pidof -x elisa; then killall elisa; else elisa; fi
Thanks to twi_ from the #elisa irc channel for the script.
The last thing to do, is to mark the /opt/bin/elisa-mmplayer file as executable running the following command:
sudo chmod ugo+x /opt/bin/elisa-mmplayer
Configure Gnome
We can now run wminput providing the configuration file we have created before with this command:
wminput -w -c /opt/etc/wiimote/wminput-elisa
For the above command, we might need to run it using sudo in this way:
sudo wminput -w -c /opt/etc/wiimote/wminput-elisa
At this point we should press the buttons 1 and 2 (at the same time) on the Wiimote, and wminput should connect to it. We now need to configure Gnome, so Elisa can be launched using the Wiimote. Fist we need to open System->Preferences->Keyboard Shoutcuts and find the Multimedia Player, then click on the shourtcut key, and press the home key on the Wiimote. We now should be able to open Rhythmbox (with a default Gnome configuration) using the home key of the Wiimote. Next thing is to open System->Preferences->Preferred Applications, select the Multimedia tab, and select Custum from the selectable items. In the Command area, we need to insert /opt/bin/elisa-mmplayer.
Now, pressing the home key on the Wiimote, we should be able to start Elisa (if it isn't running), and stop Elisa (if it's running). The Wiimote can also be used to navigate inside the Elisa interface.
