libretro / RetroArch

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

RetroArch sometimes fails to read keyboard input correctly #8550

Open orbea opened 5 years ago

orbea commented 5 years ago

Description

Under some circumstances RetroArch fails to read keyboard input correctly and this can conflict with keybinds used by window managers or other programs.

For example when using using mod+arrow key (For the purpose of this issue mod is the windows key, but it could be other keys like alt) to switch between workspaces in a window manager RetroArch will correctly see that mod+arrow key is pressed and not do anything, but when switching back RetroArch will receive an arrow key as input instead of mod+arrow key which have unintended effects based on the specific key used.

This does not seem to be an issue with other programs such as firefox or libreoffice and seems to affect all video, input or menu drivers.

This entirely not working with a KMS context, but in practice its not really an issue there. I suspect this may also differ with a wayland or other contexts (I am using an x context)? Maybe the specific window manager might also make a difference?

Expected behavior

When RetroArch is receiving input it should always see that a key combination is being pressed instead of individual keys.

Actual behavior

Under some circumstances RetroArch will incorrectly see individual keys being pressed instead of a key combination.

Steps to reproduce the bug

  1. Get a window manager that can change workspaces with mod+arrow key. This should be easiest with unix based systems, but it should be possible with windows too?
  2. Start RetroArch with xmb which makes this easiest to observe.
  3. Switch to the next workspace with mod+right arrow.
  4. Switch back to the workspace with RetroArch with mod+left arrow.
  5. You should observe that the xmb menu has moved one tab to the left.

or with a KMS context this can be observed easier.

  1. Start RetroArch with a KMS context.
  2. Open a search dialog.
  3. Press mod+p.
  4. You should see that p is entered into the search dialog and that RetroArch did not see that mod+p was pressed instead of presumably mod and p. This doesn't happen with a x context.

Bisect Results

I went back to v1.3.6 and found no change in behavior.

Version/Commit

You can find this information under Information/System Information

Environment information

Blast-City commented 5 years ago

For example when using using mod+arrow key (For the purpose of this issue mod is the windows key, but it could be other keys like alt) to switch between workspaces in a window manager RetroArch will correctly see that mod+arrow key is pressed and not do anything, but when switching back RetroArch will receive an arrow key as input instead of mod+arrow key which have unintended effects based on the specific key used.

Just to add that on Steam, the video player also shows this behaviour so I'm starting to think that this is a Gnome problem.

What could the video player and Retroarch have in common that makes this problem appear? Other apps doesn't seem to suffer from it.

Does this happen on other UI's? XFCE, KDE etc...