summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon
AgeCommit message (Collapse)Author
2023-04-13XInput2: Accept input from keyboards other than the first masterJeffrey Bosboom
XInput2 was created to support multiple pointer/keyboard pairs (often called MPX for multi-pointer X). Dolphin's XInput2 implementation has always supported MPX by creating a KeyboardMouse object per master pointer. Since commit bbb12a7, Dolphin's keyboard state is filtered by the output of XQueryKeymap. As a core X function, XQueryKeymap queries "the" keyboard, which by default is the first master keyboard. As a result, Dolphin will ignore keys pressed on other master keyboards unless the first master is simultaneously pressing the same keys. XInput2 doesn't provide a function to query the keyboard state. There is no XIQueryKeymap and the current state is not a member of the XIKeyClassInfo returned by XIQueryDevice. Instead, XInput2 allows a master pointer to be nominated as "the" pointer on a per-client basis, with "the" keyboard automatically becoming the associated master keyboard. The "documentation" [1] says passing None for the window is only for debugging purposes, but it is documented in the XISetClientPointer man page and seems to be the only way to query keyboards beyond the first. With this commit, Dolphin correctly reads keys from keyboards other than the first master keyboard. To test, use the xinput command-line utility to create a master pointer and reattach a keyboard to the associated master keyboard. [1]: https://who-t.blogspot.com/2009/07/xi2-recipes-part-6.html (the XInput2 developer's blog)
2023-04-13Common/IniFile: Move interface into Common namespaceLioncash
Gets this out of the global namespace and into the Common namespace
2023-04-12Pragma diagnostic ignore [-Wregister] is no longer neededMinty-Meeo
2023-04-07InputCommon: Remove OSX (IOKit) input backendOatmealDome
2023-03-14Merge pull request #11635 from Dentomologist/wiimote_fix_disconnection_deadlockPierre Bourdon
ControllerInterface: Fix deadlock when Wii Remote disconnects
2023-03-08ControllerInterface: Fix deadlock when Wii Remote disconnectsDentomologist
In UpdateInput, lock m_devices_population_mutex before m_devices_mutex to be consistent with other ControllerInterface functions. Normally the former lock isn't needed in UpdateInput, but when a Wii Remote disconnects it calls RemoveDevice which results in the mutexes being locked in the wrong order.
2023-03-07Android: Change how the overlay controller setting worksJosJuice
Up until now, there have been two settings on Android that stored the selected Wii Remote extension: the normal one that's also used on PC, and a SharedPreferences one that's used by the overlay controls to determine what controls to show. It is possible for these two to end up out of sync, and my input changes have made that more likely to happen. To fix this, let's rework how the overlay controller setting works. We don't want it to encode the currently selected Wii Remote extension. However, we can't simply get rid of the setting, because for some Wii games we need the ability to switch between a GameCube controller and a Wii Remote. What this commit does is give the user the option to select any of the 4 GameCube controllers and any of the 4 Wii Remotes. (Before, controllers 2-4 weren't available in the overlay.) Could be useful for things like the Psycho Mantis fight in Metal Gear Solid. I'm also switching from SharedPreferences to Dolphin.ini while I'm at it.
2023-03-07Android: Remove the in-emulation IR sensitivity optionsJosJuice
This too can be set in the normal controller settings now.
2023-03-07Android: Add the advanced input mapping dialogJosJuice
It's missing a lot of features from the PC version for now, like buttons for inserting functions and the ability to see what the expression evaluates to. I mostly just wanted to get something in place so you can set up rumble. Co-authored-by: Charles Lombardo <clombardo169@gmail.com>
2023-03-03Android: Add input device selectionJosJuice
2023-03-03ControllerInterface/Android: Implement rumbleJosJuice
2023-03-03ControllerInterface/Android: Automatically suspend sensorsJosJuice
This is a battery-saving measure. Whether a sensor should be suspended is determined in the same way as whether key events and motion events should be handled by the OS rather than consumed by Dolphin.
2023-03-03ControllerInterface/Android: Implement sensor input for InputDevicesJosJuice
This functionality was added in Android 12 to let apps get motion data for gamepads.
2023-03-03ControllerInterface/Android: Implement sensor inputJosJuice
2023-03-03ControllerInterface/Android: Implement hotplugJosJuice
2023-03-03ControllerInterface/Android: Return whether input was handledJosJuice
When Android presents an input event to an app, it wants the app to return true or false depending on whether the app handled the event or not. If the event wasn't handled by the app, it will be passed on to the system, which may decide to take an action depending on what kind of input event it is. For instance, if a B button press is passed on to the system, it will be turned into a Back press. But if an R1 press is passed on to the system, nothing in particular happens. It's important that we get this return value right in Dolphin. For instance, the user generally wouldn't want a B button press to open the EmulationActivity menu, so B button presses usually shouldn't be passed on to the system - but volume button presses usually should be passed on to the system, since it would be hard to adjust the volume otherwise. What ButtonManager did was to pass on input events that are for a button which the user has not mapped, which I think makes sense. But exactly how to implement that is more complicated in the new input backend than in ButtonManager, because now we have a separation between the input backend and the code that keeps track of the user's mappings. What I'm going with in this commit is to treat an input as mapped if it has been polled recently. In part I chose this because it seemed like a simple way of implementing it that wouldn't cause too many layering violations, but it also has two useful side effects: 1. If a controller is not being polled (e.g. GameCube controllers in Wii games that don't use them), its mappings will not be considered. 2. Once sensor input is implemented in the Android input backend, we will be able to use this "polled recently" tracking to power down the sensors at times when the game is using a Wii Remote reporting mode that doesn't include motion data. (Assuming that the sensor inputs only are mapped to Wii Remote motion controls, that is.)
2023-03-03ControllerInterface/Android: Handle input eventsJosJuice
Android doesn't let us poll inputs whenever we want. Instead, we listen to input events (activities will have to forward them to the input backend), and store the received values in atomic variables in the Input classes. This is similar in concept to how ButtonManager worked, but without its homegrown second input mapping system.
2023-03-03ControllerInterface/Android: Implement device populationJosJuice
2023-03-03ControllerInterface/Android: Rip out ButtonManagerJosJuice
ButtonManager is very different from how a normal input backend works, and is making it hard for us to improve controller support on Android. The following commits will add a new input backend in its place.
2023-02-26InputCommon: Fix ControlGroup::SaveConfig with DefaultValue::DisabledJosJuice
I also changed LoadConfig, but that change doesn't affect correctness, it's only so it looks neat by matching SaveConfig. This bug was added in 18a4afb053e8b5f356e22cfc5aec8cc27700710b, the commit that introduced DefaultValue::Disabled. The bug can't actually be triggered in master, but it can be triggered in the Android input overhaul PR.
2023-02-17InputCommon: Fix memory leak in ExpressionParserPokechu22
We allocate in MakeSuppressor via `return unique_ptr(std::make_unique<...>(...).release(), InvokingDeleter{}`, so it wasn't properly getting freed.
2023-02-15ControllerInterface: Fix uninitialized variables in DualShockUDPClientPokechu22
Strangely, this case did not trigger a C26495 warning in Visual Studio's analyzer; instead, I spotted this when using Valgrind.
2023-02-09InputCommon/XInput2: Fix shadowing warningPokechu22
2023-02-09Resolve various "no previous declaration" warningsPokechu22
2023-02-09Merge pull request #11544 from jmallach/spngMarkus Wick
Allow building against system libspng
2023-02-06Allow building against system libspngJordi Mallach
2023-01-31Split out everying remaining from SwapScott Mansell
2023-01-24Common: Replace StringBeginsWith/StringEndsWith with std equivalentsLioncash
Obsoletes these functions in favor of the standard member functions added in C++20.
2023-01-02Merge pull request #11397 from TellowKrinkle/QuartzMousePosAdmiral H. Curtiss
InputCommon:QuartzKB&M: Fix mouse y coordinates
2022-12-31InputCommon:QuartzKB&M: Fix mouse y coordinatesTellowKrinkle
Cocoa uses a different coordinate system from Carbon (Carbon's origin is the top left while Cocoa's is the bottom left)
2022-12-26InputCommon/XInput2: Changed axis value reading to be more correctTheConfuZzledDude
2022-12-23InputCommon/Xinput: Cleaned up a bitTheConfuZzledDude
2022-12-23InputCommon/XInput2: Added an axis output for the scroll wheelTheConfuZzledDude
2022-11-27CoreTiming: Refactor to class.Admiral H. Curtiss
2022-11-24InputCommon:SDL: Add SDL 2.26 left and right motion inputsTellowKrinkle
2022-11-01ControllerInterface: DSU InputBackend implementation.Jordan Woyak
2022-11-01ControllerInterface: evdev InputBackend implementation.Jordan Woyak
2022-11-01ControllerInterface: Add InputBackend interface and SDL implementation.Jordan Woyak
2022-10-22Merge pull request #10979 from tellowkrinkle/QuartzWindowSpeedJMC47
InputCommon:QuartzKB&M: Use KVO to watch window position
2022-10-22GCAdapter: Process pad state in read thread and other general cleanups.Jordan Woyak
2022-10-11Input: Add "abs" input expression function.Jordan Woyak
2022-10-03Android: Use input override system for touch controlsJosJuice
This is the first step of getting rid of the controller indirection on Android. (Needing a way for touch controls to provide input to the emulator core is the reason why the controller indirection exists to begin with as far as I understand it.)
2022-10-03DolphinQt: Use input override system for TAS input windowsJosJuice
This lets the TAS input code use a higher-level interface for overriding inputs instead of having to fiddle with raw bits. WiiTASInputWindow in particular was messy with how much controller code it had to re-implement.
2022-10-03ControllerEmu: Add new "input override" systemJosJuice
2022-10-02WiimoteEmu: Update IR camera status from DesiredWiimoteState.Admiral H. Curtiss
2022-09-24InputCommon: Add equality operators to RawValue.Admiral H. Curtiss
2022-09-24InputCommon: Make RawValue constructors constexpr.Admiral H. Curtiss
2022-09-22Use std::llround in MapFloatMinty-Meeo
I don't see why not.
2022-09-08Merge pull request #11038 from AdmiralCurtiss/steam-overlay-crash-fix-wgiAdmiral H. Curtiss
WGInput: Work around crash with Steam overlay.
2022-09-07InputCommon: Fix deadlock in EmulatedController::UpdateReferences().Admiral H. Curtiss