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.
Best Answer
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.