libretro / libretro/RetroArch

Phantom key bindings when changing focus to RetroArch

Open
#16,714 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Description

Description

When I switch focus to retroarch on Linux+X11, the key that was used to switch the focus to will be registered as a key press.

This happens in multiple cases:

  1. when changing to the workspace where RetroArch is
  2. when using Alt+Tab to change the focus to RetroArch
  3. maybe other cases
Steps to reproduce the bug

This is for case 1 (see above)

  1. Start Linux with X11 and e.g. KDE
  2. Bind a key binding "Win+F4" to the action "Switch to workspace 4"
  3. Go to workspace 4 and start RetroArch there
  4. Go to workspace 1
  5. Press Win+F4 to go to workspace 4
Expected behavior

This should open workspace 4 without triggering any action inside RetroArch

Actual behavior

RetroArch will register a F4 key press, triggering a quickload of the current savegame, erasing the current state of the game.

The same happens when I bind the Tab key to e.g. "Fast Forward (toggle)" and then press Alt+Tab to focus RetroArch: It will trigger the "Fast Forward (toggle)" action unintentionally.

I realize that this is almost "normal" in gaming software, but it should not be. Depending on the exact key bindings of the user, it can trigger all kinds of unintentional actions. This is seriously bad, and I believe we can do better than this.

Version/Commit
  • RetroArch: 1.18.0
  • Git Version: 06fa5325f8
Environment information
  • OS: ArchLinux with X11 and KDE+i3wm

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the focus-switching cases on Linux with X11, KDE, or i3wm using the Win+F4 and Alt+Tab bindings described in the issue. Trace the input and focus handling to determine where the switching key becomes a RetroArch press; done means changing focus no longer triggers the corresponding in-game action.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
desktop-dev, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.