-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add touchpad left click as a target button #986
Conversation
… and XInput devices Add comment to the other files for consistency.
WalkthroughThe recent updates to the HandheldCompanion project focused on enhancing controller compatibility and functionality. By adding new namespace imports and expanding the list of target buttons for various controllers, the project now supports more user-specific customization options, such as remapping trackpad actions to button clicks for different controllers, including DS4 and DualSense. Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (7)
- HandheldCompanion/Controllers/DInputController.cs (3 hunks)
- HandheldCompanion/Controllers/DS4Controller.cs (2 hunks)
- HandheldCompanion/Controllers/DualSenseController.cs (2 hunks)
- HandheldCompanion/Controllers/GordonController.cs (2 hunks)
- HandheldCompanion/Controllers/NeptuneController.cs (2 hunks)
- HandheldCompanion/Controllers/ProController.cs (2 hunks)
- HandheldCompanion/Controllers/XInputController.cs (1 hunks)
Files skipped from review due to trivial changes (2)
- HandheldCompanion/Controllers/DualSenseController.cs
- HandheldCompanion/Controllers/NeptuneController.cs
Additional comments: 7
HandheldCompanion/Controllers/DInputController.cs (2)
- 1-1: Ensure the added namespace
HandheldCompanion.Inputs
is utilized within the file for the newly introduced functionality.- 36-37: Adding
ButtonFlags.LeftPadClick
toTargetButtons
correctly implements the feature to map the touchpad left click. Verify thatButtonFlags.LeftPadClick
is properly defined and handled elsewhere in the project.Verification successful
The verification process confirms that
ButtonFlags.LeftPadClick
is properly defined and extensively used throughout the project, including in controller logic, UI components, input management, and localization resources. This ensures that the feature to map the touchpad left click is implemented and integrated correctly across the application.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify ButtonFlags.LeftPadClick definition and usage rg "ButtonFlags.LeftPadClick"Length of output: 13302
HandheldCompanion/Controllers/ProController.cs (2)
- 20-21: Adding
ButtonFlags.LeftPadClick
toTargetButtons
correctly extends the functionality for the ProController. Ensure consistency with how target buttons are managed across different controller classes.- 20-21: The
UpdateInputs
method does not show modifications related to handling the newly added target buttons. Ensure that the addition of these buttons has the intended effect and is properly utilized within the method or elsewhere as needed.HandheldCompanion/Controllers/DS4Controller.cs (1)
- 34-34: Adding
ButtonFlags.LeftPadClick
,ButtonFlags.LeftPadTouch
, andButtonFlags.RightPadTouch
toTargetButtons
correctly extends the functionality for the DS4Controller. Ensure these buttons are properly defined and utilized within the project.Verification successful
The addition of
ButtonFlags.LeftPadClick
,ButtonFlags.LeftPadTouch
, andButtonFlags.RightPadTouch
toTargetButtons
in theDS4Controller
and their extensive usage across the project has been verified. These buttons are properly defined and utilized within the project, indicating a correct extension of functionality for the DS4Controller.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify ButtonFlags definitions and usage for newly added buttons rg "ButtonFlags.(LeftPadClick|LeftPadTouch|RightPadTouch)"Length of output: 26792
HandheldCompanion/Controllers/XInputController.cs (1)
- 36-37: Adding
ButtonFlags.LeftPadClick
toTargetButtons
correctly implements the feature to map the touchpad left click for XInput controllers. Verify that this addition is consistent with the handling of target buttons across different controller classes.HandheldCompanion/Controllers/GordonController.cs (1)
- 45-45: Adding
ButtonFlags.LeftPadClick
,ButtonFlags.RightPadClick
, andButtonFlags.LeftPadTouch
toTargetButtons
correctly extends the functionality for the GordonController. Ensure these buttons are properly defined and utilized within the project.Verification successful
The addition of
ButtonFlags.LeftPadClick
,ButtonFlags.RightPadClick
, andButtonFlags.LeftPadTouch
toTargetButtons
in the GordonController and their usage throughout the project is correctly implemented and well-integrated. The script output confirms their proper definition and utilization across various parts of the project, including UI elements, controller classes, resource files for localization, and input management logic. This demonstrates a comprehensive integration of the new functionality within the existing codebase.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify ButtonFlags definitions and usage for newly added buttons rg "ButtonFlags.(LeftPadClick|RightPadClick|LeftPadTouch)"Length of output: 30416
Nice PR @romracer ! It's a bit up for discussion if we want all the none Playstation controllers to also "input" a touchpad left click into a game. I don't think they even can? However, if these are removed and the user configures a button to be remapped this way, it would be confusing why it does not work when using an emulated xbox 360 controller. How do we currently handle the other remappable features like touchpad, are they hidden if the virtual controller is not a DS4 or DS? |
@CasperH2O |
@romracer I'm slightly confused here. You can already map any button to Single-touch click as soon as your emulated controller supports a touchpad (Dualshock 4). Here I have my XBOX LB button mapped to send a Touchpad click on my virtual DS4 controller. |
Thanks, and they can by remapping an existing button to output that touchpad click.
I'm no C# wizard, but it looks like the stacks are hidden based on the source controller, not emulated (the Trackpads section is disabled on my Xbox 360 source controller even when emulating a DS4).
Hmmm.. okay, I'll have to go back and check. This didn't used to be implemented and #799 was what kept me using MotionAssistant instead of this. |
I know @MSeys have been fixing a few issues as a side effect of his MVVM implementation and I believe incorrectly available buttons might be fixed (I also had an issue here where the available output buttons would remain available when switch from virtual DS4 to Xbox) |
@Valkirie I'm not sure how I missed it, but I guess #799 is implemented even without this PR. I do have to mark my virtual controller as a DS4 (duh) BUT I also have to mark it as connected, then Single / Multi-touch tap and Single touch click show up in the remap profile. Subsequently marking it as disconnected doesn't remove them from the list unless I restart HC - this might be similar to the bug you were referencing when going between DS / Xbox 360 virtual controllers. I'll leave this PR open in case there's any other comments that haven't been addressed (yet) but otherwise I think it can be closed if there's nothing else. |
It's regrettably that you had to find out this way indeed, there is indeed a know bug #867 with the icons and availability of the buttons. This will receive extra testing and investigating with the MVVM rebuild. I was also not aware the actual feature was implemented, as I don't use it myself.
Let's close it. Thank you for your effort, hopefully you can enjoy this feature next time you use HC. 🙂 |
This adds the touchpad left click (single touch click) from DS4 virtual controllers as a target button for DInput, Pro and Xinput controllers. This is currently available via the touchscreen, but this adds the ability to remap buttons to this function.
This is useful for situations where a game natively supports a DS4 controller on Windows and therefore most likely doesn't use the Share button from the DS4 controller. On an Xinput device, for example, the default mapping for Back/View is to the Share button, but if a game doesn't support the Share button, this can now be remapped to the touchpad click.
In Modern Warfare, for example, this makes the Back/View button which is previously unusable open the game map instead.
This doesn't change the default mapping for these controllers because there are valid uses for those cases as well.
I also added a comment to the other controller source files, but that was just for consistency for the new lines added elsewhere.
Closes #799
Summary by CodeRabbit