• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login

[feature request] joy2key with custom mappings for different controllers

Scheduled Pinned Locked Moved Ideas and Development
joy2keyfeature request
11 Posts 3 Posters 3.0k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    meleu
    last edited by meleu 11 Apr 2017, 18:11

    UPDATE

    The feature requested here was implemented. Those who like to update frequently may have noticed. The PR 1980 was merged, and now the "a button" means "A button".


    This feature would be able to make me say "This is the most perfect software system I've ever seen in my entire life!". OK, OK... maybe I'm exaggerating a bit, but it's something that would make me really really very very happy.

    I would like to control RetroPie-Setup/runcommand menus using the same button mappings I use in emulationstation.

    (As a positive side effect the number of people questioning about which button to press to access runcommand menu would decrease. :) )

    BuZz taught me a nice trick to work around this problem, but it's useful only when using always the same controller, then it's useful only for setups where you don't change the controllers frequently (i.e.: arcade cabinet).

    I've started 2017 with this resolution in mind:

    • learn python and make joy2key.py read custom configs for each controller

    But real life has started to get in my way a lot since mid January...

    Is there already any intention of working on it?

    • Useful topics
    • joystick-selection tool
    • rpie-art tool
    • achievements I made
    B 1 Reply Last reply 11 Apr 2017, 18:24 Reply Quote 0
    • B
      BuZz administrators @meleu
      last edited by BuZz 4 Nov 2017, 19:25 11 Apr 2017, 18:24

      @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.

      To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

      M 3 Replies Last reply 11 Apr 2017, 18:34 Reply Quote 0
      • D
        dankcushions Global Moderator
        last edited by 11 Apr 2017, 18:33

        i always wondered, why not just 'Any button' ? as in, any js pressed acts as 'enter'?

        B 1 Reply Last reply 11 Apr 2017, 18:35 Reply Quote 0
        • M
          meleu @BuZz
          last edited by 11 Apr 2017, 18:34

          @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>.

          • Useful topics
          • joystick-selection tool
          • rpie-art tool
          • achievements I made
          1 Reply Last reply Reply Quote 0
          • B
            BuZz administrators @dankcushions
            last edited by 11 Apr 2017, 18:35

            @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).

            To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

            1 Reply Last reply Reply Quote 0
            • M
              meleu @BuZz
              last edited by 11 Apr 2017, 18:43

              @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.

              • Useful topics
              • joystick-selection tool
              • rpie-art tool
              • achievements I made
              1 Reply Last reply Reply Quote 0
              • D
                dankcushions Global Moderator
                last edited by 11 Apr 2017, 18:44

                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!

                M 1 Reply Last reply 11 Apr 2017, 18:50 Reply Quote 0
                • M
                  meleu @dankcushions
                  last edited by 11 Apr 2017, 18:50

                  @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:

                  manual_edit_configeditor

                  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.

                  • Useful topics
                  • joystick-selection tool
                  • rpie-art tool
                  • achievements I made
                  1 Reply Last reply Reply Quote 0
                  • M
                    meleu @BuZz
                    last edited by meleu 21 Apr 2017, 13:26

                    @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. :-)

                    • Useful topics
                    • joystick-selection tool
                    • rpie-art tool
                    • achievements I made
                    M 1 Reply Last reply 22 Apr 2017, 12:17 Reply Quote 0
                    • M
                      meleu @meleu
                      last edited by 22 Apr 2017, 12:17

                      Submitted a PR getting the button mappings from retroarch-joypads/JOYSTICK.cfg files.

                      https://github.com/RetroPie/RetroPie-Setup/pull/1958

                      • Useful topics
                      • joystick-selection tool
                      • rpie-art tool
                      • achievements I made
                      1 Reply Last reply Reply Quote 2
                      • M
                        meleu
                        last edited by 23 May 2017, 20:30

                        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".

                        • Useful topics
                        • joystick-selection tool
                        • rpie-art tool
                        • achievements I made
                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        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.

                          [[user:consent.lead]]
                          [[user:consent.not_received]]