Skip to content

Makes Gamepad example able to be tested with Windows 10/11 #8058

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

Merged
merged 4 commits into from
Apr 10, 2023

Conversation

SuGlider
Copy link
Collaborator

Description of Change

Initial example code had no effect with Win10/11 because BUTTON_START was not recognized.
This PR makes it visible in the Windows Game Controller Testing TAB.

Tests scenarios

ESP32-S2 and ESP32-S3 (OTG mode)

Related links

#6922 (comment)
#6922 (comment)

Initial code had no effect with Win10/11 because BUTTON_START was not recognized.
This change makes it visible in the Windows Game Controller Testing TAB.
@SuGlider SuGlider added the Type: Example Issue is related to specific example. label Apr 10, 2023
@SuGlider SuGlider added this to the 2.0.8 milestone Apr 10, 2023
@SuGlider SuGlider self-assigned this Apr 10, 2023
@SuGlider SuGlider requested a review from me-no-dev April 10, 2023 14:48
if (buttonState != previousButtonState) {
if (buttonState == LOW) { // BOOT Button pressed
// changes many states
Gamepad.send(-100, 100, 50, 100, -100, -50, HAT_DOWN_RIGHT, BUTTON_TL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last argument here is mask, so correct value would be (1 << BUTTON_TL).

@me-no-dev
Copy link
Member

If BUTTON_START is not recognized, please try with other buttons. And it would be great if you use the basic API, not raw values. The example should be easier to read and understand.

@SuGlider
Copy link
Collaborator Author

SuGlider commented Apr 10, 2023

After testing all combinations, it seems that no button is recognized by Win11.
Maybe the report is different. HID Report is fine with Win10/11.

The issue is with the Windows UI -- if the specific HID Properties Windows is not Active, it doesn't display any information.

@me-no-dev
Copy link
Member

Does it all work (buttons and axis) when you have that window Active, or only some things are working? Generally that is very strange... usb report is really standard.

@SuGlider
Copy link
Collaborator Author

Does it all work (buttons and axis) when you have that window Active, or only some things are working? Generally that is very strange... usb report is really standard.

All working fine. I'll submit the changes I made to the example that are able to test everything.

It is possible to change the selected gamepad button when pressing BOOT (long/short press).
The selected button is used as parameter to change R/L Stick and Trigger as well as the Hat.
@SuGlider SuGlider requested a review from me-no-dev April 10, 2023 19:42
@me-no-dev me-no-dev merged commit 224e778 into master Apr 10, 2023
@me-no-dev me-no-dev deleted the gamepad-win10-example-fix branch April 10, 2023 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Example Issue is related to specific example.
Projects
Development

Successfully merging this pull request may close these issues.

2 participants