summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon
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-15Merge pull request #10502 from Pokechu22/defer-gcadapterLéo Lam
GCAdapter: Defer initialization until MainWindow::InitControllers
2022-03-10GCAdapter: Defer initialization until MainWindow::InitControllersPokechu22
If libusb fails to initialize, an assertion fails, but if that happens before the main window is created, then Dolphin just dies. Now, the panic alert is properly shown and the user can ignore it.
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-13Merge pull request #10345 from jordan-woyak/modifier-rangeMai M
InputCommon: Re-enable "Modifier" "Range" settings.
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-08Config: Port SI device settings to new config system.Admiral H. Curtiss
2022-01-05Config: Port GC Adapter settings to new config system.Admiral H. Curtiss
2022-01-04InputCommon: Use value of "Modifier" button "Range" setting rather than ↵Jordan Woyak
always applying 50%. Make "Clear" button reset "Modifier" "Range" settings to 50%.
2022-01-01Replace remaining uses of zlib crc32 with Common/Hash.hPokechu22
2021-12-23ControllerEmu: Hide the cursor if the input gate is disabledPokechu22
2021-12-10Treewide: Adjust order of includesPokechu22
2021-12-09Merge pull request #10253 from Filoppi/fix_input_config_loadingJosJuice
Fix InputConfig::LoadConfig() not always replacing emu controllers values
2021-12-05InputCommon: fix InputConfig::LoadConfig() not always replacing emu ↵Filoppi
controllers values If InputConfig::LoadConfig() was called once with a non empty/customized config, then called again after manually deleting the config (dolphin calls LoadConfig() every time it opens the mapping widget), the second load would fail to clear the values on any non first EmulatedController and would instead keep the previous config values despite it being deleted (while it would instead correctly default the first EmulatedController). This is not a big bug though the code is better now.
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-23Merge pull request #10143 from Pokechu22/png-compression-levelLéo Lam
Add option for setting the PNG zlib compression level
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-11-18Add option for setting the PNG zlib compression levelPokechu22
2021-10-13Fix all uninitialized variable warnings (C26495)Pokechu22
2021-07-13Pad: GBA configBonta
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: fix 2nd+ controller not defaulting to the default deviceFiloppi
2021-06-07Merge pull request #9792 from sepalani/lintLéo Lam
Lint: End of namespace
2021-06-07Lint: End of namespaceSepalani
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-24Expose Control Expression variables to mappings UIFiloppi
-add a way to reset their value (from the mappings UI) -fix "memory leak" where they would never be cleaned, one would be created every time you wrote a character after a "$" -fix ability to create variables with an empty string by just writing "$" (+added error for it) -Add $ operator to the UI operators list, to expose this functionality even more
2021-05-19IMUGyroscope: make GetState update optional (on by default), fix const, ↵Filoppi
clean code My future PRs will split the UI state from the Emulation State of some of these emulated controller values and this readies the code for it.
2021-05-19InputCommon: improve code that returns a controller attachment indexFiloppi
casting a value to a u32 when it's originally an int, and it's exposed as int to users, could end up in cases where a negative number would result as a positive one. This doesn't really affect the value range of the attachment enum, still I think the code was wrong. Heavily tested.
2021-05-19IMUAccelerometer: consistency of BoundCount checksFiloppi
Similar to the guitar, only control[0] was checked, and that felt random.