Since Halloween, I have been really enjoying Frictional Games' Amnesia on Ubuntu. My next goal is to get the other offerings they have.
Unfortunately, there is not a gamepad setting for this game (and many others out there). I know there is software like rejoystick that allows the mapping of keyboard keys to a gamepad. However, since this game incorporates the mouse, is there a solution to map both over?
Thanks in advance.
Update: I have found on playdeb.net QJoypad. It allows the mapping of both keyboard and mouse. Unfortunately, I still seem to have trouble with the mouse when entering Amnesia.
Following Grumbel's answer, I tried xboxdrv solution with the support of his link and specially this page:
1. Install xboxdrv 0.8.2 from Ubuntu Software Center.
Install also uinput and joydev if needed. I did it this way
sudo modprobe uinput
+sudo modprobe joydev
2. Need to know the event of the gamepad:
Launch
udevadm monitor --udev
and then plug the game pad :I conclude that my gamepad's event is /dev/input/event8
3. Display names of every keys, axis, buttons of the gamepad.
The idea is to launch
xboxdrv
and test every buttons and note the result on paper.In my case the result is:
4. Set the config file
Create a xboxdrv-mouse.ini file to set X Y axis and left and right mouse button.
Here I set gamepad buttons 2 for left mouse button and 3 for right mouse button:
Note that value for REl_X and REL_Y seems to define the speed of the mouse, and by defining a negative value it invert the axis (see here for REL_Y)
An other example with more button definition
5. Launch it
To avoid launching it with
sudo
, create a udev rule.CONCLUSION
It works fine, it's the best solution for me.
The solution is QJoyPad. As I stated in my update on the question, it does allow the mapping of both keyboard and mouse.
Amnesia is a little bit of an oddball in the configuration because the game uses, according to their forum, relative mouse movements. The solution is launch the game via a terminal after typing in
export SDL_VIDEO_X11_DGAMOUSE=0
. After doing so, my test with the mouse worked fine.By the way, the controller I am using with QJoyPad is a Logitech Dual Action.
To map a gamepad to mouse, try js2mouse.
In Ubuntu 11.10, qjoypad doesn't seem to work properly, because a left-click on its icon in the notification area triggers a right-click menu with no way to access setup. You can, however, use Rejoystick (also available in PlayDeb). The first time you run it (running
rejoystick
) you assign keys to your gamepad's buttons, then save. Next you runrejoystick -d
and you won't get a GUI, rejoystick is running in the background and will use your gamepad's buttons for the assigned keys.I would definitely recommend AntiMicro, which picks up from where the discontinued QJoyPad left off. I'm using it right now to play Civ V from my couch and am loving every minute of it. It was easy to setup and use (and yes, it lets you map both keyboard as well as mouse --- including left/right wheel scrolling).