summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/Android
AgeCommit message (Collapse)Author
2026-07-09Android: Make vibration length variableJosJuice
Previously we would vibrate for 100 ms on every vibration, which was especially annoying if a game was doing a bunch of vibrations that were supposed to be much shorter than that. Now we tell Android to vibrate for 10 s, then cancel the vibration as soon as the game turns the vibration off.
2026-06-26Android: Fix mixup between Vibrator id and indexJosJuice
This fixes https://bugs.dolphin-emu.org/issues/14076. The issue report more or less already says it all, but to provide a shorter summary: We were fetching a list of vibrator IDs, but instead of passing the vibrator ID to the vibrator manager, we passed the index of the ID in the list. This happened to work fine on many devices, including all devices that use DolphinVibratorManagerCompat, due to the only Vibrator having both an index and ID of 0. But on some devices, it failed due to the ID of the Vibrator being 1. This fix makes us correctly pass the ID to the vibrator manager. We still use indices in controller INI files, both for compatibility with the controller mappings shipped with Dolphin (which use index 0) and for backwards compatibility with older controller INI files.
2026-02-08Android: Rework input device hotplugJosJuice
Previously, when an input device was connected or disconnected, we would recreate all devices. This commit makes it so we only touch the relevant device instead. This matters because recreating a device causes us to drop all held buttons for that device. Due to Android only delivering inputs as events, we're unable to poll for currently held buttons when recreating a device. This recently became a problem for users of Ayn devices due to a firmware update. Every now and then, something about the display viewports changes, triggering an update to an input device that I assume is a touch input device. This input device isn't something users normally map in Dolphin's controller settings, but it changing was causing Dolphin to drop all held buttons for the device's built-in gamepad as well as any other connected gamepads.
2026-01-24Remove VectorToJStringArraySintendo
2025-11-06Common: Remove the string parameters from the HookableEvent interface.Jordan Woyak
2025-11-05InputCommon: Make ControllerInterface RegisterDevicesChangedCallback use ↵Jordan Woyak
Common::HookableEvent.
2025-06-07Android: Update advanced mapping dialog when devices changeJosJuice
Without this, there was a bug where if you turned the device's screen off and on again while in the advanced mapping dialog, the input indicators would stop updating. This is because turning the screen on again causes devices to refresh, which causes all devices to be recreated, leaving the AdvancedMappingControlViewHolders stuck referencing controls belonging to devices that are no longer being updated.
2025-06-07Android: Make input state changes observableJosJuice
2025-01-01Simplify `std::find` with `Common::Contains`mitaclaw
In NandPaths.cpp, the `std::initializer_list<char>` of illegal characters has been turned into a `char[]` (similar to the one in GameList.cpp). The reverse iteration in ResourcePack.cpp seemed to provide no benefits, and doing without it it seemed to have no ill effects.
2024-11-03InputCommon: Rename AddAnalogInputs to AddFullAnalogSurfaceInputs.Jordan Woyak
2024-04-13Android/ControllerInterface: Run the init codeJosJuice
This was broken by a9a9fdd9e9. Because Init didn't run, the Android input backend would crash whenever it tried to call into JVM code.
2024-03-11InputCommon: Add Android InputBackend class.Jordan Woyak
2023-08-15ControllerInterface/Android: Add null check to AddDeviceJosJuice
The Google Play Console is showing some users getting a crash here, and indeed, InputDevice.getDevice can return null.
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-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.
2021-12-10Treewide: Adjust order of includesPokechu22
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.
2019-11-28InputCommon: Decouple ButtonManager and Touchscreen from AndroidOatmealDome
Changes were also made for codestyle compliance.
2019-11-20Android: Let WiimoteEmu know whether we have accelerometer/gyroscopeJosJuice
2019-11-20Android: Native motion controlsJosJuice
2019-06-17InputCommon: Use nested namespace specifiers where applicableLioncash
2019-05-29android: thread local envweihuoya
2019-05-06Reformat repo to clang-format 7.0 rulesTechjar
2019-01-26Android: Optimize rumble callzackhow
Moved rumble call to IDCache since GetMethodID is expensive
2019-01-19Android: Add touch to move pointer in overlayzackhow
2019-01-07Android: Change all analoginputs to just inputszackhow
Android doesn't report values for the inputs generated by FullAnalogInput so there isn't a reason to add them as such. This also avoids a bug(for android) where if there are three inputs(say 12, 11, and 121), and you generate a FullAnalogInput with 12/11 then it will create another input with the name 121 which can cause conficts with the real 121 input. This is probably not an issue on PC since most Axis inputs are named and not numbered.
2018-09-07Android: Add rumble for phonezackhow
This currently only supports using the internal vibrate on a phone for rumble.
2016-11-30ControllerInterface: replace Reinitialize with RefreshDevicesMichael Maltese
The SDL backend crashes when you close a joystick after SDL_Quit has been called. Some backends don't need to be shutdown and re-initialized everytime, we can just ask to enumerate devices again.
2016-07-14ControllerInterface: Make the ID assigning code commonLéo Lam
This makes the device ID assigning code common to all backends, by moving it to AddDevice() instead of copy-pasting or replicating the logic in the backends. Also, to prepare for hotplugging, instead of relying on a name usage count, the new ID assigning system always starts from ID 0 and tries to assign the first ID that is not used.
2016-06-25ControllerInterface: Switch to std::shared_ptrLéo Lam
Small cleanup by using std::shared_ptr and getting rid of ciface.Devices() which just returned the m_devices (which defeats the point of making m_devices protected). Incidentally, this should make the code safer when we have different threads accessing devices in the future (for hotplug?). A lot of code use Device references directly so there is no easy way to remove FindDevice() and make those unique_ptrs.
2016-06-25ControllerInterface: Don't pass m_devices to the backendsLéo Lam
Previously, the devices vector would be passed to all backends. They would then manually push_back to it to add new devices. This was fine but caused issues when trying to add synchronisation. Instead, backends now call AddDevice() to fill m_devices so that it is not accessible from the outside.
2016-06-24Reformat all the things. Have fun with merge conflicts.Pierre Bourdon
2016-01-06Move Android JNI bits from DolphinWX to the Android folder.Ryan Houdek
2016-01-04Android: More analog input configurationsPhatcat
Lets the user set the following in intervals of 10 between 10 and 100; - Stick/Radius (default 100,000000) - Triggers/Threshold (default 90,000000) - Tilt/Modifier/Range (default 50,000000) + mapped Tilt/Modifier button to the configurations for wiimotes & nunchuks
2015-12-02Wiimote + Extensions for AndroidPhatcat
2015-07-23Android: Wiimote UI Fixupsigmabeta
2015-07-21Add Wiimote support to the Android backend.Ryan Houdek
Not actually wired up to the Android UI for configuration.
2015-05-25Set copyright year to when a file was createdTillmann Karras
2015-05-25Update license headers to GPLv2+Tillmann Karras