summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface
AgeCommit message (Collapse)Author
2023-05-29Merge pull request #11819 from JosJuice/android-input-device-nullAdmiral H. Curtiss
ControllerInterface/Android: Use InputEvent.getDeviceId
2023-05-19Merge pull request #11739 from OatmealDome/iokit-be-goneAdmiral H. Curtiss
InputCommon: Remove OSX (IOKit) input backend
2023-05-19Merge pull request #11758 from jbosboom/xinput2-client-pointerAdmiral H. Curtiss
XInput2: Accept input from keyboards other than the first master
2023-05-16StringUtil: Move IsAlpha() into Common namespaceLioncash
2023-05-10Support Steam Deck controls directly through hidrawR
This reads Steam Deck controls bypassing Steam Input. This allows for access to motion controls as well as independent access to thumb sticks, trackpads, and back grip buttons.
2023-05-07ControllerInterface/Android: Add some missing DeleteLocalRef callsJosJuice
2023-05-07ControllerInterface/Android: Use InputEvent.getDeviceIdJosJuice
Instead of InputEvent.getDevice followed by InputDevice.getId. Should hopefully fix https://bugs.dolphin-emu.org/issues/13237, while also being simpler.
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-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: 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-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-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-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-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-02WiimoteEmu: Update IR camera status from DesiredWiimoteState.Admiral H. Curtiss
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
2022-09-07WGInput: Work around crash with Steam overlay.Admiral H. Curtiss
2022-08-27WGInput: implement error handlingShawn Hoffman
2022-08-26WGInput: use c++/winrtShawn Hoffman
2022-08-26ciface/win32: use CM_Register_Notification instead of wnd msgsShawn Hoffman
2022-08-18InputCommon:QuarzKB&M: Use view position instead of window positionTellowKrinkle
2022-08-18InputCommon:QuarzKB&M: Use KVO to watch window positionTellowKrinkle
CGWindowListCreateDescriptionFromArray would block for up to ~1ms, which isn't a great thing to do on the main emulation thread
2022-08-12InputCommon: Enable ARC for obj-c++TellowKrinkle
2022-07-26Merge pull request #10858 from AdmiralCurtiss/mouse-center-hotkeyAdmiral H. Curtiss
Add hotkey for centering mouse in render window.
2022-07-25StripSpaces: only strip spacesShawn Hoffman
StripWhitespace maintains old behavior
2022-07-25Quartz: Handle mouse centering hotkey.Admiral H. Curtiss
Co-authored-by: Dentomologist <dentomologist@gmail.com>