libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.4k stars 1.84k forks source link

[Linux] [flatpak] Keyboard controls aren't working properly #5988

Closed ArclightMat closed 6 years ago

ArclightMat commented 6 years ago

Description

Keyboard input doesn't work in the interface properly, while certain keys such as arrow keys, enter and ESC are working, pressing any other input key (such as 'X', which is mapped to 'a') seems to be ineffective. This makes the menus impossible to navigate properly, since you can't go back after selecting an option with ENTER. Using a controller and manually mapping it works perfectly.

Expected behavior

Being able to select an option using a keyboard-mapped key such as 'X' or 'Z'.

Actual behavior

Unable to select anything using a keyboard-mapped key, basic navigation (enter, arrow keys) works fine, a controller is fully working.

Steps to reproduce the bug

  1. Install flatpak.
  2. Install RetroArch from flathub.
  3. Run RetroArch and try to use a "default" key.

Bisect Results

After a fresh 1.6.9 install (later updated to 1.7.0), input does work fine on a core such as Nestopia UE, so it is likely a issue with RetroArch itself, manually mapping it to a controller also works fine and it seems to receive input on "Input User 1 Bind" when you map it to keyboard again, but it doesn't work inside the RetroArch UI. Running it with --verbose on flatpak throws normal output even when loading it:


F: No installations directory in /etc/flatpak/installations.d. Skipping
F: Opening user flatpak installation at path /home/matheus/.local/share/flatpak
F: Opening system flatpak installation at path /var/lib/flatpak
F: Opening user flatpak installation at path /home/matheus/.local/share/flatpak
F: Opening system flatpak installation at path /var/lib/flatpak
F: Allowing host-fs access
F: Allowing x11 access
F: Allowing wayland access
F: Allowing pulseaudio access```

### Version/Commit

- RetroArch: [1.7.0/0a2b442]

### Environment information

- OS: [Fedora 27]
- Flatpak version: [0.10.2.1]
ArclightMat commented 6 years ago

As an additional note, I also found this bug on Debian 9 + flatpak, using the outdated version from its repository seems to be working, so it might be caused by flatpak or it is a RetroArch regression, I might end up trying to compile RetroArch directly if needed.

i30817 commented 6 years ago

turn on unified controls on the cfg file (maybe it's on the menu too).

I was also triggered by this a while ago, where they made the menu shortcuts different from in-game shortcuts without a way to reconfigure menu shortcuts (i have some broken keys on the portable). This was done because they didn't want for their 'unified' controls to interfere with text input on the RA menus.

(though, honestly, they just need a text input focus system for the menus instead).

i30817 commented 6 years ago

Also don't forget to turn on / use 'game_focus' toggle key. It will save you a lot of head-aches if you're going to use a keyboard (it toggles on/off all 'system' RA shortcuts while running a core. Not the 'input keybinds', the menus shortcuts). Its default is a bit hard to get on my keyboard (scroll lock) so i managed to miss it.

Since you want to use this when you use a core that uses text extensively, even certain bindings being set to a usable key in the core (keyboard 'x' serving as controller 'x' for instance) aren't that much of a problem in the cores because on most of them you won't be doing text input and using the controller at the same time, and on those that you are, they have text focus so the 'controller key' should be ignored while entering text (just remember tab cycles focus out if you get in trouble).

Probably also a good idea to turn a 'open menu' controller combination.

I personally also set several keys to "" (empty) on the main retroarch.cfg. Expecially the 'esc quits retroarch' default.

ArclightMat commented 6 years ago

Woah, you are indeed right, toggling unified controls on did the trick, I was going crazy thinking it was some weird bug with it interacting through flatpak since it was working fine on Windows and an old version on Debian. Thanks for the advice with keyboard mapping, I don't use the keyboard (RetroArch is best suited for a controller after all) that often but it is really nice for some quick 2/3-button controller platforms (NES, Genesis, GBx, etc) when I can't be bothered to get a controller.