97 Commits

Author SHA1 Message Date
neil4
fbd8498686
Overlays: Apply range_mod only for the touch inputs that trigger it (#15534) 2023-07-30 09:49:59 +02:00
nfore
9ca5c5e623 Revive/rewrite Keyboard Overlay and OSK Toggle
Add keyboard overlay preset, keyboard submenu, and osk_toggle hotkey. Use overlay caching for osk_toggle.

For now, keyboard menu has only preset path, auto-scale toggle, and opacity.

Related fixes:
- input_keyboard_event: Don't check hotkey binds when device is RETRO_DEVICE_POINTER
- Add input_keymaps_translate_rk_to_ascii() for correct character input to input_keyboard_event
- input_overlay_poll: Delay clearing INPUT_OVERLAY_BLOCKED flag until there is no overlay input (Avoids stray input after osk_toggle)
- Send keyboard events for modifiers before other keys (for correct modifier+key input if hitboxes overlap)
2023-07-09 04:42:49 +02:00
nfore
8a81d39437 Overlay Caching
Adds overlay_cache_ptr to keep a disabled overlay in memory when it's expected to be shown again.

Most input_overlay_deinit calls are replaced with input_overlay_unload, which caches the overlay unless initing/deiniting core or disabling overlays.

Loading a cached overlay is done as a swap, intended for osk_toggle.

Related updates:
- Fewer parameters for the overlay loading task. Use current settings when enabling an overlay
- Add input_overlay_check_mouse_cursor() to preserve show/hide mouse behavior
- Don't apply input_overlay_show_mouse_cursor in windowed mode (controlled by mouse grab only)
- Remove some dead code
2023-07-09 04:42:49 +02:00
libretroadmin
c0ba738f0d Header uniformity - enums on top, then structs, then public declarations 2023-05-30 21:03:36 +02:00
Valentin
b0b5a40d44
add overlay parameter to control x/y separation in auto-scale mode (#15106) 2023-03-31 01:33:39 +01:00
libretroadmin
f062b74e26 Overlays/Input: Turn a bunch more functions static 2022-11-23 19:54:15 +01:00
libretroadmin
aa0ae2cd3e Silence warnings 2022-11-22 18:34:04 +01:00
neil4
3b0db75782
Overlay cleanups; replace bools with flags (#14661) 2022-11-22 18:29:11 +01:00
neil4
3de186e374
Overlays: Ignore hitboxes with zero area (#14619)
I.e. Set 'reach_x' or 'reach_y' to zero to ensure no hitbox math is done

nits
2022-11-13 10:46:41 +01:00
neil4
217fba48c5
minor overlay-related fixes (#14594)
input_overlay_loaded: Only update menu entries if changed

input_overlay_add_inputs: Set 'updated' for analogs when touched
2022-11-06 17:25:44 +01:00
neil4
b47fb0b807
Overlays: Add 'reach' and 'exclusive' for hitboxes (#14591)
Allows stretching hitboxes and handling their overlap

reach_up, reach_down, reach_left, reach_right:
- Stretches in one direction:
reach_x, reach_y
- Stretches symmetrically

exclusive:
- If true, blocks input from overlapped hitboxes
range_mod_exclusive:
- Similar, but only applies when this hitbox is extended by range_mod
- After range_mod takes effect, has priority over 'exclusive'

E.g. This creates a D-Pad area and extends its hitbox left & right 50%, up 15%, and down 30%. Then applies range_mod_exclusive:
overlay0_desc0 = "dpad_area,0.15,0.57,rect,0.166228,0.295516"
overlay0_desc0_reach_x = 1.5
overlay0_desc0_reach_up = 1.15
overlay0_desc0_reach_down = 1.3
overlay0_desc0_range_mod = 2.0
overlay0_desc0_range_mod_exclusive = true
2022-11-05 21:32:22 +01:00
neil4
2de52baf74
Overlays: Add eightway area types (#14565)
- New descriptors: 'dpad_area' and 'abxy_area'
- Each has a diagonal sensitivity setting, 100% being 8-way symmetry
- Buttons can be redefined in the cfg file

E.g. This would create a d-pad area, then redefine it to use analog directions:
overlay0_desc0 = "dpad_area,0.85,0.57,rect,0.166228,0.295516"
overlay0_desc0_up = "r_y_minus"
overlay0_desc0_down = "r_y_plus"
overlay0_desc0_left = "r_x_minus"
overlay0_desc0_right = "r_x_plus"
2022-10-30 06:31:27 +01:00
LibretroAdmin
4c7e316aa2 Turn functions static 2022-08-17 16:47:44 +02:00
twinaphex
dbe414e1e1 move input_poll_overlay to input_driver.c 2021-09-30 21:29:35 +02:00
twinaphex
6c79cebc6e Move input_overlay_auto_rotate_ out of retroarch.c and into
input_driver.c
2021-09-09 14:24:42 +02:00
twinaphex
276b4fd72c Move more code over from retroarch.c to input_driver.c 2021-09-07 13:08:31 +02:00
twinaphex
67defbcf26 Transfer code over from retroarch.c to input_driver.c 2021-09-07 12:42:03 +02:00
jdgleaver
8e54b4cec9 (Show Inputs on Overlay) DISABLE_MENU=1 buildfix + Qt settings update 2021-05-26 18:15:23 +01:00
Jonathan
5c6cd1b48a
Add scaling to pointer input (#12213)
So far, if display is scaled, overlays gets correctly drawn but touch
input is not correctly scaled, resulting in an unusable overlay.

This happens for touches in menu too.

This commit aims to introduce this scaling factor adding it to the
config file, eg:

input_touch_scale = "2"
2021-04-06 13:15:43 +02:00
twinaphex
11b4043ef6 Struct reordering 2020-09-20 23:23:31 +02:00
jdgleaver
8a5ebbf24d Add option to scale overlays automatically (with aspect ratio correction) 2020-09-17 17:23:07 +01:00
twinaphex
ab517428fd Reorder structs, alignment 2020-09-11 12:53:18 +02:00
jdgleaver
b8ea4fd54e Overlay configuration improvements 2020-09-08 13:37:51 +01:00
jdgleaver
cc2e098dab Add option to hide overlays when a gamepad is connected (Note: Restricted functionality on Android) 2020-08-25 11:12:37 +01:00
twinaphex
14e20cea51 Cleanups 2020-07-01 15:29:25 +02:00
parport0
a4590acde9 Add options for moving the on-screen overlay 2020-06-11 15:39:23 +03:00
jdgleaver
1df3e20bdd Add option to automatically rotate overlays 2019-10-04 12:15:57 +01:00
twinaphex
9e39220390 Turn function static 2019-07-18 17:35:41 +02:00
twinaphex
fa990849ba (Overlay) Cleanups 2019-07-10 07:07:28 +02:00
twinaphex
fa2e1fb0c1 overlay_ptr is now a static global variable inside retroarch.c 2019-07-10 06:53:47 +02:00
twinaphex
94af95e1b9 Start refactoring this - overlay_ptr needs to become a static
global variable confined inside retroarch.c
2019-07-10 04:43:50 +02:00
twinaphex
8dd0680cbc Merge input_overlay.c into retroarch.c 2019-07-09 18:13:41 +02:00
twinaphex
386657a366 (menu widgets backport) Re-commit task queue changes 2019-02-08 08:00:32 +01:00
twinaphex
7022786f34 Revert parts of menu_widgets that were causing breakage, but leave
all the hooks in so we can add them back piece by piece again
2019-02-08 07:26:43 +01:00
natinusala
c20ab3864d First version of menu widgets (gl only) 2019-02-06 20:48:24 +01:00
twinaphex
a82bb0ec94 Create special type input_bits_t 2018-04-08 20:21:12 +02:00
twinaphex
fae9223641 Remove hashes from task_overlay 2018-02-25 13:03:54 +01:00
Ian House
5311544c65 Added overlay led driver, fixed a bug in the rpi led driver 2018-01-04 12:56:57 -05:00
David Walters
adffa5fc4c Fixes for overlay buttons 2017-12-17 12:36:18 +00:00
gblues
6904101c44 Clean up trailing whitespace
== DETAILS

Really simple code cleanup, because my editor flags trailing whitespaces
and it's pretty annoying.
2017-12-12 00:24:18 -08:00
twinaphex
5b9f90dd9a (input overlay) Reorder variables in struct 2017-09-29 17:11:42 +02:00
denu8thell
0df4186191 reduce scope of input_overlay_add_inputs to file. 2017-08-08 02:48:46 -05:00
denu8thell
4c31d41920 Moved input_overlay_add_inputs call out of input_driver.c, shortened arguments. 2017-08-08 02:31:26 -05:00
denu8thell
c882e64653 Added button press lightup on overlay.
input_overlay_add_inputs added, still need to implement dpad and analog visuals on overlay. Also still needs to be restructured so input_overlay_post_poll is only called once.
2017-08-07 21:59:05 -05:00
twinaphex
96c8ca5a09 Header update #1 2017-01-22 13:40:32 +01:00
twinaphex
92ca53db01 No more usage of settings_t inside input_overlay.c 2017-01-01 04:57:57 +01:00
twinaphex
6d4659a902 (overlay) Reduce dependence on grabbing settings pointer everywhere 2017-01-01 04:12:24 +01:00
twinaphex
4e8bb52038 (input_overlay.c) Remove more hacks 2016-11-27 15:21:53 +01:00
twinaphex
267fdbe21e (input_overlay.c) remove more hacks 2016-11-27 15:17:44 +01:00
twinaphex
bbb2ffea9c Remove nasty input overlay hack for input_overlay_set_scale_factor 2016-11-27 15:10:09 +01:00