1219 Commits

Author SHA1 Message Date
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
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
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
zoltanvb
d5dd3689fc
Support for lightgun in Wayland input driver (#17152) 2024-11-03 18:14:41 -06:00
sonninnos
5e2409471a
Dinput: Mouse pointer send proper return value instead of flag value (#17067) 2024-10-01 17:36:49 -07:00
Viačasłaŭ
3019b926c2
Fix typos (#17068) 2024-10-01 17:36:33 -07:00
Eric Warmenhoven
b557bc9523
Fixing compiler warnings (#17001) 2024-09-14 13:11:20 -07:00
libretroadmin
8ba57c77e0 (winraw_input) Simplify code 2024-09-10 18:18:26 +02:00
Eric Warmenhoven
cfbfd01f38
iOS: Last bits of iOS 12 support, including loading an older MoltenVK library (#16982) 2024-09-09 21:27:29 -07:00
libretroadmin
55f737195e (Winraw) Use flags 2024-09-09 19:06:43 +02:00
libretroadmin
b8391e233f * PATH_MAX_LENGTH redefined from 4096 to 2048
* Massive reduction in heap space allocation, going from settings struct
264kb to 119Kb
* Use NAME_MAX_LENGTH for base paths/names, etc
* Use DIR_MAX_LENGTH for directory sizes
2024-09-09 05:47:32 +02:00
Eric Warmenhoven
d228c9d469
iOS: More fixes to enable running on iOS 12 (#16978) 2024-09-08 03:10:30 -07:00
Eric Warmenhoven
4503b3989f
iOS: Better mouse grab (#16933) 2024-08-27 01:53:18 -07:00
Eric Warmenhoven
800be5530f
iOS: Better handling of physical mice/magic keyboard trackpad (#16911) 2024-08-22 12:11:16 -07:00
zoltanvb
7db9a2de60 Test input driver and sensor test screen
A new input driver (test_input), similar to test joypad driver.
Takes its inputs from a json file provided in options. Supports
keyboard input and sensor input (accelerometer, gyroscope,
illuminance).

Remote Retropad extended with a sensor test screen.
2024-07-06 13:55:55 -05:00
zoltanvb
286d65b42e [X11] Support for mouse buttons 4 and 5
Support added for extra mouse buttons. Since these buttons were
not returned by XQueryPointer(), some additional logic was needed
which fit best to scroll wheel handling.
2024-06-25 08:18:51 -05:00
schellingb
e7c6d1df84 Fix keyboard events missing RETROKMOD_NUMLOCK or RETROKMOD_SCROLLOCK
- Add missing numlock mod to dinput
- Add missing scrolllock mod to x11
- Add missing capslock, numlock, scrolllock and meta mods to android
- Add missing scrolllock mod to sdl
- Add missing capslock, numlock, scrolllock and meta mods to switch
- Add missing numlock mod to winraw
- Add missing numlock mod to uwp
2024-06-25 08:18:29 -05:00
zoltanvb
3b21273858 [Wayland] Support for mouse buttons 4&5 and horizontal wheel 2024-06-19 18:40:15 -05:00
That One Seong
4220ad0b7c udev mouse buttons 4/5 fixed
According to evdev docs, mouse side buttons are simply `BTN_4/BTN_5`?
2024-06-14 19:48:33 -05:00
hunterk
65e8871250 restore some relative pointer stuff 2024-06-10 07:35:24 -05:00
hunterk
c72f8613d8 revert abcd42777f7c17559cf6eb509dc86aca63e48527
since it appears to be involved with a variety of input issues: https://github.com/libretro/RetroArch/issues/15757
2024-06-10 07:35:24 -05:00
libretroadmin
d36f15a867 Buildfix for CLI 2024-04-06 20:15:54 +02:00
Patrick Stankard
5452999b2a
Fix mouse grab behavior on Android (#16203)
* Add grab_mouse interface for Android
Makes mouse grabbing and 'Game Focus' work on Android with a real mouse
Properly handle relative mouse motion events on Android (SDK 28 and newer)

* Enable workflow_dispatch on CI Android

* Update android_mouse_calculate_deltas callsites

* Add RETRO_DEVICE_MOUSE to android_input_get_capabilities

* Use Handler to trigger UI events (toggle mouse, immersive mode) with 300ms delay

* Enable input_auto_mouse_grab by default for Android

* Handle RARCH_DEVICE_MOUSE_SCREEN in Android input driver

* Add android.hardware.type.pc to manifest

* Don't attempt to set pointer speed via scaling in android_mouse_calculate_deltas

* Keep x/y values within viewport resolution for screen mouse

* Use video_driver_get_size to get width/height

---------

Co-authored-by: Bernhard Schelling <14200249+schellingb@users.noreply.github.com>
2024-03-19 05:33:02 -07:00
sonninnos
6e6a4d8b6d
RETROK_UNKNOWN fixes and cleanups (#16250) 2024-02-18 08:23:05 -08:00
Patrick Corrigan
066a0629ff Fix actual parameter for mouse y in translate coord 2024-02-14 15:31:56 +01:00
Eric Warmenhoven
d8c444d44d
iOS - Default to not enabling keyboard gamepad (#15340) (#15955) 2023-11-26 19:34:45 -08:00
zoltanvb
c42498e531
Warning fixes. (#15877) 2023-11-06 00:04:17 -08:00
Joe Osborn
862bebf687
(Emscripten) Modularize the JavaScript and clean up the web build (#15688)
* Increase emscripten stack size and decrease path size to fix emscripten builds broken since de45fc2

* use modularize flags for better-behaved javascript output

* makefile and loader changes

* use specialHTMLTargets to support modular access to canvas

* bind key events to canvas, not document

This way focus means focus and we can have multiple RA instances in
one page.

* Work around an emscripten bug in strict mode

* (Emscripten) Use console.error() for error messages

* increase asyncify stack size

* Fix `-lm` flag-related compile warnings in emscripten

---------

Co-authored-by: Rob Loach <robloach@gmail.com>
2023-11-02 13:25:50 -07:00
Eric Warmenhoven
dfeeb031fe
Fix mouse support for melondsds on osx (#15837) 2023-10-30 15:33:17 -07:00
GavinDarkglider
5356afc750
Minor fixes to udev input drivers. Add support for canary builds to lakka updater stuff (#15818)
* Input: Udev: Fix touch support building against older kernel headers

* Input: Udev: Fix Touch Deep Debug compile issues

* Input: Joypad: Udev: Joypad: Add Change detection for udev events

This is handy with controllers like the Nintendo Joycons that have a daemon
app in the background to handle combining them into one controller(Joycond)

Since the device was already added, but joycond clamped permissions on evdev
retroarch was never updating the controller input change, this fixes that issue.

Note: Needs a patch in joycond as well, to send change uevent.

This shouldnt cause any issues with other controllers, as the kernel probably
will never send change events for these device types.

* Lakka: Add canary builds to updater
2023-10-25 08:19:00 -07:00
libretroadmin
e407d9a7b2 (Udev) style nits/cleanups 2023-08-16 15:45:50 +02:00
Max Kupriianov
2f16e115a7
[android] fix d-pad regression introduced in abcd42777f7c17559cf6eb509dc86aca63e48527 (#15601) 2023-08-16 05:58:44 -07:00
libretroadmin
0a96f9595c Explicit typecasts to bools for flags 2023-08-16 04:18:55 +02:00
libretroadmin
f51b49f213 More explicit typecasts to bools 2023-08-16 03:22:02 +02:00
Max Kupriianov
abcd42777f
refactor: rewrite input handling to better support AINPUT_SOURCE_STYLUS (#15597)
Resolves issues with S-Pen on Samsung devices, also adds support for S-Pen button
that is handled as r-mouse click now.
2023-08-15 11:13:53 -07:00
libretroadmin
c8e6506687 Fix --disable-menu errors 2023-08-14 23:36:19 +02:00
sonninnos
d8f9310100
(DINPUT) Mouse flag cleanup (#15575) 2023-08-11 07:17:07 -07:00
sonninnos
c798cbaf3f Enable overlay by default only on mobile + winraw overlay fix 2023-07-18 21:26:23 +02:00
sonninnos
b92540b24d (udev) Log mouse devices in info level 2023-06-18 19:43:38 +02:00
Grisly Glee
4202f8650d
Fix trivial signedness warnings (#15377)
* Fix trivial signedness warnings

* Followup on trivial signedness warnings
2023-06-14 04:43:11 +02:00
Eric Warmenhoven
6c831b25a6 Restore "macOS Cocoa: fix mouse grab in windowed mode."
This reverts commit 269c90242901ffa8261e64f49cf49d8665efb98e, with a
build fix.
2023-06-06 01:52:13 +02:00
libretroadmin
269c902429 revert 2023-06-04 16:28:59 +02:00
libretroadmin
63bf68d616 Cover both HAVE_COCOA and HAVE_COCOA_METAL for now 2023-06-04 16:09:49 +02:00
libretroadmin
794b430bac cocoa_input_grab_mouse - compile it in only for regular Cocoa, not CocoaTouch 2023-06-04 16:08:24 +02:00
libretroadmin
1352036133 (cocoa_input.m) Cleanups 2023-06-04 16:03:55 +02:00
libretroadmin
cd6aec70ac Buildfix for iOS/tvOS 2023-06-04 15:51:02 +02:00
Alexander Kozharsky
167c52ec77 macOS Cocoa: fix mouse grab in windowed mode. 2023-06-04 14:51:04 +02:00
Bernhard Schelling
189542ea5f Prevent the android quick tap mouse click emulation while pressing a button on the on-screen overlay 2023-06-01 18:34:37 +02:00
anaximan
bd59d35498 Fixed the corner tapping toggle 2023-06-01 15:56:09 +02:00