As per the title, could someone please give me some assistance in figuring out how i can use a gamepad with picore player please?
I would like to hack the gamepad for its analogue joystick input functions.
Many thanks
Results 1 to 3 of 3
-
2022-04-08, 06:03 #1
- Join Date
- Apr 2022
- Posts
- 10
Using a USB Gamepad with Picoreplayer
-
2022-04-09, 06:39 #2
See this post for details on downloading the evtest tool.
Here's the output from a Logitech controller.
Code:tc@rpi27:/mnt/mmcblk0p2/tce$ ./evtest No device specified, trying to scan all of /dev/input/event* Not running as root, no devices may be available. Available devices: /dev/input/event0: FT5406 memory based driver /dev/input/event1: Logitech Logitech Dual Action Select the device event number [0-1]: 1 Input driver version is 1.0.1 Input device ID: bus 0x3 vendor 0x46d product 0xc216 version 0x111 Input device name: "Logitech Logitech Dual Action" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 288 (BTN_TRIGGER) Event code 289 (BTN_THUMB) Event code 290 (BTN_THUMB2) Event code 291 (BTN_TOP) Event code 292 (BTN_TOP2) Event code 293 (BTN_PINKIE) Event code 294 (BTN_BASE) Event code 295 (BTN_BASE2) Event code 296 (BTN_BASE3) Event code 297 (BTN_BASE4) Event code 298 (BTN_BASE5) Event code 299 (BTN_BASE6) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 127 Min 0 Max 255 Flat 15 Event code 1 (ABS_Y) Value 127 Min 0 Max 255 Flat 15 Event code 2 (ABS_Z) Value 128 Min 0 Max 255 Flat 15 Event code 5 (ABS_RZ) Value 127 Min 0 Max 255 Flat 15 Event code 16 (ABS_HAT0X) Value 0 Min -1 Max 1 Event code 17 (ABS_HAT0Y) Value 0 Min -1 Max 1 Event type 4 (EV_MSC) Event code 4 (MSC_SCAN)
Load the evdev kernel module
Code:tc@rpi27:~$ sudo modprobe evdev
Code:tc@rpi27:/mnt/mmcblk0p2/tce$ cat /proc/bus/input/devices I: Bus=0003 Vendor=046d Product=c216 Version=0111 N: Name="Logitech Logitech Dual Action" P: Phys=usb-3f980000.usb-1.4/input0 S: Sysfs=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:046D:C216.0001/input/input2 U: Uniq=F7FA2D56 H: Handlers=event1 js0 B: PROP=0 B: EV=1b B: KEY=fff 0 0 0 0 0 0 0 0 0 B: ABS=30027 B: MSC=10
sudo /usr/local/sbin/inputlircd -n "Logitech Logitech Dual Action" -m 0 -g -r 500 -f
And in another ssh connect run irw which returns.
tc@rpi27:~$ irw
Code:120 0 BTN_JOYSTICK /dev/input/event1 121 0 BTN_THUMB /dev/input/event1 123 0 BTN_TOP /dev/input/event1 122 0 BTN_THUMB2 /dev/input/event1
For example:
Code:$ cat /home/tc/inputlircd.keymap BTN_TOP = KEY_UP BTN_THUMB = KEY_DOWN BTN_JOYSTICK = KEY_LEFT BTN_THUMB2 = KEY_RIGHT
sudo /usr/local/sbin/inputlircd -n "Logitech Logitech Dual Action" -m 0 -g -r 500 -t /home/tc/inputlircd.keymap -f
Press ctrl-c in the irw session and restart irw and you should get the remapped keys.
Code:tc@rpi27:~$ irw 121 0 KEY_DOWN /dev/input/event1 123 0 KEY_UP /dev/input/event1 122 0 KEY_RIGHT /dev/input/event1 120 0 KEY_LEFT /dev/input/event1
Last edited by ralphy; 2022-04-09 at 06:54.
Ralphy
1-Touch, 5-Classics, 3-Booms, 2-UE Radio
Squeezebox client builds donations always appreciated.
-
2022-06-14, 13:23 #3
- Join Date
- Apr 2022
- Posts
- 10
Hi @ralphy Sorry for my delay in responding,thank you for your very comprehensive response.