Freitag, 22. Juli 2011

How to play Minecraft with a Sixaxis Controller on Ubuntu

Follow this tutorial and you will be able to play games like Minecraft with the Sixaxis Controller.

Minecraft mit einem Playstation 3 Controller auf Ubuntu

Wenn diese Anleitung befolgt wurde, ist es ganz einfach QJoypad für ein Spiel, wie zum Beispiel Minecraft, zu konfigurieren. Wie das geht zeig ich euch in diesem Video:

How to set up a Sixaxis Controller with QJoypad in Ubuntu

Dualshock 3 Controller with a mini-USB-cable

We are going to connect the Controller via USB, so you make sure your Sixaxis Controller is plugged in with a mini-USB-cable.

First of all we install the joystick Package via
sudo apt-get install joystick
In order to make sure Ubuntu is able to read the Controller input execute
cat /dev/input/js0
Now move the sticks or press some buttons on the Controller. The text output (which is the raw controller data) in your terminal should change.
Qt's logo
QJoyPad, our Linux Xpadder or joy2key equivalent, is based on the Qt framework so we will have to install it as well.
sudo apt-get install libqt4-core  libqt4-dev qt4-dev-tools qt4-designer  qt4-doc
We will also need these packages
sudo apt-get install libxtst6 libxtst-dev


Now comes the more complicated part: Download QJoyPad. Open up a Terminal an execute the following commands in order to extract the source.
cd ~/Downloads
tar xzf qjoypad-4.1.0.tar.gz
compile the source:
cd cd qjoypad-4.1.0/src/
./config
make
sudo make install

QJoyPad will start minimized in the system tray, but Natty doesn't allow every application to show up in the system tray. We will change these settings; execute:
gsettings set com.canonical.Unity.Panel systray-whitelist "['all']"
After logging out and in again or simply restarting unity you will be able to execute qjoypad. Now you can take input from the controller translate it into key strokes or mouse actions. The UI should be self explanatory ;)


Donnerstag, 21. Juli 2011

Sixaxis / Dualshock 3 Controller mit Ubuntu und QJoyPad benutzen

Nachdem ich hier und hier erklärt habe, wie man seinen Wiimote mit Ubuntu verbinden und benutzen kann, möchte ich in diesem Beitrag erklären, wie man seinen Dualshock 3 bzw. Sixaxis Controller von der Playstation 3 auch am Ubuntu-PC benutzen kann.
Dualshock 3 Controller mit Mini-USB-Kabel

Nachdem man den PS3-Controller per Mini-USB-Kabel mit dem PC verbunden hat und das Paket joystick installiert hat:
sudo apt-get install joystick
überprüft man ob die Verbindung funktioniert. Dazu führt man den Befehl
cat /dev/input/js0
aus und drückt einige Tasten oder bewegt die Analog-Sticks des Controllers. Verändert sich die Ausgabe im Terminal, kann der PC die Eingaben des Controllers lesen.
Das Logo von Qt
Das Programm QJoyPad, das nachher die Controllereingaben zu Maus-, bzw Keyboardeingaben umwandelt basiert auf der Qt-Bibliothek. Falls noch nicht geschehen, installiert man Qt mit:
sudo apt-get install libqt4-core  libqt4-dev qt4-dev-tools qt4-designer  qt4-doc
Außerdem werden die X11-Bibliotheken von libxtst benötigt.
sudo apt-get install libxtst6 libxtst-dev


Jetzt kann man QJoyPad herunterladen. Nach dem Download wechselt man im Terminal ins Download-Verzeichnis und entpackt den Quellcode:
cd ~/Downloads
tar xzf qjoypad-4.1.0.tar.gz
Nun kompiliert man den Quellcode:
cd cd qjoypad-4.1.0/src/
./config
make
sudo make install

Da QJoyPad im Tray minimiert startet muss man den Unity-System-Tray so einstellen, dass er alle Tray-Icons erlaubt. Das geschieht mittels:
gsettings set com.canonical.Unity.Panel systray-whitelist "['all']"
Wenn man sich jetzt einmal aus und wieder einloggt (oder Unity neustartet) kann man das Programm qjoypad ausführen. Und die Tasten des Controllers mit Tastatur oder Mauseingaben verknüpfen.