Hi everyone!
This is my first HOWTO!
Sometimes I play different games on the emulator SNES9x and play on the keyboard is not very convenient. I remembered that I have a USB Gamepad (Logitech Dual Action â„¢ Gamepad).
http://www.logitech.com/en-us/gaming...rs/devices/288
So I decided to connect it ....
I heve OS:
First, Install X. Org joystick input driver:
Next, install uhidd (USB HID daemon). uhidd is a userland driver/daemon for USB HID devices like mouse, keyboard etc...
To start "uhidd" automatically, add the following lines to the file /etc/rc.conf
More info about "uhidd" you can read hear:
http://wiki.freebsd.org/uhidd
Connect gamepad and restart your computer.
When you start you can see something like this:
This is may gamepad! System has found it!
Now we add our device in /etc/X11/xorg.conf
Need to mapping the buttons and axis.
Explane:
"MapAxis1","MapAxis2" - POV control, cross of four buttons with the left. I assign to them the following keys from the keyboard: UP - w, DOWN - s, LEFT - a, RIGHT-d.
"MapAxis3","MapAxis4" - right analog sticks will work like mouse.
"MapAxis5","MapAxis6" - left analog sticks will work like ARROW up, down, left, right on the keyboard.
Four button whith the right will work like buttons of keyboard "1", "2", "3", "4".
Two buttons in the middle, it will be "space" and "enter".
Buttons LU y RU - "5", "6"
Buttons LD y RD - will be mouse click.
That's all... setting is finished!
Restart X.
For check the gamepad you can use "xev".
Now run the emulator Snes9x or the other, assign buttons and play!
Thank all!
This is my first HOWTO!
Sometimes I play different games on the emulator SNES9x and play on the keyboard is not very convenient. I remembered that I have a USB Gamepad (Logitech Dual Action â„¢ Gamepad).
http://www.logitech.com/en-us/gaming...rs/devices/288
So I decided to connect it ....
I heve OS:
Code:
FreeBSD 8.1-RELEASE
First, Install X. Org joystick input driver:
Code:
# pkg_add -r xf86-input-joystick
Next, install uhidd (USB HID daemon). uhidd is a userland driver/daemon for USB HID devices like mouse, keyboard etc...
Code:
# cd /usr/ports/sysutils/uhidd
# make install clean
To start "uhidd" automatically, add the following lines to the file /etc/rc.conf
Code:
uhidd_flags="-kmohs"
uhidd_enable="YES"
More info about "uhidd" you can read hear:
http://wiki.freebsd.org/uhidd
Connect gamepad and restart your computer.
When you start you can see something like this:
Code:
ugen1.2: <vendor 0x046d> at usbus1
uhid0: <vendor 0x046d product 0xc216, class 0/0, rev 1.10/3.00, addr 2> on usbus1
This is may gamepad! System has found it!
Now we add our device in /etc/X11/xorg.conf
Need to mapping the buttons and axis.
Explane:
"MapAxis1","MapAxis2" - POV control, cross of four buttons with the left. I assign to them the following keys from the keyboard: UP - w, DOWN - s, LEFT - a, RIGHT-d.
"MapAxis3","MapAxis4" - right analog sticks will work like mouse.
"MapAxis5","MapAxis6" - left analog sticks will work like ARROW up, down, left, right on the keyboard.
Four button whith the right will work like buttons of keyboard "1", "2", "3", "4".
Two buttons in the middle, it will be "space" and "enter".
Buttons LU y RU - "5", "6"
Buttons LD y RD - will be mouse click.
Code:
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
# Add Gamepad
[B]InputDevice "Logitech" "SendCoreEvents"[/B]
EndSection
Section "InputDevice"
Identifier "Logitech"
Option "Vendor" "Logitech"
Driver "joystick"
Option "Path" "/dev/uhid0"
Option "Device" "/dev/uhid0"
Option "DebugLevel" "99"
# Right Buttons
# Button w(Up)/s(Down)
# Button a(Left)/s(Right)
Option "MapAxis1" "mode=accelerated keylow=38 keyhigh=40"
Option "MapAxis2" "mode=accelerated keylow=25 keyhigh=39"
# Right joystick: Like mouse
Option "MapAxis3" "mode=relative axis=+1x deadzone=5000"
Option "MapAxis4" "mode=relative axis=+1y deadzone=5000"
# Left joystick:
# axis X - Left/Right
# axis Y - Up/Down
Option "MapAxis5" "mode=relative deadzone=28000 keylow=100 keyhigh=102 axis=0.15key"
Option "MapAxis6" "mode=relative deadzone=28000 keylow=98 keyhigh=104 axis=0.15key"
#
Option "MapButton1" "key=10"
Option "MapButton2" "key=11"
Option "MapButton3" "key=12"
Option "MapButton4" "key=13"
Option "MapButton5" "key=14"
Option "MapButton6" "key=15"
# mouse button: left
Option "MapButton7" "button=1"
# mouse button: right
Option "MapButton8" "button=3"
# button "Space"
Option "MapButton9" "key=65"
# button "Enter"
Option "MapButton10" "key=36"
EndSection
That's all... setting is finished!
Restart X.
For check the gamepad you can use "xev".
Now run the emulator Snes9x or the other, assign buttons and play!
Thank all!
Code: