Heads up to users of KMS-like drivers

Before, the input driver used was hardcoded in the KMS contexts (udev or linuxraw). This has been removed. However, this means RetroArch will start the input driver configured in the config file (or the default). If you get problems with input, just remove the input_driver line in the config, and it should all work itself out.

udev now just warns if there are no devices attached in case you have a usecase where you only use a gamepad or something.

Hi, I’m setting up an arch linux install with an X-Arcade Dual Joystick. I’m still in the midst of setting things up but I was wondering if you could maybe help clear a confusion I have. The x-arcade shows up as a usb-hid keyboard. Which driver would be appropriate for that? retroarch doesn’t let me dynamically set the settings for the x-arcade so I’m not clear if it’s seeing the x-arcade. I can see the device and it does interact with X so I’ve got some of the libs/drivers installed correctly. I suspect if I disconnect the usb keyboard that’s also connected and set the correct keys in retroarch.cfg it should work. But wouldn’t that mean retroarch would see a key pressed when I do a binding? The x-arcade doesn’t really show up as a joystick so the arch linux joystick wiki leads me to more confusion.

@mwneuendorf linuxraw is probably going to be your best driver. It looks like key binding through RGUI doesn’t like to recognize keyboard input, so you may have to bind them manually through the cfg file. I do know that it works with a little effort, as I have a custom arcade stick using an ipac keyboard encoder. :slight_smile:

hmm. well 2 buttons work. ones with corresponding letters. numbers and special keys… Ive tried quite a few configs and variations. I see events with evtest for the controller(KEY_KP4). but no response from retro with 4 or num4 or kp_4.

It’s been quite awhile since I messed with it, but I believe I used these names:

const struct input_key_map input_config_key_map[] = {
   { "left", RETROK_LEFT },
   { "right", RETROK_RIGHT },
   { "up", RETROK_UP },
   { "down", RETROK_DOWN },
   { "enter", RETROK_RETURN },
   { "kp_enter", RETROK_KP_ENTER },
   { "tab", RETROK_TAB },
   { "insert", RETROK_INSERT },
   { "del", RETROK_DELETE },
   { "end", RETROK_END },
   { "home", RETROK_HOME },
   { "rshift", RETROK_RSHIFT },
   { "shift", RETROK_LSHIFT },
   { "ctrl", RETROK_LCTRL },
   { "alt", RETROK_LALT },
   { "space", RETROK_SPACE },
   { "escape", RETROK_ESCAPE },
   { "add", RETROK_KP_PLUS },
   { "subtract", RETROK_KP_MINUS },
   { "kp_plus", RETROK_KP_PLUS },
   { "kp_minus", RETROK_KP_MINUS },
   { "f1", RETROK_F1 },
   { "f2", RETROK_F2 },
   { "f3", RETROK_F3 },
   { "f4", RETROK_F4 },
   { "f5", RETROK_F5 },
   { "f6", RETROK_F6 },
   { "f7", RETROK_F7 },
   { "f8", RETROK_F8 },
   { "f9", RETROK_F9 },
   { "f10", RETROK_F10 },
   { "f11", RETROK_F11 },
   { "f12", RETROK_F12 },
   { "num0", RETROK_0 },
   { "num1", RETROK_1 },
   { "num2", RETROK_2 },
   { "num3", RETROK_3 },
   { "num4", RETROK_4 },
   { "num5", RETROK_5 },
   { "num6", RETROK_6 },
   { "num7", RETROK_7 },
   { "num8", RETROK_8 },
   { "num9", RETROK_9 },
   { "pageup", RETROK_PAGEUP },
   { "pagedown", RETROK_PAGEDOWN },
   { "keypad0", RETROK_KP0 },
   { "keypad1", RETROK_KP1 },
   { "keypad2", RETROK_KP2 },
   { "keypad3", RETROK_KP3 },
   { "keypad4", RETROK_KP4 },
   { "keypad5", RETROK_KP5 },
   { "keypad6", RETROK_KP6 },
   { "keypad7", RETROK_KP7 },
   { "keypad8", RETROK_KP8 },
   { "keypad9", RETROK_KP9 },
   { "period", RETROK_PERIOD },
   { "capslock", RETROK_CAPSLOCK },
   { "numlock", RETROK_NUMLOCK },
   { "backspace", RETROK_BACKSPACE },
   { "multiply", RETROK_KP_MULTIPLY },
   { "divide", RETROK_KP_DIVIDE },
   { "print_screen", RETROK_PRINT },
   { "scroll_lock", RETROK_SCROLLOCK },
   { "tilde", RETROK_BACKQUOTE },
   { "backquote", RETROK_BACKQUOTE },
   { "pause", RETROK_PAUSE },

   /* Keys that weren't mappable before */
   { "quote", RETROK_QUOTE },
   { "comma", RETROK_COMMA },
   { "minus", RETROK_MINUS },
   { "slash", RETROK_SLASH },
   { "semicolon", RETROK_SEMICOLON },
   { "equals", RETROK_EQUALS },
   { "leftbracket", RETROK_LEFTBRACKET },
   { "backslash", RETROK_BACKSLASH },
   { "rightbracket", RETROK_RIGHTBRACKET },
   { "kp_period", RETROK_KP_PERIOD },
   { "kp_equals", RETROK_KP_EQUALS },
   { "rctrl", RETROK_RCTRL },
   { "ralt", RETROK_RALT },

And if there’s any questions as to which keys are mapping to which RETROK, I believe the following corresponds:

const struct rarch_key_map rarch_key_map_linux[] = {
   { KEY_ESC, RETROK_ESCAPE },
   { KEY_1, RETROK_1 },
   { KEY_2, RETROK_2 },
   { KEY_3, RETROK_3},
   { KEY_4, RETROK_4 },
   { KEY_5, RETROK_5 },
   { KEY_6, RETROK_6 },
   { KEY_7, RETROK_7 },
   { KEY_8, RETROK_8 },
   { KEY_9, RETROK_9 },
   { KEY_0, RETROK_0 },
   { KEY_MINUS, RETROK_MINUS },
   { KEY_EQUAL, RETROK_EQUALS },
   { KEY_BACKSPACE, RETROK_BACKSPACE },
   { KEY_TAB, RETROK_TAB },
   { KEY_Q, RETROK_q },
   { KEY_W, RETROK_w },
   { KEY_E, RETROK_e },
   { KEY_R, RETROK_r },
   { KEY_T, RETROK_t },
   { KEY_Y, RETROK_y },
   { KEY_U, RETROK_u },
   { KEY_I, RETROK_i },
   { KEY_O, RETROK_o },
   { KEY_P, RETROK_p },
   { KEY_LEFTBRACE, RETROK_LEFTBRACKET },
   { KEY_RIGHTBRACE, RETROK_RIGHTBRACKET },
   { KEY_ENTER, RETROK_RETURN },
   { KEY_LEFTCTRL, RETROK_LCTRL },
   { KEY_A, RETROK_a },
   { KEY_S, RETROK_s },
   { KEY_D, RETROK_d },
   { KEY_F, RETROK_f },
   { KEY_G, RETROK_g },
   { KEY_H, RETROK_h },
   { KEY_J, RETROK_j },
   { KEY_K, RETROK_k },
   { KEY_L, RETROK_l },
   { KEY_SEMICOLON, RETROK_SEMICOLON },
   { KEY_APOSTROPHE, RETROK_QUOTE },
   { KEY_GRAVE, RETROK_BACKQUOTE },
   { KEY_LEFTSHIFT, RETROK_LSHIFT },
   { KEY_BACKSLASH, RETROK_BACKSLASH },
   { KEY_Z, RETROK_z },
   { KEY_X, RETROK_x },
   { KEY_C, RETROK_c },
   { KEY_V, RETROK_v },
   { KEY_B, RETROK_b },
   { KEY_N, RETROK_n },
   { KEY_M, RETROK_m },
   { KEY_COMMA, RETROK_COMMA },
   { KEY_DOT, RETROK_PERIOD },
   { KEY_SLASH, RETROK_SLASH },
   { KEY_RIGHTSHIFT, RETROK_RSHIFT },
   { KEY_KPASTERISK, RETROK_KP_MULTIPLY },
   { KEY_LEFTALT, RETROK_LALT },
   { KEY_SPACE, RETROK_SPACE },
   { KEY_CAPSLOCK, RETROK_CAPSLOCK },
   { KEY_F1, RETROK_F1 },
   { KEY_F2, RETROK_F2 },
   { KEY_F3, RETROK_F3 },
   { KEY_F4, RETROK_F4 },
   { KEY_F5, RETROK_F5 },
   { KEY_F6, RETROK_F6 },
   { KEY_F7, RETROK_F7 },
   { KEY_F8, RETROK_F8 },
   { KEY_F9, RETROK_F9 },
   { KEY_F10, RETROK_F10 },
   { KEY_NUMLOCK, RETROK_NUMLOCK },
   { KEY_SCROLLLOCK, RETROK_SCROLLOCK },
   { KEY_KP7, RETROK_KP7 },
   { KEY_KP8, RETROK_KP8 },
   { KEY_KP9, RETROK_KP9 },
   { KEY_KPMINUS, RETROK_KP_MINUS },
   { KEY_KP4, RETROK_KP4 },
   { KEY_KP5, RETROK_KP5 },
   { KEY_KP6, RETROK_KP6 },
   { KEY_KPPLUS, RETROK_KP_PLUS },
   { KEY_KP1, RETROK_KP1 },
   { KEY_KP2, RETROK_KP2 },
   { KEY_KP3, RETROK_KP3 },
   { KEY_KP0, RETROK_KP0 },
   { KEY_KPDOT, RETROK_KP_PERIOD },

   { KEY_F11, RETROK_F11 },
   { KEY_F12, RETROK_F12 },

   { KEY_KPENTER, RETROK_KP_ENTER },
   { KEY_RIGHTCTRL, RETROK_RCTRL },
   { KEY_KPSLASH, RETROK_KP_DIVIDE },
   { KEY_SYSRQ, RETROK_PRINT },
   { KEY_RIGHTALT, RETROK_RALT },

   { KEY_HOME, RETROK_HOME },
   { KEY_UP, RETROK_UP },
   { KEY_PAGEUP, RETROK_PAGEUP },
   { KEY_LEFT, RETROK_LEFT },
   { KEY_RIGHT, RETROK_RIGHT },
   { KEY_END, RETROK_END },
   { KEY_DOWN, RETROK_DOWN },
   { KEY_PAGEDOWN, RETROK_PAGEDOWN },
   { KEY_INSERT, RETROK_INSERT },
   { KEY_DELETE, RETROK_DELETE },

   { KEY_PAUSE, RETROK_PAUSE },
   { 0, RETROK_UNKNOWN },
};

Thanks, I’ll try a little bit more tonight. I do make the assumption that If I successfully map the up key it will work in RGUI. The letter mappings work only after RetroArch detects the usb keyboard so I’m not too confident that the x-arcade is registering correctly. (First time with Arch Linux) But like I said evtest does list it as an available device and shows events registering from all controls so that seems good. I feel like maybe I need to modprobe something like “joydev” but the letter-associated buttons registered without that so… Of course somewhere I saw a retropie issue with multiple usb keyboards registering and causing retroarch confusion on detecting the device. I don’t think it’s related but It’s all linux based…

quick update: I was able to get results by loading the .retroarch.cfg in the user home directory directly. I did a hasty copy to /etc/retroarch.cfg but that didn’t seem to help. I might have pushed bad permissions with that copy. urk. The mapping works directly from evtest to the config so thank you so much.

Oh yeah, the one in /etc is just a skeleton for reference. It looks for them in ~/.config/retroarch first and foremost.

Got all of the keys mapped except for leftbracket. I pulled retroarch from the arch linux AUR. Is there a possibility I’m running a different build? I wouldn’t think so but I’m kinda stumped as to why the key’s not working. evtest shows KEY_LEFTBRACE. So the key(button) is working.

The AUR should pull from git, so you should be running the latest code. Did you try it with ‘leftbracket’ instead?

sorry for the confusion. leftbracket is what I’m using. that spelling.