[feature request] joy2key with custom mappings for different controllers
-
@meleu yes, I plan on implementing it at some point (as time permits). It's not a high priority for me compared to other things though.
If you want to create a input configuration script to output a config for it which it can read, or make it use the retroarch configs directly, I would accept a PR for that.
-
i always wondered, why not just 'Any button' ? as in, any js pressed acts as 'enter'?
-
@dankcushions said in [feature request] joy2key with custom mappings for different controllers:
any js pressed acts as 'enter'?
It's not true. The button 0 is <enter> and the button 1 is <tab>.
-
@dankcushions currently we map 2 buttons - enter and tab for example (needed for full navigation). For wikiviewer it maps differently. Ideally it would map additional buttons too, such as esc (if enough buttons are available).
-
@BuZz said in [feature request] joy2key with custom mappings for different controllers:
If you want to create a input configuration script to output a config for it which it can read, or make it use the retroarch configs directly, I would accept a PR for that
I think I can work on that. I'm thinking on getting configs from
es_input.cfg
.What would be the expected format?
Something like this?:
/dev/input/jsN kcub1 kcuf1 kcuu1 kcud1 <button0> <button1> [<button2> ...]
where
<buttonN>
is one of those hexadecimal codes. -
ah i see. well, for my use (runcommand and setup script) i have only ever used the enter button and dpad, but i tend to do a lot of it via SSH so maybe tab is neccesary some places and i've just not noticed!
-
@dankcushions said in [feature request] joy2key with custom mappings for different controllers:
tab is neccesary some places and i've just not noticed!
Here is an example where tab is needed:
If you accidentally enter this
dialog --editbox
with no keyboard and no button mapped to tab, there's no way to select OK or Cancel. -
@BuZz said in [feature request] joy2key with custom mappings for different controllers:
If you want to create a input configuration script to output a config for it which it can read, or make it use the retroarch configs directly, I would accept a PR for that.
Hey @BuZz , just as a proof of concept I've made a script that looks if each of the connected joysticks have a config in
$HOME/.emulationstation/es_input.cfg
, and, if yes, output the arguments for joy2key making the button A be the <enter> and the button B be the <tab>.Here is the script: https://github.com/meleu/share/blob/master/joy2key_input_config.sh
Copy'n'paste shortcut to download it:
wget https://raw.githubusercontent.com/meleu/share/master/joy2key_input_config.sh
Output example from my system with several joysticks connected:
/dev/input/js4 kcub1 kcuf1 kcuu1 kcud1 "" 0x0a 0x09 /dev/input/js3 kcub1 kcuf1 kcuu1 kcud1 "" 0x0a 0x09 /dev/input/js2 kcub1 kcuf1 kcuu1 kcud1 0x0a 0x09 /dev/input/js1 kcub1 kcuf1 kcuu1 kcud1 "" "" "" 0x09 0x0a /dev/input/js0 kcub1 kcuf1 kcuu1 kcud1 "" "" "" 0x09 0x0a
I tested all of these with joy2key individually, directly in command line, and they work fine.
One question that may arise is: "Is the script able to handle the dynamics of connecting/disconnecting joysticks on different USB ports?"
The answer is yes. :-)
Not sure how I should integrate this on runcommand's
start_joy2key()
and helpers'joy2keyStart()
to submit a PR, but I think we are one step closer to reaching the goal. :-) -
Submitted a PR getting the button mappings from
retroarch-joypads/JOYSTICK.cfg
files. -
I think it's worth to mention it was implemented. Those who like to update frequently may have noticed. The PR 1980 was merged, and now the "a button" means "A button".
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.