Mapping certain keys from Atari800 emu to the gamepad
-
Very keen. I want to look at the various key-mapping options for Linux to get the full lay of the land and this will give me a big leg up for Joymap. Thanks.
-
Pretty late on this topic, but i've finally got my imputs throught the key logger from your guide and this is what I have for my third party PS3 controller (first of all, i'm very sorry for the weird posting on my imputs, i dunno how to use the forum pretty well) :
DPADOWN ABS_HAT0Y DPADRIGHT ABS_HAT0X DPADLEFT ABS_HAT0X B/X BTN_EAST A/CIRCLE BTN_C Y/SQUARE BTN_SOUTH X/TRIANGLE BTN_NORTH L1 BTN_WEST L2 BTN_TL R1 BTN_Z R2 BTN_TR SELECT BTN_TL2 START BTN_TR2 HOME BTN_MODE LEFT STICK UP ABS_Y DWN ABS_Y RIGHT ABS_X LEFT ABS_X L3 BTN_SELECT RIGHT STICK UP ABS_RZ DWN ABS_RZ RIGHT ABS_Z LEFT ABS_Z R3 BTN_START~~~~ So then after reading the solution you provided, I tried this: --evdev /dev/input/by-id/3 \ --silent \ --axismap -Y1=Y1,-Y2=Y2 \ --buttonmap tl^toggle=tl \ --buttonmap tr^toggle=tr \ --detach-kernel-driver \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --mimic-xpad \ --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_X=x2,ABS_Y=y2,ABS_*=lt,ABS_*=rt,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \ --evdev-keymap BTN_EAST=a,BTN_C=b,BTN_SOUTH=x,BTN_NORTH=y,BTN_WEST=lb,BTN_Z=rb,BTN_TL=tl,BTN_TR=tr,BTN_MODE=guide,BTN_TL2=back,BTN_TR2=start --ui-axismap X1=KEY_KP4:KEY_KP6,Y1=KEY_KP8:KEY_KP5 \ --ui-axismap X2=KEY_1:KEY_2,Y2=KEY_3:KEY_4,lt+X2=KEY_5:KEY_6,lt+Y2=KEY_7:KEY_8,rt+X2=KEY_9:KEY_0,rt+Y2=KEY_KPASTERISK:KEY_EQUAL \ --ui-buttonmap a=KEY_RIGHTCTRL,b=KEY_F2,x=KEY_EQUAL,y=KEY_KPASTERISK,lb=KEY_F9,rb=KEY_F5,du=KEY_KP8,dd=KEY_KP5,dl=KEY_KP4,dr=KEY_KP6,start=KEY_F4,back=KEY_F3,lt=KEY_HOME,rt=KEY_HOME,tl=KEY_HOME,tr=KEY_HOME \ --ui-buttonmap lt+a=KEY_ENTER,lt+b=KEY_ESC,lt+du=KEY_UP,lt+dd=KEY_DOWN,lt+dl=KEY_LEFT,lt+dr=KEY_RIGHT,lt+start=KEY_F1 \ --ui-axismap lt+X1=KEY_LEFT:KEY_RIGHT,lt+Y1=KEY_UP:KEY_DOWN \ --ui-axismap tl+x1=REL_X:10,tl+y1=REL_Y:10 \ --ui-buttonmap tr+b=BTN_LEFT,tr+a=BTN_RIGHT \ --ui-buttonmap guide=void then, how do I paste this and where exactly? i really got lost in the guide since Linux coding is a new thing for me. I tried using Putty to paste these mappings with the "sudo nano `/etc/rc.local`" but then I get lost on what I'm looking at my screen. is there any way to do this easier? I bet there isn't heh :( Just want dpads instead of analogs, the Start and Escape keys in my pad. help pls :(
-
There were a few small formatting errors that I corrected below:
sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --evdev /dev/input/by-id/3 \ --silent \ --axismap -Y1=Y1,-Y2=Y2 \ --buttonmap tl^toggle=tl \ --buttonmap tr^toggle=tr \ --detach-kernel-driver \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --mimic-xpad \ --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_X=x2,ABS_Y=y2,ABS_*=lt,ABS_*=rt,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \ --evdev-keymap BTN_EAST=a,BTN_C=b,BTN_SOUTH=x,BTN_NORTH=y,BTN_WEST=lb,BTN_Z=rb,BTN_TL=tl,BTN_TR=tr,BTN_MODE=guide,BTN_TL2=back,BTN_TR2=start \ --ui-axismap X1=KEY_KP4:KEY_KP6,Y1=KEY_KP8:KEY_KP5 \ --ui-axismap X2=KEY_1:KEY_2,Y2=KEY_3:KEY_4,lt+X2=KEY_5:KEY_6,lt+Y2=KEY_7:KEY_8,rt+X2=KEY_9:KEY_0,rt+Y2=KEY_KPASTERISK:KEY_EQUAL \ --ui-buttonmap a=KEY_RIGHTCTRL,b=KEY_F2,x=KEY_EQUAL,y=KEY_KPASTERISK,lb=KEY_F9,rb=KEY_F5,du=KEY_KP8,dd=KEY_KP5,dl=KEY_KP4,dr=KEY_KP6,start=KEY_F4,back=KEY_F3,lt=KEY_HOME,rt=KEY_HOME,tl=KEY_HOME,tr=KEY_HOME \ --ui-buttonmap lt+a=KEY_ENTER,lt+b=KEY_ESC,lt+du=KEY_UP,lt+dd=KEY_DOWN,lt+dl=KEY_LEFT,lt+dr=KEY_RIGHT,lt+start=KEY_F1 \ --ui-axismap lt+X1=KEY_LEFT:KEY_RIGHT,lt+Y1=KEY_UP:KEY_DOWN \ --ui-axismap tl+x1=REL_X:10,tl+y1=REL_Y:10 \ --ui-buttonmap tr+b=BTN_LEFT,tr+a=BTN_RIGHT \ --ui-buttonmap guide=void \
I suspect that
evdev /dev/input/by-id/3
is also incorrect. When you runls /dev/input/by-id/
from the command line, does your controller fully identify as "3"? If so, then you're fine, but I would think there is more to the name than that.then, how do I paste this and where exactly?
Seeing as this is specific to Atari800, you'll want to use one of the two emulator-specific options noted in the guide that will run only alongside the emulator. Since you are just learning these things, I would recommend simply adding the command to
/opt/retropie/configs/atari800/emulators.cfg
, but just remember to make a backup when you're done, as this file gets overwritten after every update. Once added, it should look like:atari800 = "sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --evdev /dev/input/by-id/3 \ --silent \ --axismap -Y1=Y1,-Y2=Y2 \ --buttonmap tl^toggle=tl \ --buttonmap tr^toggle=tr \ --detach-kernel-driver \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --mimic-xpad \ --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_X=x2,ABS_Y=y2,ABS_*=lt,ABS_*=rt,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \ --evdev-keymap BTN_EAST=a,BTN_C=b,BTN_SOUTH=x,BTN_NORTH=y,BTN_WEST=lb,BTN_Z=rb,BTN_TL=tl,BTN_TR=tr,BTN_MODE=guide,BTN_TL2=back,BTN_TR2=start \ --ui-axismap X1=KEY_KP4:KEY_KP6,Y1=KEY_KP8:KEY_KP5 \ --ui-axismap X2=KEY_1:KEY_2,Y2=KEY_3:KEY_4,lt+X2=KEY_5:KEY_6,lt+Y2=KEY_7:KEY_8,rt+X2=KEY_9:KEY_0,rt+Y2=KEY_KPASTERISK:KEY_EQUAL \ --ui-buttonmap a=KEY_RIGHTCTRL,b=KEY_F2,x=KEY_EQUAL,y=KEY_KPASTERISK,lb=KEY_F9,rb=KEY_F5,du=KEY_KP8,dd=KEY_KP5,dl=KEY_KP4,dr=KEY_KP6,start=KEY_F4,back=KEY_F3,lt=KEY_HOME,rt=KEY_HOME,tl=KEY_HOME,tr=KEY_HOME \ --ui-buttonmap lt+a=KEY_ENTER,lt+b=KEY_ESC,lt+du=KEY_UP,lt+dd=KEY_DOWN,lt+dl=KEY_LEFT,lt+dr=KEY_RIGHT,lt+start=KEY_F1 \ --ui-axismap lt+X1=KEY_LEFT:KEY_RIGHT,lt+Y1=KEY_UP:KEY_DOWN \ --ui-axismap tl+x1=REL_X:10,tl+y1=REL_Y:10 \ --ui-buttonmap tr+b=BTN_LEFT,tr+a=BTN_RIGHT \ --ui-buttonmap guide=void \ -- \ /opt/retropie/emulators/atari800/bin/atari800 %ROM%" default="atari800"
-
@mediamogul
When I run "cat /proc/bus/input/devices" this is what I get for my PS3 pad:
Whan I run "ls /dev/input/by-id/" I get this:
So I'm a little confused on what shoudl I put in the --evdev /dev/input/by-id/* \ line :/
-
You're looking for the joystick event, so in your case, it would be:
--evdev /dev/input/by-id/usb-SZMY-POWER_CO._LTD._GAMEPAD_3_TURBO-event-joystick
-
@mediamogul Ok! so i finally managed to put these lines in the atari800 emulators.cfg, now do I have to enable the xboxdrv to make the changes count?
EDIT: I did enable the xboxdrv but now all of my buttons are the joystick trigger and I'm still moving with the analog stick and not the Dpad. Tried the LT+Start to see if I get the emulator menu but doesn't work. -
There might be something wrong with the mapping that isn't immediately visible. Try running the command by itself from a terminal window to see if it throws up any errors:
sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --evdev /dev/input/by-id/usb-SZMY-POWER_CO._LTD._GAMEPAD_3_TURBO-event-joystick \ --silent \ --axismap -Y1=Y1,-Y2=Y2 \ --buttonmap tl^toggle=tl \ --buttonmap tr^toggle=tr \ --detach-kernel-driver \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --mimic-xpad \ --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_X=x2,ABS_Y=y2,ABS_*=lt,ABS_*=rt,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \ --evdev-keymap BTN_EAST=a,BTN_C=b,BTN_SOUTH=x,BTN_NORTH=y,BTN_WEST=lb,BTN_Z=rb,BTN_TL=tl,BTN_TR=tr,BTN_MODE=guide,BTN_TL2=back,BTN_TR2=start \ --ui-axismap X1=KEY_KP4:KEY_KP6,Y1=KEY_KP8:KEY_KP5 \ --ui-axismap X2=KEY_1:KEY_2,Y2=KEY_3:KEY_4,lt+X2=KEY_5:KEY_6,lt+Y2=KEY_7:KEY_8,rt+X2=KEY_9:KEY_0,rt+Y2=KEY_KPASTERISK:KEY_EQUAL \ --ui-buttonmap a=KEY_RIGHTCTRL,b=KEY_F2,x=KEY_EQUAL,y=KEY_KPASTERISK,lb=KEY_F9,rb=KEY_F5,du=KEY_KP8,dd=KEY_KP5,dl=KEY_KP4,dr=KEY_KP6,start=KEY_F4,back=KEY_F3,lt=KEY_HOME,rt=KEY_HOME,tl=KEY_HOME,tr=KEY_HOME \ --ui-buttonmap lt+a=KEY_ENTER,lt+b=KEY_ESC,lt+du=KEY_UP,lt+dd=KEY_DOWN,lt+dl=KEY_LEFT,lt+dr=KEY_RIGHT,lt+start=KEY_F1 \ --ui-axismap lt+X1=KEY_LEFT:KEY_RIGHT,lt+Y1=KEY_UP:KEY_DOWN \ --ui-axismap tl+x1=REL_X:10,tl+y1=REL_Y:10 \ --ui-buttonmap tr+b=BTN_LEFT,tr+a=BTN_RIGHT \ --ui-buttonmap guide=void
-
@mediamogul just did it and it says:
-- [ ERROR ] ------------------------------------------------------
error: invalid argument '--evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_X=x2,ABS_Y=y2,ABS_=lt,ABS_=rt,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y'
couldn't convert 'ABS_*' to enum, not a member of EV_ABS -
Ah, OK. Looks like you left in the place holder asterisks for 'lt' and 'rt' on the
--evdev-absmap
line. Just replace them with the event codes from your controller. After that, run the command again to see if any other errors pop up. -
@mediamogul pasted it correcting the *'s, and I got this:
xboxdrv 0.8.8 - http://pingus.seul.org/~grumbel/xboxdrv/
Copyright © 2008-2011 Ingo Ruhnke grumbel@gmail.com
Licensed under GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under certain
conditions; see the file COPYING for details.Your Xbox/Xbox360 controller should now be available as:
/dev/input/js1
/dev/input/event4Press Ctrl-C to quit
Then I pasted & saved the same imput mapping in the atari800 emulators.cfg
atari800 = "sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv
--evdev /dev/input/by-id/3
--silent
--axismap -Y1=Y1,-Y2=Y2
--buttonmap tl^toggle=tl
--buttonmap tr^toggle=tr
--detach-kernel-driver
--force-feedback
--deadzone-trigger 15%
--deadzone 4000
--mimic-xpad
--evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_X=x2,ABS_Y=y2,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y
--evdev-keymap BTN_EAST=a,BTN_C=b,BTN_SOUTH=x,BTN_NORTH=y,BTN_WEST=lb,BTN_Z=rb,BTN_TL=tl,BTN_TR=tr,BTN_MODE=guide,BTN_TL2=back,BTN_TR2=start,BTN_SELECT=lt,BTN_START=rt
--ui-axismap X1=KEY_KP4:KEY_KP6,Y1=KEY_KP8:KEY_KP5
--ui-axismap X2=KEY_1:KEY_2,Y2=KEY_3:KEY_4,lt+X2=KEY_5:KEY_6,lt+Y2=KEY_7:KEY_8,rt+X2=KEY_9:KEY_0,rt+Y2=KEY_KPASTERISK:KEY_EQUAL
--ui-buttonmap a=KEY_RIGHTCTRL,b=KEY_F2,x=KEY_EQUAL,y=KEY_KPASTERISK,lb=KEY_F9,rb=KEY_F5,du=KEY_KP8,dd=KEY_KP5,dl=KEY_KP4,dr=KEY_KP6,start=KEY_F4,back=KEY_F3,lt =KEY_HOME,rt=KEY_HOME,tl=KEY_HOME,tr=KEY_HOME
--ui-buttonmap lt+a=KEY_ENTER,lt+b=KEY_ESC,lt+du=KEY_UP,lt+dd=KEY_DOWN,lt+dl=KEY_LEFT,lt+dr=KEY_RIGHT,lt+start=KEY_F1
--ui-axismap lt+X1=KEY_LEFT:KEY_RIGHT,lt+Y1=KEY_UP:KEY_DOWN
--ui-axismap tl+x1=REL_X:10,tl+y1=REL_Y:10
--ui-buttonmap tr+b=BTN_LEFT,tr+a=BTN_RIGHT
--ui-buttonmap guide=void
--
/opt/retropie/emulators/atari800/bin/atari800 %ROM%"
default="atari800"
atari800 = "/opt/retropie/emulators/atari800/bin/atari800 %ROM%"
default = "atari800"After this I enabled the xboxdrv, performed a reboot and tested the Atari800 emu, and i'm still moving my characters with the analog stick, what am I missing?
-
There looks to be a couple of issues here and there. Try this:
atari800 = "sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --evdev /dev/input/by-id/usb-SZMY-POWER_CO._LTD._GAMEPAD_3_TURBO-event-joystick \ --silent \ --axismap -Y1=Y1,-Y2=Y2 \ --buttonmap tl^toggle=tl \ --buttonmap tr^toggle=tr \ --detach-kernel-driver \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --mimic-xpad \ --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_X=x2,ABS_Y=y2,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \ --evdev-keymap BTN_EAST=a,BTN_C=b,BTN_SOUTH=x,BTN_NORTH=y,BTN_WEST=lb,BTN_Z=rb,BTN_TL=tl,BTN_TR=tr,BTN_MODE=guide,BTN_TL2=back,BTN_TR2=start \ --ui-axismap X1=KEY_KP4:KEY_KP6,Y1=KEY_KP8:KEY_KP5 \ --ui-axismap X2=KEY_1:KEY_2,Y2=KEY_3:KEY_4,lt+X2=KEY_5:KEY_6,lt+Y2=KEY_7:KEY_8,rt+X2=KEY_9:KEY_0,rt+Y2=KEY_KPASTERISK:KEY_EQUAL \ --ui-buttonmap a=KEY_RIGHTCTRL,b=KEY_F2,x=KEY_EQUAL,y=KEY_KPASTERISK,lb=KEY_F9,rb=KEY_F5,du=KEY_KP8,dd=KEY_KP5,dl=KEY_KP4,dr=KEY_KP6,start=KEY_F4,back=KEY_F3,lt=KEY_HOME,rt=KEY_HOME,tl=KEY_HOME,tr=KEY_HOME \ --ui-buttonmap lt+a=KEY_ENTER,lt+b=KEY_ESC,lt+du=KEY_UP,lt+dd=KEY_DOWN,lt+dl=KEY_LEFT,lt+dr=KEY_RIGHT,lt+start=KEY_F1 \ --ui-axismap lt+X1=KEY_LEFT:KEY_RIGHT,lt+Y1=KEY_UP:KEY_DOWN \ --ui-axismap tl+x1=REL_X:10,tl+y1=REL_Y:10 \ --ui-buttonmap tr+b=BTN_LEFT,tr+a=BTN_RIGHT \ --ui-buttonmap guide=void \ -- \ /opt/retropie/emulators/atari800/bin/atari800 %ROM%" default="atari800"
Edit: Also, when pasting code into the forum, surrounding it in three backticks ``` on both sides helps to keep things manageable.
-
Still doesn't work. Every single button works as the Atari Joystick trigger button, even start and select, dunno what to do :/
-
I suppose it could be in how the command is formatted. Below is the same command on one line, without any separation.
atari800 = "sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv --evdev /dev/input/by-id/usb-SZMY-POWER_CO._LTD._GAMEPAD_3_TURBO-event-joystick --silent --axismap -Y1=Y1,-Y2=Y2 --buttonmap tl^toggle=tl --buttonmap tr^toggle=tr --detach-kernel-driver --force-feedback --deadzone-trigger 15% --deadzone 4000 --mimic-xpad --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_X=x2,ABS_Y=y2,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y --evdev-keymap BTN_EAST=a,BTN_C=b,BTN_SOUTH=x,BTN_NORTH=y,BTN_WEST=lb,BTN_Z=rb,BTN_TL=tl,BTN_TR=tr,BTN_MODE=guide,BTN_TL2=back,BTN_TR2=start --ui-axismap X1=KEY_KP4:KEY_KP6,Y1=KEY_KP8:KEY_KP5 --ui-axismap X2=KEY_1:KEY_2,Y2=KEY_3:KEY_4,lt+X2=KEY_5:KEY_6,lt+Y2=KEY_7:KEY_8,rt+X2=KEY_9:KEY_0,rt+Y2=KEY_KPASTERISK:KEY_EQUAL --ui-buttonmap a=KEY_RIGHTCTRL,b=KEY_F2,x=KEY_EQUAL,y=KEY_KPASTERISK,lb=KEY_F9,rb=KEY_F5,du=KEY_KP8,dd=KEY_KP5,dl=KEY_KP4,dr=KEY_KP6,start=KEY_F4,back=KEY_F3,lt=KEY_HOME,rt=KEY_HOME,tl=KEY_HOME,tr=KEY_HOME --ui-buttonmap lt+a=KEY_ENTER,lt+b=KEY_ESC,lt+du=KEY_UP,lt+dd=KEY_DOWN,lt+dl=KEY_LEFT,lt+dr=KEY_RIGHT,lt+start=KEY_F1 --ui-axismap lt+X1=KEY_LEFT:KEY_RIGHT,lt+Y1=KEY_UP:KEY_DOWN --ui-axismap tl+x1=REL_X:10,tl+y1=REL_Y:10 --ui-buttonmap tr+b=BTN_LEFT,tr+a=BTN_RIGHT --ui-buttonmap guide=void -- /opt/retropie/emulators/atari800/bin/atari800 %ROM%" default="atari800"
-
I managed to get your config to work, what a godsend! Thank you! The only problem I have is my Wii U Pro Controller maps the RThumb (R3) and LThumb (L3) as btn instead of abs. Is there anyway to use your setup for Super Breakout etc.? After toggling I get no response from the thumbsticks and I'm guessing it is due to them being buttons instead of axis.
-
That's tough to say. It's such a specialty situation that anything I say would be guesswork. Did the controller require a driver or did it just pair with Bluetooth?
-
It paired with bluetooth, I may just have to use a different controller. Not the end of the world. Odd how it maps though!
-
meant for another thread.
-
@mahcneto said in Mapping certain keys from Atari800 emu to the gamepad:
emus, is there any way to map certain keys to the gamepad since this console uses just 1 button for playing? These ones mostly:
This is a very old thread but I want to share somenthing that works well for me just in case someone else will find it useful.
I purchased a $16 3-Key USB keypad from amazon https://www.amazon.com/dp/B08P1GY3GN/ref=cm_sw_em_r_mt_dp_H610W0ZBZ6DNXZSZESYK
I easily (30 second effort) programed the keys to F2, F3, F4 and it works perfectly!
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.