Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    GPIO Controller Input (as keyboard or joystick)

    Recalbox General
    gpio input keyboard joystick
    3
    4
    2154
    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.
    • Flavor
      Flavor last edited by

      I have a system that uses GPIO for input. I would like to map them to a joystick or keyboard.

      ---JOYSTICK---
      To map the GPIOs as a joystick, I have used mk_arcade_joystick_rpi, but my GPIO aren't set up the same as what is shown in https://github.com/recalbox/recalbox-os/wiki/GPIO-controllers-(EN)
      The 0.1.5 version of mk_arcade_joystick_rpi should allow a custom map, but that doesn't seem to be included in Recalbox. In fact, I would prefer to use the version at https://github.com/TheFlav/mk_arcade_joystick_rpi, but I would really prefer to not mess with adding a driver unless it's quite easy for others to add. Is there an easy way for a user to add a newer version of mk_arcade_joystick_rpi to their Recalbox?

      ---KEYBOARD---

      If not, the alternate plan could be to use GPIO as a keyboard. While some may think that this causes the same problem, it's actually not widely known that all you really need is a .dtbo and some config.txt entries like
      #left
      dtoverlay=gpio-key,gpio=6,keycode=105
      #right
      dtoverlay=gpio-key,gpio=5,keycode=106
      #up
      dtoverlay=gpio-key,gpio=4,keycode=103
      #down
      dtoverlay=gpio-key,gpio=17,keycode=108
      #a = a = OK
      dtoverlay=gpio-key,gpio=16,keycode=30
      ...

      After that, you can easily navigate the menu system, but the mappings do not seem to work inside of any emulator or Kodi. I wonder if it is because each GPIO button is acting as a separate keyboard. If I run evtest, it looks like this.

      No device specified, trying to scan all of /dev/input/event*
      Available devices:
      /dev/input/event0: 17.button
      /dev/input/event1: e.button
      /dev/input/event2: 12.button
      /dev/input/event3: f.button
      /dev/input/event4: 1a.button
      /dev/input/event5: 13.button
      /dev/input/event6: 18.button
      /dev/input/event7: 10.button
      /dev/input/event8: 11.button
      /dev/input/event9: 4.button
      /dev/input/event10: 5.button
      /dev/input/event11: 6.button


      I guess I'm looking for ideas here. Is there an easy way for me to build a version of https://github.com/TheFlav/mk_arcade_joystick_rpi and add it to a Recalbox install? Is there a pre-built version of mk_arcade_joystick_rpi v0.1.5 available somewhere? Is there a way to get the keyboard input working?

      Substring 1 Reply Last reply Reply Quote 0
      • Substring
        Substring @Flavor last edited by

        @flavor we haven't switched to the configurable GPIO branch because, as far as I remember, it doesn't support the hotkey button.

        To compile it, i think you can do it from raspbian but you must have the same kernel branch as us (which is 4.4 for now, should b*mp to 4.9 once i'm done upgrading all boards).

        Adding your branch ... no

        I'm used to buildroot, so it's rather easy for me to compile it from there. It's not that hard to understand : it's a bunch of makefiles, most of it

        Former dev - Please reply with @substring so that i am notified when you answer me
        Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

        1 Reply Last reply Reply Quote 0
        • Dragu
          Dragu Banned last edited by Dragu

          I am afraid the guy stopped everything because he felt some frustration from all this, but should we not also support some hardware kickstarter products ? I suppose that it should be possible to recompile a gpio interface for the freeplay project.

          Substring 1 Reply Last reply Reply Quote 0
          • Substring
            Substring @Dragu last edited by

            @dragu if you were looking for a CM3 project, here is one !

            Former dev - Please reply with @substring so that i am notified when you answer me
            Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            Want to support us ?

            69
            Online

            99.6k
            Users

            28.1k
            Topics

            187.1k
            Posts

            Copyright © 2021 recalbox.com