RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    scummVM change keyboard maps on gamepad

    Scheduled Pinned Locked Moved Help and Support
    scummvmgamepadkeyboardkeybutton
    15 Posts 5 Posters 2.9k 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.
    • coldnpaleC
      coldnpale
      last edited by

      Greetings once again fellow retropiers,

      I managed to set up my scummVM. Everything seems to be working nicely. Now I am trying to customize it to my personal taste.
      I am using gamepad.
      Does anyone know if there is a way to change some of the key maps? For example I would much rather prefer to have gamepad's "start" button as the main menu. At the moment, the default is R1.

      Thanks!

      D 1 Reply Last reply Reply Quote 0
      • D
        dudleydes @coldnpale
        last edited by

        @coldnpale I managed to remap the ScummVM defaults for my PS3 controller. You can find the steps here.

        These are the changes I made to the sdl-events.cpp file, BUT_F5 being the Start button to bring up the main menu:

        #define JOY_BUT_LMOUSE 14
        #define JOY_BUT_RMOUSE 13
        #define JOY_BUT_ESCAPE 15
        #define JOY_BUT_PERIOD 12
        #define JOY_BUT_SPACE 0
        #define JOY_BUT_F5 3
        
        coldnpaleC E 2 Replies Last reply Reply Quote 1
        • coldnpaleC
          coldnpale @dudleydes
          last edited by

          @dudleydes
          thanks! I'll give it a try and let you know how it goes.

          1 Reply Last reply Reply Quote 0
          • E
            EctoOne @dudleydes
            last edited by

            @dudleydes Awesome tip! I actually added another Button to my setup. I did that by adding #define JOY_BUT_F1 4 (4 is the left shoulder button on my F710 pad) to your list.
            Then i added the following lines near lines 835 and 870 in the sdl-events.cpp:

            		case JOY_BUT_F1:
            			event.kbd.keycode = Common::KEYCODE_F1;
            			event.kbd.ascii = mapKey(SDLK_F1, (SDLMod)ev.key.keysym.mod, 0);
            			break;
            

            I tested it with Discworld and it worked. If I notice that I need another key in any other game, I will just add it using that method.

            coldnpaleC 1 Reply Last reply Reply Quote 1
            • coldnpaleC
              coldnpale
              last edited by

              noob question: Before doing all this, should I install normally scummvm? Or is this not needed since it is done after building and installing?

              D 1 Reply Last reply Reply Quote 0
              • coldnpaleC
                coldnpale @EctoOne
                last edited by coldnpale

                @ectoone
                This is interesting since there are some buttons available. How would I go adding the "ALT" Keyboard button? By replacing "F1" in your example with "ALT" or "RALT" or something?

                E 1 Reply Last reply Reply Quote 0
                • D
                  dudleydes @coldnpale
                  last edited by

                  @coldnpale No, you carry out the commands in a terminal session instead of installing from the setup script.

                  Also, it is these lines in the sdl-events.cpp file that you will need to edit.

                  coldnpaleC 1 Reply Last reply Reply Quote 1
                  • coldnpaleC
                    coldnpale @dudleydes
                    last edited by

                    @dudleydes
                    got it! Thanks!

                    1 Reply Last reply Reply Quote 0
                    • coldnpaleC
                      coldnpale
                      last edited by coldnpale

                      So.. I used jstest to find the correct controller buttons for my logitech F710. Apparently for my controller it has to be

                      #define JOY_BUT_LMOUSE 0
                      #define JOY_BUT_RMOUSE 2
                      #define JOY_BUT_ESCAPE 3
                      #define JOY_BUT_PERIOD 1
                      #define JOY_BUT_SPACE 8
                      #define JOY_BUT_F5 9

                      Now I just need to wait some time to build it

                      1 Reply Last reply Reply Quote 0
                      • E
                        EctoOne @coldnpale
                        last edited by EctoOne

                        @coldnpale If you take a look at the lines 350+ in the sdl-events.cppfile, you can see all SDLK_* and KEYCODE_* values. In your case you need to use LALT or RALT.

                        1 Reply Last reply Reply Quote 1
                        • coldnpaleC
                          coldnpale
                          last edited by

                          So, thanks to dudledes and EctoOne I managed to map the buttons! I appreciate a lot your help, thanks a lot for taking the time to guide me so thoroughly!

                          One last question, if I need to change/add buttons will I have to repeat the process again? I am asking in case of an update. I guess if I update the scummvm the controls will be overwritten.

                          D 1 Reply Last reply Reply Quote 0
                          • D
                            dudleydes @coldnpale
                            last edited by

                            @coldnpale Glad to hear it worked.

                            You should use the above method to change or add buttons or if you wish to update to a new version of ScummVM. Installing from the setup script will have the default gamepad mappings.

                            coldnpaleC 1 Reply Last reply Reply Quote 0
                            • coldnpaleC
                              coldnpale @dudleydes
                              last edited by

                              @dudleydes
                              Better than nothing. At least we have a means to make the changes. I guess I won't be updating too often though ... :P

                              1 Reply Last reply Reply Quote 0
                              • E
                                erazor
                                last edited by

                                Some games block F5 key. So i map the combination ctrl+f5 to the left button of my ps3 controller.

                                #define JOY_BUT_LMOUSE 14
                                #define JOY_BUT_RMOUSE 13
                                #define JOY_BUT_ESCAPE 15
                                #define JOY_BUT_PERIOD 12
                                #define JOY_BUT_SPACE 0
                                #define JOY_BUT_F5 3
                                #define JOY_BUT_MENU 10
                                
                                                case JOY_BUT_MENU:
                                                        event.kbd.flags = Common::KBD_CTRL;
                                                        event.kbd.keycode = Common::KEYCODE_F5;
                                                        event.kbd.ascii = mapKey(SDLK_F5, (SDLMod)ev.key.keysym.mod, 0);
                                                        break;
                                
                                
                                1 Reply Last reply Reply Quote 0
                                • H
                                  hhromic
                                  last edited by

                                  Guys, give a try to the lr-scummvm libretro-based core for ScummVM I put for testing here: https://retropie.org.uk/forum/topic/19693/lr-scummvm-request-for-comments-and-testing/

                                  You can do mappings via RetroArch and customise for each game too easily with RA. Also you can use any RA-supported shader. So far it has been working nice for me, would appreciate feedback from other ScummVM players.

                                  1 Reply Last reply Reply Quote 1
                                  • 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.