libretro / libretro/RetroArch

Lightgun absolute mouse viewport/screen issue

Open
#13,255 3 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

An absolute mouse full coordinate range in lightgun mode gets mapped to the viewport rather than the screen.

Expected behavior

An absolute mouse's full coordinate range in lightgun mode should get mapped to the whole screen rather than to the viewport. Some absolute mice are lightguns calibrated to return coordinates over the whole screen. Other absolute mice, I assume, are things like Wacom and touchscreen devices, where once again the drawing area is the whole screen.

Actual behavior

Pointing a lightgun to the left/right edge of the screen moves the pointer to the left/right side of the viewport. Pointing a lightgun to the left/right edge of the viewport moves the pointer to positions proportionately inset in the viewport.

This is an easy fix. In input/drivers/udev_driver.c, I just replaced the udev_mouse_get_pointer_xy functions with:
https://gist.github.com/arpruss/b594628efc3610c37847426bdb3b3d60

The result is what seems to me to be correct behavior: absolute mouse coordinates match up with the screen not the viewport.

Version/Commit

You can find this information under Information/System Information

  • RetroArch: latest from Github
Environment information
  • OS: Raspbian Stretch
  • Compiler: gcc

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 in input/drivers/udev_driver.c by reading udev_mouse_get_pointer_xy and comparing them with the replacement linked in the issue. Reproduce or inspect absolute-mouse behavior in lightgun mode, then verify that the full coordinate range maps to the whole screen rather than the viewport.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.