Commit Graph

150 Commits

Author SHA1 Message Date
Cameron Gutman 2636d79b86 Fix handling of ACTION_CANCEL for multi-pointer gestures 2023-08-03 02:29:55 -05:00
Cameron Gutman c9c1ef91fd Fix mishandling ACTION_MOVE events for native pen/touch events 2023-07-27 23:15:26 -05:00
Cameron Gutman 0e29e13d03 Use private API to detect clickpads on Android O and earlier 2023-07-22 14:34:27 -05:00
Cameron Gutman 16086a6d3f Send the touchpad button on the gamepad even when using the touchpad for mouse control 2023-07-12 01:16:33 -05:00
Cameron Gutman 18b6aae381 Disable gamepad sensors while in PiP mode 2023-07-12 01:07:14 -05:00
Cameron Gutman 642c353164 Fix handling of onInputDeviceChanged when using sensors and lights
DS4 triggers this path when we release our pointer capture on activity pause
2023-07-12 00:32:28 -05:00
Cameron Gutman e6876926a4 Add options to control gamepad touchpad and motion and reorganize input settings 2023-07-09 14:46:46 -05:00
Cameron Gutman 4dc6143440 Override the stock DS4 touchpad button mapping for Shield devices
Nvidia's stock mapping treats the clickpad as a second select button.
2023-07-05 23:00:54 -05:00
Cameron Gutman f1503aa56c Implement battery reporting for Shield controllers 2023-07-05 18:57:01 -05:00
Cameron Gutman d6bbfa1af1 Fix unmapped paddle and share button presses 2023-07-02 20:32:57 -05:00
Cameron Gutman 4e1b778f31 Import some SDL code and use it for controller classification
Imported as of 4aee17b039981f2bb79892f3d3e3e17bd6b66530
2023-07-02 20:20:55 -05:00
Cameron Gutman d4079940b4 Implement controller LED and battery state extensions 2023-07-02 19:03:31 -05:00
Cameron Gutman 27701eda49 Handle paddle buttons on Xbox Elite controllers 2023-06-28 17:28:25 -05:00
Cameron Gutman 71c831b02d Handle 2-direction d-pad key events 2023-06-28 17:22:05 -05:00
Cameron Gutman d1579e9b0d Support PS4/PS5 touchpad click on older kernels 2023-06-24 23:45:31 -05:00
Cameron Gutman d6f6307050 Fix units of gyro motion and deduplicate sensor events 2023-06-24 23:12:28 -05:00
Cameron Gutman a2e628f3f8 Add controller arrival metadata support 2023-06-24 20:23:43 -05:00
Cameron Gutman eed4327d26 Add controller touchpad support 2023-06-24 19:09:10 -05:00
Cameron Gutman 5c6eaf2602 Add controller gyro and accelerometer support 2023-06-24 19:06:58 -05:00
Cameron Gutman 71169ed740 Add trigger rumble support 2023-06-24 17:59:10 -05:00
Cameron Gutman dca8d93aa8 Add Share button mapping for Xbox Series X controller 2023-06-24 16:16:02 -05:00
Cameron Gutman 6cb152f602 Increase gamepad limit to 16 for Sunshine hosts 2023-06-24 16:15:00 -05:00
Cameron Gutman ddefda3afa Plumb new Sunshine protocol extensions 2023-06-24 15:19:50 -05:00
Cameron Gutman 19b6e94824 Add horizontal scrolling in mouse emulation mode 2023-03-04 12:31:31 -06:00
Cameron Gutman 945e563912 Switch to a Handler for gamepad mouse emulation 2022-09-17 12:55:15 -05:00
Cameron Gutman a73129243c Compensate for button down time when computing extra minimum button down 2022-08-02 18:14:10 -05:00
Cameron Gutman 54a6aa9081 Remove emulated button sleeps 2022-08-02 18:08:53 -05:00
Cameron Gutman eb2e79977d Use event time on input events rather than current uptime 2022-08-02 18:07:15 -05:00
Cameron Gutman a80d30baf7 Revert "Add support for 8bitdo sn30 pro xCloud (#1102)"
The broken mapping is due to an old firmware (see #978).

This reverts commit bfc3116661.
2022-07-31 17:12:52 -05:00
peerobo bfc3116661 Add support for 8bitdo sn30 pro xCloud (#1102)
* add support for 8bitdo sn30 pro xCloud

Co-authored-by: peerobo <phuongrobotics@me.com>
2022-07-20 08:37:32 -05:00
Cameron Gutman 1ed7ecc82f Don't use FLAG_BYPASS_INTERRUPTION_POLICY
See https://issuetracker.google.com/issues/235875658
2022-07-19 23:02:31 -05:00
Cameron Gutman ebd327c7a6 Use new ShieldControllerExtensions library for Shield Controller rumble support
https://github.com/cgutman/ShieldControllerExtensions
2022-06-30 18:04:02 -05:00
Cameron Gutman a8479ccb5f Implement support for rumble for Shield controllers on Shield devices 2022-06-09 18:51:23 -05:00
Cameron Gutman 9fc5496526 Use VibrationAttributes to bypass interruption policy 2022-06-08 20:26:36 -05:00
Cameron Gutman 286094ee33 Add dead zone configuration option
Fixes #1075
2022-05-28 15:12:58 -05:00
Cameron Gutman fb09c9692c Fix handling of InterruptedExceptions 2022-05-22 15:31:06 -05:00
Cameron Gutman 54af70005d Fix spurious gamepad removal when entering PiP with PS4 controller on Android 12
The relative mouse axes AXIS_RELATIVE_X/Y are added/removed when gaining/losing input focus
2021-07-16 19:51:14 -05:00
Cameron Gutman f2bf168925 Fix possible rumble crash if only the lower motor byte is non-zero 2021-07-16 19:25:10 -05:00
Cameron Gutman 73784585a8 Fix new Android 12 rumble code based on real hardware testing
Independent rumble motor controller tested working on:
- DualShock 4 (USB and BT)
- DualShock 3 (USB)
- Xbox Series X (USB)
2021-07-15 19:51:08 -05:00
Cameron Gutman 262d562dd9 Implement enhanced rumble support for Android 12 devices
This allows independent control of large and small motors which
was not possible with the old single Vibrator API.

Currently untested on real hardware.
2021-07-14 20:18:35 -05:00
Cameron Gutman da103f7197 Don't use our built-in Switch Pro mapping on Android 10+ 2021-02-28 16:35:17 -06:00
Cameron Gutman 1c806bb572 Only use the virtual device as a gamepad if at least one gamepad is present 2021-01-31 19:42:41 -06:00
Cameron Gutman 963133598f Add hack to work around https://issuetracker.google.com/issues/163120692 2021-01-31 19:29:57 -06:00
Cameron Gutman 91d739f8d6 Use the Nvidia button on Shield controllers as a Guide button 2020-10-18 21:14:53 -05:00
Cameron Gutman f0c625d85c Only emulate buttons that aren't physically present 2020-10-18 21:07:43 -05:00
Cameron Gutman b5f5e73076 Revert "Remove button emulation"
This reverts commit 092830ed07.
2020-10-18 20:45:11 -05:00
Cameron Gutman 2ba7feedfc Fix several Lint warnings 2020-07-04 15:41:41 -05:00
Cameron Gutman 092830ed07 Remove button emulation
It was never well documented to users and it really only makes sense
with much older controllers that don't have Start or Select buttons.
2020-06-23 22:00:56 -07:00
Cameron Gutman 4306ba5004 Add a mapping for the Nintendo Switch Pro controller
Fixes #842
2020-06-10 21:05:08 -07:00
Christoph Papke 363145a284 Optimize button mapping for 8BitDo controllers (#826)
* Optimize button mapping for 8BitDo controllers #825
2020-05-05 16:04:31 -07:00