aboutsummaryrefslogtreecommitdiff
path: root/src/input_common/drivers/sdl_driver.cpp
Commit message (Collapse)AuthorAgeFilesLines
* input_common/sdl: only log motion capabilities when they changeDennys Kaluzny Pereira34 hours1-3/+23
| | | | | | | | | | | | | | On the Steam Deck the log was flooded with the same gyro message, over 3000 times in a single session. Motion capabilities are now only logged when they change, and the sensor restart interval grows exponentially (up to 64x) while the sensor keeps returning zeroed data. Tested with Pokemon Pokopia on the Steam Deck: from ~42 messages in 33s down to 1 for the whole session, controls working normally. Assisted-by: Claude Opus 5.5 (debugging, code, and drafting this message)
* refactor: remove unused gamepad button and axis event handling in SDLDriverkraibse3 days1-16/+0
|
* Fix game list crash, unresponsive macOS menu, and missing SDL gamepad input ↵QuantumDriftDev4 days1-0/+16
| | | | | | | | | | | | | | | | | | | | | | (#100) * game_list: fix crash when scanning games by removing nested event processing Assisted-by: DeepSeek V4 Pro (root cause diagnosis and fix) Signed-off-by: QuantumDriftDev <350698041+QuantumDriftDev@users.noreply.github.com> * macos: fix unresponsive application menu by removing the SDL/Qt event loop conflict Assisted-by: GPT-6.1 Sol (root cause diagnosis and implementation) Signed-off-by: QuantumDriftDev <350698041+QuantumDriftDev@users.noreply.github.com> * input_common: handle SDL gamepad button and axis events Assisted-by: DeepSeek V4 Pro (implementation) Signed-off-by: QuantumDriftDev <350698041+QuantumDriftDev@users.noreply.github.com> --------- Signed-off-by: QuantumDriftDev <350698041+QuantumDriftDev@users.noreply.github.com>
* [input/sdl] nuke SDL_Vibration thread (#4299)lizzie2026-10-141-40/+1
| | | | | | | | | | | | | | | | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- isn't it net faster to just...send things, serially? especially since vibration occurs so non-often... i dont think it would cause any issues TEST: if this causes ANY sort of perf regression on games when the thing vibrates WITH AN SDL CONFIGURED GAMEPAD OR WHATEVER Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4299 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [common] Switch to boost::unordered_flat containers (#4326)crueter2026-08-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces all instances of ankerl's unordered map/set with boost's `unordered_flat_*` classes. This uses std::hash since boost::hash is actually a lot slower. Also adds an abstraction layer in `Common` so future changes are quicker and easier. Other implementation details: - ankerl provided hash specializations for tuple and pair, so those were ported here - std::erase_if doesn't work on boost, so just used the ADL'd erase_if This should be about equal or superior performance as unordered_dense for everything except iteration. Signed-off-by: crueter <crueter@eden-emu.dev> - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4326 Reviewed-by: Lizzie and Samuel <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [input] added option to disable wgi/xinput to prevent SDL GUIDE hack (#4237)xbzk2026-08-091-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- So, many users hate the fact when they press START+SELECT, an additional HOME event is sent. That is annoying coz for most users' default hotkey settings, it closes eden when not in game, and when in game it calls a NOT controller responsive prompt about leaving Eden. There are several games with reasons to press start+select, also there are homebrews which relies on that combo to open internal menus. Again. That is annoying. Digging deep i've found that SDL implements something called guide hack: When Start+Select is pressed it sends a synthetic GUIDE(which code equals to HOME). This was intended for controllers missing the HOME button, but SDL fails to track them all, and misses API to disabling it. I've figured out a patch to SDL to disable it, but since it would be better to invest on a PR straight into SDL repo, on our side i thought it better to simply add an option to disable WGI (Windows.Gaming.Input) and Xinput, both paths which could lead into the hack enabling. Setting is available in a remote place no one will bother. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4237 Reviewed-by: Samuel <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [hid_core, input_common] use std::numbers::pi{_v} instead of re-defining (#4160)lizzie2026-07-071-3/+5
| | | | | | | | | | don't reinvent the wheel, simple as that. Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4160 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [input_common] Fix GetButtonMappingForDevice() when joystick doesn't have a ↵lizzie2026-07-071-19/+24
| | | | | | | | | | | | | | | | gamepad associated with it (#4172) from PS4 PR - this should help fix the case where a controller doesn't have an associated gamepad and thus its not automatically configured. this should fix that :) Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4172 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [externals] Update to SDL3 (#3952)Kaydax2026-05-181-165/+315
| | | | | | | | | | | | | | | | | | | | Since the launch of the steam controller I think it's only best to push towards updating to SDL3 allowing for a wider range of controller support I went ahead and started on getting it working. Everything here should be functional, I've personally tested it all on Arch Linux. Still untested on windows, so looking for feedback on that Any feedback and help would be appreciated! Main changes: - Bump everything to SDL3 - Handle SDL3 audio and input - Add steam controller support, including HD Rumble - Improved battery reporting via the status icon by using real % rather than state alone Co-authored-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3952 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Lizzie <lizzie@eden-emu.dev>
* [common/logging] Simplify logging logic and fix issues when logging before ↵lizzie2026-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | system is created (#3688) - our logging code was bigger than spdlog itself, why???? just keep it simple - fix issues when logging before logging system is even started - removes the "initialized logging twice" issue - removes uneeded indirection in file logging - uses direct formatting instead of jumping hoopla-around the fmt::format() ressult - code duplication and dead code removal as usual I did explore dup2() but I think it's not worth the hassle I did try `fwopen()` but it's better if things are just kept as-is. there is a lot of noise because I removed a bunch of redundant files on logging and just put everything in one file now normally this wouldn't be a good idea, however consider: the complexity of logging; it's less than 500 lines... does it really need a whole subsystem?!?!?! ITS JUST LOGGING Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3688 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: DraVee <chimera@dravee.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [*] change all std::unordered_map and std::unordered_set into ↵lizzie2026-02-101-2/+2
| | | | | | | | | | | | | | | | | | | ankerl::unordered_dense::map/set variants (#3442) mainly doing this to reduce memory footprint; we all know how nice ankerl::unordered_dense is in theory 4x faster - in practice these maps arent that "hot" anyways so not likely to have much perf gained i just want to reduce mem fragmentation to ease my porting process, plus it helps other platforms as well (ahem weak Mediatek devices) :) Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3442 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [input_common] fix xinput raw not working on sdl2 (#3305)lizzie2026-01-161-4/+2
| | | | | | | | | | | this should fix issue where you couldn't connect more than 4 controllers at once Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3305 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [input_common/mouse, sdl_driver] increase latency of mouse and SDL_vibration ↵lizzie2025-12-041-1/+1
| | | | | | | | | | | | | | threads to 4 "evals" per sec (#2982) No need to have those nano-sleeps for these threads... Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2982 Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [cmake] enable clang-cl and WoA builds (#348)lizzie2025-09-091-2/+2
| | | | | | | | | | | | | | Compilation and CMake fixes for both Windows on ARM and clang-cl, meaning Windows can now be built on both MSVC and clang on both amd64 and aarch64. Compiling on clang is *dramatically* faster so this should be useful for CI. Co-authored-by: crueter <crueter@eden-emu.dev> Co-authored-by: crueter <crueter@crueter.xyz> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/348 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [icc] fix intel c++ compiler errors (#146)lizzie2025-07-301-6/+8
| | | | | | Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/146 Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [desktop, core] yuzu -> Eden, eden -> Edencrueter2025-07-191-1/+1
| | | | Signed-off-by: crueter <crueter@eden-emu.dev>
* core: hid: Split SL and SR buttonsgerman772023-11-111-8/+12
|
* input_common: set `SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS` to 0Martino Fontana2023-07-071-37/+9
| | | | | | | This allows to share the mappings between Nintendo and non-Nintendo controllers. Breaks the controller configuration for existing users who are using a Nintendo controller. (Documentation of the hint https://github.com/libsdl-org/SDL/blob/92b3c53c92971e685254fd89f89ce6bde8cea60e/include/SDL_hints.h#L512-L532)
* Merge pull request #10679 from zeltermann/wakelock-reasonliamwhite2023-06-271-0/+4
|\ | | | | Only use SDL wakelock on Linux
| * Only use SDL wakelock on Linuxzeltermann2023-06-241-0/+4
| | | | | | | | | | | | SDL has internally fixed shenanigans related to wakelocking through DBus from inside sandboxes from around August 2022, so we can now remove the workaround we used since 2021.
* | input_common: Make use of new SDL featuresgerman772023-06-241-8/+20
|/
* Improve emulation of HD Rumblemarius david2023-05-051-6/+29
|
* input_common: sdl: Only send last vibration commandgerman772023-03-121-1/+16
|
* general: fix spelling mistakesLiam2023-03-121-2/+2
|
* remove static from pointer sized or smaller types for aesthetics, change ↵arades792023-02-141-4/+4
| | | | | | constexpr static to static constexpr for consistency Signed-off-by: arades79 <scravers@protonmail.com>
* add static lifetime to constexpr values to force compile time evaluation ↵arades792023-02-141-4/+4
| | | | | | where possible Signed-off-by: arades79 <scravers@protonmail.com>
* input_common: Reintroduce custom pro controller supportNarr the Reg2023-02-091-2/+16
|
* Merge pull request #9492 from german77/joycon_releaseliamwhite2023-01-241-5/+18
|\ | | | | Input_common: Implement custom joycon driver v2
| * input_common: Address byte reviewgerman772023-01-201-1/+1
| |
| * input_common: Drop Pro controller support from custom drivergerman772023-01-191-3/+3
| |
| * input_common: Use DriverResult on all enginesgerman772023-01-191-2/+2
| |
| * input_common: Disable SDL driver with switch controllersNarr the Reg2023-01-191-3/+16
| |
* | input_common: reset sdl motion if data is invalidgerman772023-01-181-19/+35
|/
* input_common: Filter SDL GUIDNarr the Reg2022-12-121-0/+2
|
* input_common: Pump sdl events from main threadgerman772022-11-271-9/+6
|
* Merge pull request #9107 from german77/gidoly_rulesliamwhite2022-10-251-8/+56
|\ | | | | input_common: cache vibration tests
| * input_common: cache vibration testsgerman772022-10-211-8/+56
| |
* | general: Enforce C4800 everywhere except in video_coreMorph2022-10-221-2/+2
|/
* common: remove "yuzu:" prefix from thread namesLiam2022-10-031-2/+2
|
* input_common: sdl: Always check for motion on reconnectNarr the Reg2022-09-031-4/+7
|
* chore: make yuzu REUSE compliantAndrea Pappacoda2022-07-271-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [REUSE] is a specification that aims at making file copyright information consistent, so that it can be both human and machine readable. It basically requires that all files have a header containing copyright and licensing information. When this isn't possible, like when dealing with binary assets, generated files or embedded third-party dependencies, it is permitted to insert copyright information in the `.reuse/dep5` file. Oh, and it also requires that all the licenses used in the project are present in the `LICENSES` folder, that's why the diff is so huge. This can be done automatically with `reuse download --all`. The `reuse` tool also contains a handy subcommand that analyzes the project and tells whether or not the project is (still) compliant, `reuse lint`. Following REUSE has a few advantages over the current approach: - Copyright information is easy to access for users / downstream - Files like `dist/license.md` do not need to exist anymore, as `.reuse/dep5` is used instead - `reuse lint` makes it easy to ensure that copyright information of files like binary assets / images is always accurate and up to date To add copyright information of files that didn't have it I looked up who committed what and when, for each file. As yuzu contributors do not have to sign a CLA or similar I couldn't assume that copyright ownership was of the "yuzu Emulator Project", so I used the name and/or email of the commit author instead. [REUSE]: https://reuse.software Follow-up to b2eb10382941bef0914f4a0a4685b9033440aa9f
* input_common: sdl: lower vibration frequency and use it's own unique threadgerman772022-06-281-1/+9
|
* input_common: Replace usage of string guid to common uuidNarr the Reg2022-06-061-26/+30
|
* input_common: Make vibration request asyncNarr the Reg2022-05-231-2/+21
|
* Merge pull request #7978 from german77/sidewaybunnei2022-04-211-0/+33
|\ | | | | input_common: Map sticks correctly when mapped sideways
| * input_common: Map sticks correctly when mapped sidewaysNarr the Reg2022-03-211-0/+33
| |
* | input_common: Replace lock_guard with scoped_lockMerry2022-04-071-6/+6
|/
* Merge pull request #7859 from german77/battery_againbunnei2022-02-241-7/+10
|\ | | | | input_common: Remove battery duplicated struct and update every button press
| * input_common: Remove battery duplicated struct and update every button pressgerman772022-02-061-7/+10
| |
* | Merge pull request #7852 from Morph1984/new-uuidbunnei2022-02-101-2/+2
|\ \ | | | | | | common: Revise and fix the UUID implementation