Skip to content
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

fix: ignore gamepads that are masked by steam input to prevent dublicated inputs #3470

Merged

Conversation

bmsuseluda
Copy link
Contributor

<--- Put the description here --->
Fixes #989

Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@flavioislima
Copy link
Member

flavioislima commented Jan 24, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@bmsuseluda
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@Etaash-mathamsetty
Copy link
Member

thanks for this, ill test soon

return valveGamepads.find(
(valveGamepad) =>
valveGamepad &&
Math.abs(valveGamepad.timestamp - gamepad.timestamp) <= 10
Copy link
Member

@Etaash-mathamsetty Etaash-mathamsetty Jan 27, 2024

Choose a reason for hiding this comment

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

why is this needed btw? (the math.abs)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sadly the timestamps of the masked gamepad and steam input gamepad are not identical. most of the time there is a difference of 5, but sometimes it is up to 8. Therefore i used 10 to be sure to catch the masked gamepad. sadly the nearly identical timestamp is the only thing they have in common.

Copy link
Contributor Author

@bmsuseluda bmsuseluda Jan 30, 2024

Choose a reason for hiding this comment

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

@Etaash-mathamsetty i added some jsDoc to clarify the filtering. I hope this helps a bit.
After adding jsDoc comments the code check and test task fail in files i did not change. Could you explain and help me with this?

@arielj
Copy link
Collaborator

arielj commented Feb 7, 2024

@bmsuseluda I'm testing this and it seems to work as expected, but there are some code check and test failures, can you check that? I think you only need to get this branch up to date with the main branch

@bmsuseluda
Copy link
Contributor Author

@arielj thanks for the tip. the checks are green again 😃

Copy link
Collaborator

@arielj arielj left a comment

Choose a reason for hiding this comment

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

thanks! I'll merge this

@arielj arielj merged commit 2b0b6c9 into Heroic-Games-Launcher:main Feb 8, 2024
@Heroic-Games-Launcher Heroic-Games-Launcher locked and limited conversation to collaborators Feb 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Masking some joystick inputs when a Steam Virtual Controller is active
4 participants