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

    Using two USB keyboards as controllers (Leonardo)

    Scheduled Pinned Locked Moved Help and Support
    2 Posts 2 Posters 762 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.
    • D
      djdarlo
      last edited by

      Has anyone used two USB keyboards as controllers for RetroPie? I have two Leonardo's, one for each controller. I am able to set-up the first controller (joypad and 6 buttons) but when I come to setup the second controller (same setup) I am getting an ALREADY IN USE error message when trying to map the controls. I have checked the keyboard mappings for each Leonardo and they look different.

      Player 1
      #define UP_KEYBOARD_CODE 218 /* UP_ARROW /
      #define DOWN_KEYBOARD_CODE 217 /
      DOWN_ARROW*/
      #define LEFT_KEYBOARD_CODE 216 /* RIGHT_ARROW /
      #define RIGHT_KEYBOARD_CODE 215 /
      LEFT_ARROW /
      #define TAB_KEYBOARD_CODE 179 /
      TAB /
      #define ESC_KEYBOARD_CODE 177 /
      ESC /
      #define BUTTON1_KEYBOARD_CODE 128 /
      LEFT_CTRL /
      #define BUTTON2_KEYBOARD_CODE 130 /
      LEFT_ALT /
      #define BUTTON3_KEYBOARD_CODE 32 /
      SPACE /
      #define BUTTON4_KEYBOARD_CODE 129 /
      LEFT_SHIFT /
      #define BUTTON5_KEYBOARD_CODE 122 /
      z /
      #define BUTTON6_KEYBOARD_CODE 120 /
      x /
      #define START1_KEYBOARD_CODE 49 /
      1 /
      #define COIN1_KEYBOARD_CODE 53 /
      5 */

      Player 2
      #define UP_KEYBOARD_CODE 82 /* UP_ARROW /
      #define DOWN_KEYBOARD_CODE 70 /
      DOWN_ARROW*/
      #define LEFT_KEYBOARD_CODE 71 /* RIGHT_ARROW /
      #define RIGHT_KEYBOARD_CODE 68 /
      LEFT_ARROW /
      #define TAB_KEYBOARD_CODE 50 /
      2 /
      #define ESC_KEYBOARD_CODE 53 /
      5 /
      #define BUTTON1_KEYBOARD_CODE 65 /
      A /
      #define BUTTON2_KEYBOARD_CODE 83 /
      S /
      #define BUTTON3_KEYBOARD_CODE 81 /
      Q /
      #define BUTTON4_KEYBOARD_CODE 87 /
      W /
      #define BUTTON5_KEYBOARD_CODE 122 /
      z /
      #define BUTTON6_KEYBOARD_CODE 49 /
      1 /
      #define START1_KEYBOARD_CODE 52 /
      4 /
      #define COIN1_KEYBOARD_CODE 54 /
      6 */

      Has anyone done this before and if so do you have the keyboard mappings you have used previously?

      Thanks,
      David

      meleuM 1 Reply Last reply Reply Quote 0
      • meleuM
        meleu @djdarlo
        last edited by

        @djdarlo
        I think linux consider a keyboard key as a keyboard key, no matter what keyboard has its key pressed. It doesn't care about "this key comes from keyboard1, this key comes from keyboard2".

        You have to set different keys for players1 and 2.

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