libretro / libretro/RetroArch

Mouse Grab not enabled for Android

Open
#14,016 21 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

input input: mouse grab platform: android
Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Description

Description

When Enabling the Hotkey for Mouse Grab on Android (tested on versions 6, 10, and 12), It does not activate and leaves the mouse pointer freely move in the background. This causes problems for most games when the system mouse pointer leaves the bounds of the game and, for example, activates the top Android tray. When this happens, any mouse click takes you out of the game and into the Android pull-down notifications menu.

Attempting to activate Grab Mouse does nothing. Attempting to activate Game Focus Mode (which is supposed to also grab the mouse) will activate the mode, but the mouse is not grabbed.

Expected behavior

Mouse Pointer locks to the game screen allowing for full use of mouse or trackball without activating the OS functions.

Actual behavior

System and game mouse pointers remain separate and the system mouse pointer can leave the game screen causing issues with the OS.

Steps to reproduce the bug
  1. Bind Grab Mouse to physical key.
  2. Start game
  3. Press bound Grab Mouse key
Environment information
  • OS: Android versions 6, 10 and 12 (likely all versions)
Note

Android has supported mouse grab since version 8 and other open source emulators (notably Magic DosBox) use it to good effect.

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

Start by reproducing the Grab Mouse and Game Focus Mode behavior on Android, then trace the Android input handling used by those actions. Done means the pointer remains confined to the game screen and mouse clicks cannot activate the Android notification tray.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, c
Domain
mobile-dev
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.