4493 Commits

Author SHA1 Message Date
LibretroAdmin
9bff7168e8 (input_driver.c) Style nits 2025-01-18 03:11:24 +01:00
sonninnos
aefadc04c7
Analog to Digital refactor (#17429) 2025-01-18 02:19:01 +01:00
LibretroAdmin
984d591573 Silence some warnings 2025-01-18 01:48:33 +01:00
LibretroAdmin
b211adaaca Function argument name standardization 2025-01-17 19:55:32 +01:00
LibretroAdmin
e2c8e98be0 Buildfixes and warning fixes 2025-01-17 12:03:30 +01:00
LibretroAdmin
31b7812720 Function argument name standardization 2025-01-17 04:16:12 +01:00
LibretroAdmin
9da7af46c3 len variable/argument name standardization 2025-01-15 16:04:25 +01:00
LibretroAdmin
047e04ed3e Standardize local len variable naming conventions 2025-01-15 15:00:12 +01:00
Jesse Talavera
0bb0077358
Fix a crash when initializing an illuminance sensor on Linux (#17408) 2025-01-13 21:54:52 +01:00
LibretroAdmin
47d888364d Standardize len variables - argument should always be named 'len',
while local len variables should have '_' prefix
2025-01-13 21:53:49 +01:00
sonninnos
17e9aabd25
WINRAW: Invert mouse order (#17376) 2025-01-10 12:21:33 +01:00
LibretroAdmin
fc48ecaa1d Local 'len' variables need to prefixed with '_', inner-loop len
variables need to be prefixed with '__'
2025-01-07 02:57:24 +01:00
zoltanvb
ab3b175848
Restore missed absolute mouse conversion. (#17343) 2025-01-05 03:50:47 +01:00
neil4
6412f4feef
Overlay: Add Analog Recentering Zone (#17339) 2025-01-04 03:19:02 +01:00
neil4
2ffe9fe15c
Overlay lightgun fixes (#17340)
- Fix the "Allow Off-Screen" setting not working since #17308
- Prevent offscreen shot from disabling the lightgun with some cores
- Fullscreen pointer coordinates no longer needed
2025-01-04 03:18:38 +01:00
Eric Warmenhoven
7161069cfc
overlay: reinitializing was causing the wrong overlay to show (#17331) 2025-01-02 07:24:57 +01:00
zoltanvb
401e169865
Pointer sanitization, rwebinput driver (#17327) 2025-01-01 23:14:42 +01:00
Ignacio Sanchez Gines
b5a62fcdf8
Add lightgun support to cocoa input driver (#17318) 2025-01-01 23:11:08 +01:00
LibretroAdmin
ae7951445a Remove unused variables 2024-12-31 11:49:02 +01:00
zoltanvb
b66263a034
Adapt the sanitized pointer handling, discussed at libretro#17196 : (#17312)
Cocoa driver specific changes:

- make sure pointer position is always within [-0x7fff,0x7fff] by using the confined wrapper
- enable pointer offscreen query
2024-12-30 23:50:02 +01:00
zoltanvb
fe1575bc54
Input sanitization, wayland enhancement and overlay (#17308)
Adapt the sanitized pointer handling, discussed at #17196 :

Overlay "driver" specific changes:

- make sure pointer position is always within [-0x7fff,0x7fff] by using the confined wrapper
- enable pointer offscreen query
- report -0x8000 for lightgun if pointer is at the edge
- align lightgun offscreen reporting and button ID conversion with other drivers

Android driver specific changes:

- make sure pointer position is always within [-0x7fff,0x7fff] by using the confined wrapper
- remove extra "inside" checks, general simplification
- enable pointer offscreen reporting
- report same value for all ports when querying mouse and lightgun
- fill missing lightgun support, with fixed button map

Udev and X11 driver specific changes:

- simulate max. 3 touches instead of 1 using different mouse buttons

Wayland driver specific changes:

- integrate touch input better to the overall handling (enabling overlay usage with mouse)
- simulate max. 3 touches instead of 1 using different mouse buttons
2024-12-29 18:57:27 +01:00
Aleksey Samoilov
9ffb458626
wayland: add support for single-pixel-buffer-v1 protocol (#17298)
* wayland: add support for single-pixel-buffer-v1 protocol

* Create single pixel buffer instead of checkerboard if available

* Fix identations
2024-12-29 18:56:32 +01:00
Aleksey Samoilov
4fc6bbe8c2
wayland: improve logging (#17291)
* wayland: improve logging

* wayland: minor cleanup
2024-12-27 15:51:13 +01:00
LibretroAdmin
18c85b5ccd Cleanups -
* Less string copies
* Some general cleanups
* Add extra param to runloop_message_queue_push so we can pass size_t
of the message
* Consistent conventions for local variable usage for certain things
2024-12-27 15:13:45 +01:00
Aleksey Samoilov
a2d9c74978
wayland: add support for content-type-v1 protocol (#17288)
* wayland: add support for content-type-v1 protocol

* update gitignore, remove generated files

* Fix typos
2024-12-27 00:16:36 +01:00
zoltanvb
ac6b30471b
Pointer sanitization - sdl (#17286) 2024-12-25 17:55:13 -06:00
Aleksey Samoilov
7887719d42
wayland: add support for cursor-shape-v1 protocol (#17284)
* wayland: add support for cursor-shape-v1 protocol

* Bump required wayland-protocols to 1.32
2024-12-25 08:18:45 -08:00
zoltanvb
e5fde4dd09
Pointer sanitization - winraw, dinput, sdl (partial) (#17283)
Adapt the sanitized pointer handling, discussed at libretro#17196 :

winraw and dinput driver specific changes:

    make sure pointer position is always within [-0x7fff,0x7fff] by using the confined wrapper
    remove extra "inside" checks, general simplification
    enable pointer offscreen reporting
    use common functions for edge detection and lightgun button ID conversion

sdl driver specific changes:

    pointer handling aligned with the other input drivers, as above
    added TODO for lightgun part - no suitable test env at the moment where SDL input can be used
2024-12-25 08:18:17 -08:00
libretroadmin
44238e909f Consistent viewport naming conventions 2024-12-24 22:50:51 +01:00
zoltanvb
6a85844b41
Pointer sanitization - x11, udev (#17281)
Adapt the sanitized pointer handling, discussed at #17196 :

X11 driver specific changes:

    make sure pointer position is always within [-0x7fff,0x7fff] by using the confined wrapper
    remove extra "inside" checks, general simplification
    enable pointer offscreen reporting

Udev driver specific changes:

    remove custom calculation and use common viewport translation
    unify pointer query instead of separate _x and _y
    enable pointer offscreen reporting

Other changes:

    more tuning of pointer conversion in video_driver.c for edges
    lightgun button ID conversion moved to input_driver.c
2024-12-24 07:08:58 -08:00
libretroadmin
442b9bc3da Syntax style nits 2024-12-23 05:44:40 +01:00
zoltanvb
072d949346
Pointer handling sanitization - wayland and libretro.h changes (#17277)
Adapt the sanitized pointer handling, discussed at #17196:

Wayland driver specific changes:
- make sure pointer position is always within [-0x7fff,0x7fff]
  by using the confined wrapper
- enable lightgun to report -0x8000 if pointer is really offscreen
- remove extra "inside" checks
- report same pointer/lightgun coordinates for all ports
- simplify pointer and lightgun handling

Other changes:
- unify "offscreen" condition through input_driver.c
- slight tuning of pointer conversion in video_driver.c
- update libretro.h with explanation and pointer offscreen value
- small fixes on remote retropad test screen
2024-12-21 13:28:27 -08:00
sonninnos
dc7e8e1811
Prevent stuck Game Focus dupe keyboard event (#17273) 2024-12-20 09:38:01 -08:00
zoltanvb
30a656738b
Introduce video_driver_translate_coord_viewport_wrap clamping variant. (#17196)
Add another version of the coordinate translation that will not
report -0x8000 for offscreen values, but instead map the position
to the respective edge (0x7fff/-0x7fff). Not yet in use.

Udev driver updated to use the wrapper, as all other input drivers do.
2024-12-19 13:30:43 -08:00
libretroadmin
17fc55c762 fill_pathname_parent_dir_name - small cleanups 2024-12-19 21:05:43 +01:00
Jesse Talavera
d682917e44
Add Linux support for illuminance sensors (#17208)
* First crack at light sensor support for Linux

* Add light-sensor support to most Linux input drivers

* Fix a compiler error

- Whoops, forgot to declare `sdl`

* Refactor linux_illuminance_sensor_t

- Allow the poll rate to be specified
- Poll the sensor on a separate thread
- Open a file handle each time we poll the sensor, since sysfs doesn't update the contents of an existing handle

* Set the `done` flag when closing the light sensor

- Whoops

* Avoid a division by zero when updating the poll rate of an existing sensor

* Don't try to open illuminance sensors from ".", "..", or hidden files

* Never mind

* Fix some silly mistakes

* Skip hidden files, ".", and ".."

* Cancel the sensor poll thread mid-sleep when closing it

- POSIX says it's fine

* Add to CHANGES.md

* Address feedback given on PR

* Use libretro-common's file system instead of stdio
2024-12-17 05:49:39 -08:00
Eric Warmenhoven
7e49b3d3d3 overlay: fix crash on null pointer 2024-12-16 15:59:32 +01:00
zoltanvb
5cfaf09f55
Support for analog L2/R2 values when a DS3 controller is used with PS Vita. (#17261) 2024-12-15 09:24:13 -08:00
redenvelope2000
7be52caff8
Update input_driver.c to improve the classic toggle turbo function (#17252)
Changed the logic of the classic toggle turbo mode code such that the pressing order of the turbo button and the button to enable/disable does not matter.
2024-12-15 09:23:59 -08:00
Eric Warmenhoven
48f156fefe
Fix uninitialized variable (#17256) 2024-12-13 09:55:38 -08:00
Eric Warmenhoven
cf986c0424
overlay: don't rely on menu entry, it can be misleading (#17247) 2024-12-10 22:32:15 -08:00
Eric Warmenhoven
f83841df38
probably fix crash setting overlay (#17243) 2024-12-09 20:47:29 -08:00
Eric Warmenhoven
99c2676efa
Add option to load overlay based on system name (#17233) 2024-12-07 23:58:33 -08:00
libretroadmin
2809421d4e Revert "static variables are initialized to '0' automatically as per C rules"
This reverts commit 2a0984b6e47b5f714ce4a360afeaadafdb634c36.
2024-11-19 03:03:13 +01:00
libretroadmin
82e4504968 Revert "(pt. 2) static variables are initialized to '0' automatically as per C rules"
This reverts commit 47410df7a3d2480dd8fc7fb97cf00319ce5e9344.
2024-11-19 03:03:05 +01:00
libretroadmin
47410df7a3 (pt. 2) static variables are initialized to '0' automatically as per C rules 2024-11-18 15:59:46 +01:00
libretroadmin
2a0984b6e4 static variables are initialized to '0' automatically as per C rules 2024-11-18 15:33:34 +01:00
Bernhard Schelling
c039576441
Fix quick shift key presses getting ignored on dinput driver (#17185)
Because shift keys were ignored in the event message  and only issued during polling, a quick key press and release between polling would get ignored.
This change also fixes left alt up key events getting issued (and sent to the core) twice.
2024-11-14 13:44:41 -08:00
sonninnos
c27075d9d6
Ignore other hotkeys with menu toggle (#17165) 2024-11-06 00:19:00 -08:00
zoltanvb
d5dd3689fc
Support for lightgun in Wayland input driver (#17152) 2024-11-03 18:14:41 -06:00