summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface
AgeCommit message (Collapse)Author
2022-04-08Core/WGInput: Dynamically load winrt function addresses.Admiral H. Curtiss
2022-04-03ControllerInterface: Update sort priorities.Jordan Woyak
2022-04-03InputCommon: Add Windows.Gaming.Input to ControllerInterface.Jordan Woyak
2022-03-16MappingCommon: Fix detection of hotkey and conjunction expressions.Jordan Woyak
2022-03-06Move parts of MappingCommon out of DolphinQtJosJuice
Some of the functions in MappingCommon would be useful to use on mobile in the future.
2022-01-16Use Common::ToLower and Common::ToUpperPokechu22
2022-01-09Use HRWrap in remaining locationsPokechu22
Note that D3DCommon can't use DX11HRWrap or DX12HRWrap since it's shared between them.
2022-01-09Common/Assert: Actually use the ASSERT_MSG's log type parameterPokechu22
Since it was unused, nonexistent values were used in a few places. I've replaced them.
2022-01-01Replace remaining uses of zlib crc32 with Common/Hash.hPokechu22
2021-12-10Treewide: Adjust order of includesPokechu22
2021-12-05InputCommon: fix default input config default device not being loaded/foundFiloppi
Fixes bug: https://bugs.dolphin-emu.org/issues/12744 Before https://github.com/dolphin-emu/dolphin/commit/e1e3db13baabefa89991388d37db0bb260c4f535 the ControllerInterface m_devices_mutex was "wrongfully" locked for the whole Initialize() call, which included the first device population refresh, this has the unwanted (accidental) consequence of often preventing the different pads (GC Pad, Wii Contollers, ...) input configs from loading until that mutex was released (the input config defaults loading was blocked in EmulatedController::LoadDefaults()), which meant that the devices population would often have the time to finish adding its first device, which would then be selected as default device (by design, the first device added to the CI is the default default device, usually the "Keyboard and Mouse" device). After the commit mentioned above removed the unnecessary m_devices_mutex calls, the default default device would fail to load (be found) causing the default input mappings, which are specifically written for the default default device on every platform, to not be bound to any physical device input, breaking input on new dolphin installations (until a user tried to customize the default device manually). Default devices are now always added synchronously to avoid the problem, and so they should in the future (I added comments and warnings to help with that)
2021-11-20ControllerInterface: fix UpdateReferences() deadlockFiloppi
Removed useless locks to DeviceContainer::m_devices_mutex, as they were all already protected by m_devices_population_mutex. We have no interest in blocking other threads that were potentially reading devices at the same time so this seems fine. This simplifies the code, and I've adjusted a few comments which mentioned possible deadlock that should now be totally gone. The deadlock could have happen if a thread directly called EmulatedController::UpdateReferences(), while another another thread also reached EmulatedController::UpdateReferences() within a call to ControllerInterface::UpdateDevices(), as the mentioned function locked both the DeviceContainer::m_devices_mutex and s_get_state_mutex at the same time. The deadlock was frequent on game emulation startup on Android, due to the UpdateReferences() call in InputConfig::LoadConfig() and the UI thread triggering calls to ControllerInterface::UpdateDevices(). It could also have happened on Desktop if a user pressed "Refresh Devices" manually in the UI while the input config was loading. Also brought some UpdateReferences() comments and thread safety fixes from https://github.com/dolphin-emu/dolphin/pull/9489
2021-10-13Fix all uninitialized variable warnings (C26495)Pokechu22
2021-07-06QuartzKeyboardAndMouse: Ensure windowNumber is fetched on the main threadOatmealDome
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
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-06-07InputCommon: Make Wiimote rumble variable thread safeFiloppi
2021-06-07ControllerInterface: fix DSU thread safety and use PlatformPopulateDevices()Filoppi
2021-06-07ControllerInterface: polish DInput Keyboard and Mouse (add comments and logs)Filoppi
Also fix the cursor axis not being updated when the mouse device had failed aquiring, despite them being completely unrelated
2021-06-07ControllerInterface: DInput Joystick fix non thread safe static variableFiloppi
also fix devices being added to its own custom list of devices even when rejected by the CI
2021-06-07ControllerInterface: Implement ChangeWindow on DInput without recreating the ↵Filoppi
devices Also polished DInput code in general to try and mitigate issue 11702. Added a lot of logging and comments.
2021-06-07ControllerInterface: devices population is now async so implement devices ↵Filoppi
sorting priority This helps us keeping the most important devices (e.g. Mouse and Keyboard) on the top of the list of devices (they still are on all OSes supported by dolphin and to make hotplug devices like DSU appear at the bottom.
2021-06-07ControllerInterface: make evdev use PlatformPopulateDevicesFiloppi
Also fix evdev non thread safe acces to static variables
2021-06-07ControllerInterface: make SDL use PlatformPopulateDevices()Filoppi
and avoid waiting on SDL async population being finished for no reason
2021-06-07ControllerInterface: make real Wiimote use PlatformPopulateDevices()Filoppi
2021-06-07ControllerInterface: Remove OSX window handleFiloppi
also make it more thread safe (avoid rare deadlock) and fix it trying to add devices before the CI has init
2021-06-07ControllerInterface: RefactorFiloppi
-Fix Add/Remove/Refresh device safety, devices could be added and removed at the same time, causing missing or duplicated devices (rare but possible) -Fix other devices population race conditions in ControllerInterface -Avoid re-creating all devices when dolphin is being shut down -Avoid re-creating devices when the render window handle has changed (just the relevantr ones now) -Avoid sending Devices Changed events if devices haven't actually changed -Made most devices populations will be made async, to increase performance and avoid hanging the host or CPU thread on manual devices refresh
2021-06-07ControllerInterface: mixed commentsFiloppi
2021-06-07ControllerInterface: fix rare deadlockFiloppi
A "devices changed" callback could have ended up waiting on another thread that was also populating devices and waiting on the previous thread to release the callbacks mutex.
2021-05-31ControllerInterface: make DSU inputs start from resting pose instead of 0. ↵Filoppi
Add battery level
2021-05-31ControllerInterface: DSU polish: avoid hanging host thread, add ↵Filoppi
disconnection detection, ... -Reworked thread waits to never hang the Host thread for more than a really small time (e.g. when disabling DSU its thread now closes almost immediately) -Improve robustness when a large amount of devices are connected -Add devices disconnection detection (they'd stay there forever until manually refreshed)
2021-05-31ControllerInterface: fix DSU using the same client uid between server and ↵Filoppi
controllers queries that's not the way it's supposed to work
2021-05-10InputCommon: add a ton of missing constsFiloppi
fix some related grammar errors only the ButtonManager required code changes
2021-05-05InputCommon: replace SerialInterface log with ControllerInterfaceFiloppi
where appropriate. SerialInterface was a leftover from the past, and makes no sense to be used on actual/real controllers.
2021-03-17InputCommon / DolphinQt / Core: Add a "RelativeMouse" input which provides ↵iwubcode
the raw delta mouse input Co-authored-by: Jordan Woyak <jordan.woyak@gmail.com>
2021-03-16Merge pull request #9558 from iwubcode/dsu-multi-server-avoid-blockingLéo Lam
InputCommon: block on DSU servers collectively instead of individually
2021-03-07Touchscreen: Add override specifiersDentomologist
Fix -Winconsistent-missing-override warnings on Android
2021-03-07ControllerInterface: Fix unused-result warningDentomologist
Add ! before unused variables to 'use' them. Ubuntu-x64 emits warnings for unused variables because gcc decides it should ignore the void cast around them. See thread for discussion: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
2021-03-05InputCommon: instead of blocking on individual DSU server sockets, block on ↵iwubcode
a selector built up from all server sockets
2021-03-01Merge pull request #9492 from nolange/fix_norandr_buildLéo Lam
Cleanup X11 and XRANDR Macros
2021-02-26Common: don't call OnConfigChanged() unless it has actually changedFiloppi
DualShock UDP Client is the only place in the code that assumed OnConfigChanged() is called at least once on startup or it won't load up the setting, so I took care of that
2021-02-22Cleanup X11 and XRANDR MacrosNorbert Lange
This fixes build with X11 enabled and XRANDR disabled.
2021-01-27rename InputCommon/ControllerInterface/Device to CoreDeviceShawn Hoffman
2021-01-27rename ciface::Wiimote to ciface::WiimoteControllerShawn Hoffman
2021-01-05Merge pull request #9418 from Filoppi/patch-10Léo Lam
Fix DualShockUDP not adding/removing devices correctly
2021-01-03Fix DualShockUDP not adding/removing devices correctlyFilippo Tarpini
-If adding 2 devices with the same name, they their unique id wouldn't be increased, causing a conflict. -Removing a device wouldn't actually remove it from the internal devices list because the list of devices had already been updated when going through it. -It was possible to remove devices belonging to other sources by adding a device with the same name and then removing it.
2021-01-02Fix Quartz cursor going to +infinite if the window size was 0Filippo Tarpini
2021-01-02Fix DInput cursor going to +infinite if the window size was 0Filippo Tarpini
2021-01-02Fix XInput2 cursor going to +infinite if the window size was 0Filippo Tarpini
2020-12-13InputCommon: Fix callback dispatch deadlockseth
Make sure m_is_populating_devices is true when a WM_INPUT_DEVICE_CHANGE event is received directly on the ciface thread, so that callbacks do not occur while removing devices. This breaks a hold-and-wait deadlock between the ciface thread and the CPU thread when using emulated Wiimotes. Co-authored-by: brainleq <brainleq@users.noreply.github.com> Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
2020-10-23InputCommon: Migrate logging over to fmtLioncash
Continues the migration of the logging calls over to the fmt capable ones.