-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Overlay Mouse, Lightgun, and Pointer #16343
Add Overlay Mouse, Lightgun, and Pointer #16343
Conversation
- When enabled, any touch inputs not in a hitbox are used to create pointing device input for the core. - Mouse: 1-, 2-, 3-touch inputs are LMB, RMB, and MMB - Lightgun: allows input from overlay buttons or multi-touch mappings
This sounds great. We should probably copy this commit description to the docs site, as it will get lost in the shuffle here, and there's a lot of obscure knowledge (like the multi-finger tap commands) that users will never figure out on their own. |
Sure. I don't think it's so obscure, but I wrote it. I'll find a place to add this in the docs. |
static void input_overlay_poll_lightgun(settings_t *settings, | ||
input_overlay_t *ol, const int old_ptr_count) | ||
{ | ||
input_overlay_state_t *ol_state = &ol->overlay_state; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable is unused
The combined overlay/touchscreen input is working on iOS as I would have expected. Very nice, thanks! |
@warmenhoven Oh thanks, iOS is always the platform I wish I could test with this kind of thing |
It looks like I should explain the mouse buttons in a sublabel, and remove an unused variable. In the docs I only saw the touchscreen mouse explained for the Switch, and it's very different from Android's which this PR roughly follows. |
- When enabled, any touch inputs not in a hitbox are used to create pointing device input for the core. - Mouse: 1-, 2-, 3-touch inputs are LMB, RMB, and MMB - Lightgun: allows input from overlay buttons or multi-touch mappings
Add Overlay Mouse, Lightgun, and Pointer
This creates mouse, lightgun, and pointer input as the overlay is polled. When enabled, touch inputs not in a hitbox are assumed to be pointing device input for the core.
The main benefit is that overlay buttons can be used simultaneously, so things like mouse-controlled 1st-person shooters and touchscreen emulation are more natural.
Mouse behavior
1/2/3-finger taps are LMB/RMB/MMB clicks. A 0.2s long press begins holding a button, and you'll feel haptic feedback when it starts. A double-tap hold method is also available but adds latency to clicks. Dragging 2/3 fingers immediately holds the RMB/MMB.
There are settings for mouse speed, long-press and double-tap time thresholds, and a "swipe threshold" to distinguish swipes from taps and long presses.
Lightgun behavior
Lightgun x, y, and trigger are normally sent together to every lightgun port. There are settings to choose the port, disable the trigger, delay the trigger, and clamp off-screen aim to the in-bounds edge. The trigger delay is needed for content that doesn't instantly move the gun cursor to a screen tap.
More lightgun buttons can be assigned to 2/3/4-finger inputs. The trigger delay is used to wait for the correct multi-touch count. A 1-frame delay is usually enough to distinguish these inputs.
Notes
Related Pull Requests
The lite/SNES and lite/SNES_2 overlays in libretro/common-overlays#111 each include a lightgun overlay with buttons on the perimeter.
Worth a note: The existing lite/DOS and lite/DOS_2 overlays are already set up for 1st-person shooters, since each can hide the ABXY buttons.
Related Issues
Fixes #15452 #15749 #15973