Commit Graph

68 Commits

Author SHA1 Message Date
ad1511982a InputCommon/SDL: Add touchpad inputs. 2024-12-04 21:08:18 -06:00
8c3b9c9cf6 Merge pull request #13174 from jordan-woyak/sdl-battery
ControllerInterface/SDL: Add Battery Input.
2024-12-04 21:46:07 -05:00
0f2c2c7ae0 Merge pull request #13156 from jordan-woyak/sdl-no-wgi
ControllerInterface/SDL: Disable SDL's Windows.Gaming.Input controller handling.
2024-11-17 21:51:56 +01:00
83ed817ad2 ControllerInterface/SDL: Add Battery Input. 2024-11-04 22:24:42 -06:00
2f1390e9f9 InputCommon: Rename AddAnalogInputs to AddFullAnalogSurfaceInputs. 2024-11-03 15:06:50 -06:00
2f38a00534 InputCommon: Disable DualSense Player LED 2024-11-02 16:49:36 -07:00
d361d4ba6e ControllerInterface/SDL: Fix device removal event processing. 2024-10-31 14:11:27 -05:00
19c3b88e5a ControllerInterface/SDL: Disable SDL's Windows.Gaming.Input controller handling. 2024-10-30 17:41:09 -05:00
9602f36248 Remove redundant semicolons 2024-08-20 14:59:54 +02:00
3a85725ffa SDL: Remove duplicate button/hat Inputs. Hide duplicate Axis Inputs. 2024-03-14 23:50:17 -05:00
0538366326 SDL: Deduplicate Motor logic with templates. 2024-03-14 23:43:58 -05:00
0fff8374d0 SDL: Move class definition out of header. 2024-03-14 23:43:58 -05:00
c7d7ae4912 InputCommon/SDL: Code style fixes. 2024-01-15 15:19:41 +01:00
5e6e61c723 InputCommon/SDL: Avoid potential infinite loops from integer truncation. 2024-01-15 15:19:24 +01:00
d657ad5932 InputCommon/SDL: Check for errors from SDL_JoystickNumButtons(), SDL_JoystickNumAxes(), SDL_JoystickNumHats(). 2024-01-15 15:18:38 +01:00
959c39133b InputCommon/SDL: Fix incorrect use of std::vector::assign() and check bounds. 2024-01-15 15:17:32 +01:00
51e05f468a SDL: Add GameController API, cleanup 2024-01-13 16:10:25 +01:00
e456bef163 Input: Improve Controller Interface devices threading
This specific issue was already addressed by https://github.com/dolphin-emu/dolphin/pull/11635
though I felt like there was something more we could do, and wasn't too happy with the
likelihood of devices update calls being skipped (due to `m_devices_population_mutex` being locked).
2023-12-18 21:45:22 +02:00
2d3bae9c79 SDL: Add default case to switch statement
Fix -WSwitch warning about unhandled enum value SDL_NUM_LOG_PRIORITIES.

log_level is initialized to LNOTICE right before the switch statement so
this doesn't cause any behavior changes.
2023-11-10 12:05:20 -08:00
30ce1f2ec2 ControllerInterface/SDL: Remove Xbox 360 controller disabling hack. 2023-10-26 18:04:11 -05:00
72eadc6520 InputCommon:SDL: Add SDL 2.26 left and right motion inputs 2022-11-24 15:12:07 -06:00
44a4573303 ControllerInterface: Add InputBackend interface and SDL implementation. 2022-11-01 21:59:08 -05:00
f92541fbd9 StripSpaces: only strip spaces
StripWhitespace maintains old behavior
2022-07-25 18:40:12 -07:00
e79c7d4985 InputCommon: Don't force-link against SDL2.lib on Windows. 2022-07-13 01:37:05 +02:00
54b4ad8f55 ci/sdl: pump messages for SDL_hidapi so device detection works 2022-07-10 15:39:06 -07:00
ddf83462ac sdl: enable SDL_HINT_JOYSTICK_THREAD
fixes window message pumping
2022-07-10 15:39:06 -07:00
dd20c7cf78 ci/sdl: re-add the x360 controller block 2022-07-10 15:39:06 -07:00
3f7a2c6d4d ci/sdl: minor cleanup 2022-07-10 15:39:06 -07:00
6cb936d0cf Add SDL motion input and rumble support 2022-07-10 14:49:49 -07:00
994210e369 InputCommon: SDL 2.0.22 init crash workaround
See https://github.com/libsdl-org/SDL/pull/5598
2022-06-14 21:02:45 -05:00
6e5f4125e3 Use Common::ToLower and Common::ToUpper 2022-01-16 17:00:12 -08:00
e149ad4f0a treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
2aa941081e ControllerInterface: make SDL use PlatformPopulateDevices()
and avoid waiting on SDL async population being finished for no reason
2021-06-07 11:07:06 +03:00
81092cf7e4 InputCommon: replace SerialInterface log with ControllerInterface
where appropriate. SerialInterface was a leftover from the past,
and makes no sense to be used on actual/real controllers.
2021-05-05 00:16:08 +03:00
a5e1415e74 InputCommon: Migrate logging over to fmt
Continues the migration of the logging calls over to the fmt capable
ones.
2020-10-23 13:16:18 -04:00
ec60027f56 InputCommon: Use nested namespace specifiers where applicable 2019-06-17 16:51:41 -04:00
0bdfa19650 ControllerInterface: SDL: Replace unclear bool parameter with enum class. 2019-03-17 08:53:53 -05:00
4fb68c530b ControllerInterface: SDL cleanup and FF effect fixes. 2019-03-17 08:53:13 -05:00
932ca644aa Add hotplug support to SDL2 controller backend 2018-06-04 17:50:08 +02:00
7062967b5b SDLJoystick: store name on creation
Otherwise, Dolphin will crash when the joystick is removed.
2018-06-04 17:49:21 +02:00
3e69d066f5 ControllerInterface: replace Reinitialize with RefreshDevices
The SDL backend crashes when you close a joystick after SDL_Quit has
been called. Some backends don't need to be shutdown and
re-initialized everytime, we can just ask to enumerate devices again.
2016-11-30 16:07:55 -08:00
788e19f54d ControllerInterface: Make the ID assigning code common
This makes the device ID assigning code common to all backends, by
moving it to AddDevice() instead of copy-pasting or replicating
the logic in the backends.

Also, to prepare for hotplugging, instead of relying on a name usage
count, the new ID assigning system always starts from ID 0 and tries
to assign the first ID that is not used.
2016-07-14 10:50:53 +02:00
8678133e87 ControllerInterface: Switch to std::shared_ptr
Small cleanup by using std::shared_ptr and getting rid of
ciface.Devices() which just returned the m_devices (which defeats the
point of making m_devices protected).

Incidentally, this should make the code safer when we have
different threads accessing devices in the future (for hotplug?).

A lot of code use Device references directly so there is
no easy way to remove FindDevice() and make those unique_ptrs.
2016-06-25 21:46:39 +02:00
fd29e5c4cc ControllerInterface: Don't pass m_devices to the backends
Previously, the devices vector would be passed to all backends. They
would then manually push_back to it to add new devices. This was fine
but caused issues when trying to add synchronisation.

Instead, backends now call AddDevice() to fill m_devices so that it is
not accessible from the outside.
2016-06-25 13:46:53 +02:00
3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
9e1aab663f Revert "SDL: handle SDL_QUIT event" 2015-06-08 13:43:39 +12:00
9ec5a4544f SDL: handle SDL_QUIT event
Using SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS which installs a signal
handler for SIGINT and SIGTERM. There will be a way to prevent this in
2.0.4 but for now we'll need to handle SDL_QUIT.
2015-06-05 19:34:06 +02:00
30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
817abdd579 Remove an assumption in SDL.
We can compile with haptic support, and then not initialize due to haptics not being available.
So if we are compiling with haptics, test initializing with haptics and if that fails attempt to initialize without haptics before bailing out.
2015-01-19 16:07:28 -06:00