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

    Cannot get Rii K25 keyboard working in ScummVM

    Scheduled Pinned Locked Moved Help and Support
    scummvmkeyboardcontroller
    21 Posts 3 Posters 1.6k 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.
    • P
      pfaux
      last edited by

      Pi Model: Pi4 (8g mem)
      RetroPie Version: 4.8.4
      Build From: Pre made SD image
      USB Devices: External HDD, Remote receiver
      Controller used: Rii K25 Multifunction Portable 2.4GHz Mini Wireless Fly Mouse Keyboard and Remote
      Emulator: SCUMMVM

      I would like to use my remote controller (Rii K25) as a mouse and keyboard for SCUMMVM games.
      Without any modifications, the mouse is recognized, but the keyboard and other buttons on the remote are not recognised.

      In Emulation Station I set up the remote as a controller and mapped various commands like the "Start" button to keys on the remote.

      The +Start ScummVM.sh file in ~/RetroPIe/roms/scummvm lists the launch command with a --joystick=0 parameter.

      When I launch a ScummVM game either from the EmulationStation menu, or by launching ScummVM and selecting a game from there, it only recognizes the Rii K25 mouse. The keyboard and mapped buttons on the remote do nothing once ScummVM is launched.

      This causes problems because once you're in a ScummVM game, you can't get out without pulling up the menu to exit (which by default is either via a keyboard command of Ctrl+F4, or the Start button on the controller, but can be modified to other keys in /.configs/scummvm/scummvm.ini).

      I've tried plugging in an additional keyboard, and rebooting/relaunching but that is not recognized either.

      The Rii K25 keyboard works in Kodi, and the mapped controller buttons behave as expected in Emulation Station.

      Ideally, I'd like to use the built in keyboard on the remote, but would settle for the remote control being regonized as a joystick and having a button mapped to 'Start' to pull up the menu.

      Does anyone have any suggestions for troubleshooting this, or ideas for how I might adjust things to make it work?

      Let me know if this is a more appropriate question for the ScummVM forum. Thanks!

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by

        Can you post the output of the cat /proc/bus/input/devices ?

        If you exit EmulationStation and start typing on the keyboard, do you see the keys being echoed in the terminal ?

        1 Reply Last reply Reply Quote 0
        • P
          pfaux
          last edited by

          Sure thing, the output is below.
          Exiting Emulation Station and typing at the terminal works as expected.

          $ cat /proc/bus/input/devices
          
          B: EV=120013
          B: KEY=10000 7 ff9f207a c14057ff febeffdf ffefffff ffffffff fffffffe
          B: MSC=10
          B: LED=1f
          
          I: Bus=0003 Vendor=1915 Product=1028 Version=0101
          N: Name="123 COM Smart Control Mouse"
          P: Phys=usb-0000:01:00.0-1.4/input1
          S: Sysfs=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.1/0003:1915:1028.0005/input/input5
          U: Uniq=
          H: Handlers=mouse1 event5 
          B: PROP=0
          B: EV=17
          B: KEY=1f0000 0 0 0 0 0 0 0 0
          B: REL=903
          B: MSC=10
          
          I: Bus=0003 Vendor=1915 Product=1028 Version=0101
          N: Name="123 COM Smart Control Consumer Control"
          P: Phys=usb-0000:01:00.0-1.4/input1
          S: Sysfs=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.1/0003:1915:1028.0005/input/input6
          U: Uniq=
          H: Handlers=kbd event6 
          B: PROP=0
          B: EV=1f
          B: KEY=302ff 0 0 0 0 483ffff 17aff32d bfd44446 0 0 1 130ff3 8b17c000 677bfa d9415fed 9ed680 4400 0 10000002
          B: REL=1040
          B: ABS=1 0
          B: MSC=10
          
          I: Bus=0003 Vendor=1915 Product=1028 Version=0101
          N: Name="123 COM Smart Control System Control"
          P: Phys=usb-0000:01:00.0-1.4/input1
          S: Sysfs=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.1/0003:1915:1028.0005/input/input7
          U: Uniq=
          H: Handlers=kbd event7 
          B: PROP=0
          B: EV=13
          B: KEY=400000 0 0 0 0 0 0 0 4000 10cc00 100000 0 0 0
          B: MSC=10
          
          1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator
            last edited by

            From the output posted, the Rii gets recognized as 3 devices: 1 mouse and 2 keyboard inputs. There's no joystick/gamepad device in there, so in EmulationStation you must have mapped the keyboard.
            I'm not sure why the inputs are not recognized by ScummVM, could it be because it mainly uses the F(unctional) keys for commands and the keyboard doesn't produce them directly (without the Fn modifier) ? If you run mc from the terminal, are the Functional keys working (F10 to exit, F9 to bring down the menu) ?

            1 Reply Last reply Reply Quote 0
            • P
              pfaux
              last edited by

              Ahh, interesting. I can try to map it as a joystick/gamepad and see if that changes anything.

              The keyboard on the Rii doesn't have any function keys, but in the ScummVM UI (where you can edit the names of the available games) I can see that the keyboard is not being properly recognized since nothing is typed in the text fields.

              My plan was to update the scummvm.ini to include keymappings for the function key behaviors once I get it working, but I haven't gotten there yet.

              Would this be something to ask the ScummVM folks about?

              mituM 1 Reply Last reply Reply Quote 0
              • mituM
                mitu Global Moderator @pfaux
                last edited by

                @pfaux said in Cannot get Rii K25 keyboard working in ScummVM:

                The keyboard on the Rii doesn't have any function keys, but in the ScummVM UI (where you can edit the names of the available games) I can see that the keyboard is not being properly recognized since nothing is typed in the text fields.

                I see. A bit strange, since EmulationStation uses the same input library (libsdl) for input handling (be it keyboard or gamepad/joystick).

                Would this be something to ask the ScummVM folks about?

                Sure, you can ask in their forums or bug tracker.

                1 Reply Last reply Reply Quote 0
                • P
                  pfaux
                  last edited by

                  I asked on on the ScummVM forum, and one suggestion they had was running it directly from the binaries.

                  If I exit Emulation Station and run ScummVM directly from /opt/retropie/emulators/scummvm/bin/scummvm the keyboard and mouse input work as expected.

                  So there must be something happening in the way Emulation Station is launching ScummVM that's dropping the keyboard input from the device.

                  Any ideas as to what might be going on?

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    sleve_mcdichael @pfaux
                    last edited by

                    @pfaux said in Cannot get Rii K25 keyboard working in ScummVM:

                    Any ideas as to what might be going on?

                    RP launches it with a few additional command-line arguments:

                    /opt/retropie/emulators/scummvm/bin/scummvm --fullscreen --joystick=0 --extrapath="/opt/retropie/emulators/scummvm/extra" "$game"

                    My money is on the --joystick=0; try launching it manually with that and see if the problem returns.

                    1 Reply Last reply Reply Quote 1
                    • P
                      pfaux
                      last edited by pfaux

                      Launching

                      /opt/retropie/emulators/scummvm/bin/scummvm --joystick=0
                      

                      directly from the command line works as expected (keyboard works just fine).
                      One interesting thing though, after exiting the ScummVM UI back to the command prompt, I noticed that the following had been logged to the cli screen:

                      Virtual keyboard pack 'vkeybd_default' loaded successfully
                      

                      So, it seems that a straight launch from the command line includes some special handling of the keyboard. Is there a way to view command line logs when launching something in Emulation Station, perhaps via an external SSH connection, or a logfile?

                      mituM 1 Reply Last reply Reply Quote 0
                      • mituM
                        mitu Global Moderator @pfaux
                        last edited by mitu

                        @pfaux said in Cannot get Rii K25 keyboard working in ScummVM:

                        Is there a way to view command line logs when launching something in Emulation Station, perhaps via an external SSH connection, or a logfile?

                        You can view it in /dev/shm/runcommand.log, this is where the launched emulators/ports will send their output.
                        Btw, there's nothing different between launching from command line or EmulationStation - EmulationStation just goes into the background and the launched emulator takes over.

                        P 1 Reply Last reply Reply Quote 0
                        • P
                          pfaux @mitu
                          last edited by

                          @mitu
                          I had some time to do some more poking and prodding at this, and it is truly bizarre.

                          When launching from emulation station, they keyboard does not work, and it logs :

                          Executing (via xinit): bash /home/pi/RetroPie/roms/scummvm/+Start ScummVM.sh monkey-vga
                          
                          Virtual keyboard pack 'vkeybd_default' loaded successfully
                          

                          When launching from the command line having exited emulationStation, the keyboard works, and it logs:

                          /home/pi/RetroPie/roms/scummvm/+Start\ ScummVM.sh monkey-vga
                          Virtual keyboard pack 'vkeybd_default' loaded successfully
                          

                          I checked the /proc/bus/input/devices in both states and they were identical.

                          Oh well. I guess some things are destined to remain a mystery. For now I'll just have to play them from the command line. Thank you so much for your help and insight into tracking down the log files.

                          mituM 1 Reply Last reply Reply Quote 0
                          • mituM
                            mitu Global Moderator @pfaux
                            last edited by

                            @pfaux said in Cannot get Rii K25 keyboard working in ScummVM:

                            Executing (via xinit): bash /home/pi/RetroPie/roms/scummvm/+Start ScummVM.sh monkey-vga

                            That's not the default launch command for ScummVM - via xorg. How exactly did you configure it ? Can you post your /opt/retropie/configs/scummvm/emulators.cfg ?

                            P 1 Reply Last reply Reply Quote 0
                            • P
                              pfaux @mitu
                              last edited by pfaux

                              Sure thing:

                              pi@retropie:~ $ cat /opt/retropie/configs/scummvm/emulators.cfg 
                              scummvm = "bash /home/pi/RetroPie/roms/scummvm/+Start\ ScummVM.sh %BASENAME%"
                              default = "scummvm"
                              
                              

                              In the above example I was launching The Secret of Monkey Island to test, hence the "monkey-vga" parameter at the end as the %BASENAME%.

                              1 Reply Last reply Reply Quote 0
                              • mituM
                                mitu Global Moderator
                                last edited by

                                The emulators.cfg seems ok - but your runcommand shows that xorg is used to launch ScummVM. Did you do any other configurations for scummvm from the default installation ?

                                P 1 Reply Last reply Reply Quote 0
                                • P
                                  pfaux @mitu
                                  last edited by

                                  I made modifications to the ~/.config/scummvm/scummvm.ini file to change the graphics mode to super-eagle, and add some additional key-mappings (since the Rii remote lacks function keys).

                                  Other than that, I don't recall any modifications to anything that would control how ScummVM launches.

                                  I just tried reinstalling ScummVM and will see if that changes anything.

                                  1 Reply Last reply Reply Quote 0
                                  • mituM
                                    mitu Global Moderator
                                    last edited by

                                    Can you post the /opt/retropie/configs/all/backends.cfg file from your installation ?

                                    P 1 Reply Last reply Reply Quote 0
                                    • P
                                      pfaux @mitu
                                      last edited by

                                      Ah, this looks suspicious:

                                      pi@retropie:~ $ cat /opt/retropie/configs/all/backends.cfg 
                                      smw="dispmanx"
                                      scummvm="x11-c"
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • mituM
                                        mitu Global Moderator
                                        last edited by mitu

                                        Ok, so ScummVM is configured to run through x11/xorg - that's not a default configuration. Did you add the configuration yourself ? RetroPie doesn't configure it like this by default - it needs to be user choice.

                                        P 1 Reply Last reply Reply Quote 0
                                        • P
                                          pfaux @mitu
                                          last edited by

                                          I don't recall adding that (it's possible I did something many months ago I don't remember), but I can remove it and make sure it works as expected.

                                          mituM 1 Reply Last reply Reply Quote 0
                                          • mituM
                                            mitu Global Moderator @pfaux
                                            last edited by

                                            @pfaux So, do you still have an issue if you remove the configuration of scummvm from backends.cfg ?

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