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

Increase joystick button limit & prevent ghost press-release events from firing #59

Merged
merged 5 commits into from
Dec 23, 2019
Merged

Conversation

galister
Copy link

@galister galister commented Dec 13, 2019

Lifts the joystick button limit of 64 by using a fixed bool array instead of bit masked qword
The fixed array performs marginally faster with a memory footprint increase of 112 bytes per device.

Also fixes a race condition which can cause held buttons to trigger extra release and press events while being held.

Testing status

  • Tested on Windows using Osu!

Comments

  • Linux and OS X specific code seemed to not have the 64 limit to begin with.

This lifts the joystick button limit of 64.
The fixed array performs marginally faster with a memory footprint increase of 112 bytes per device.
@galister
Copy link
Author

ok to raise the language version here or do you want me to rewrite the code?

@galister galister changed the title JoystickState: use a fixed bool array instead of bit masked qword Increase joystick button limit & prevent ghost press-release events from firing Dec 13, 2019
peppy
peppy previously requested changes Dec 14, 2019
src/osuTK/Input/JoystickState.cs Outdated Show resolved Hide resolved
src/osuTK/Input/JoystickState.cs Outdated Show resolved Hide resolved
src/osuTK/Input/JoystickState.cs Outdated Show resolved Hide resolved
src/osuTK/Input/JoystickState.cs Show resolved Hide resolved
src/osuTK/Input/JoystickState.cs Outdated Show resolved Hide resolved
src/osuTK/Input/JoystickState.cs Outdated Show resolved Hide resolved
src/osuTK/Input/JoystickState.cs Show resolved Hide resolved
src/osuTK/Platform/Windows/WinRawJoystick.cs Show resolved Hide resolved
src/osuTK/Platform/Windows/WinRawJoystick.cs Show resolved Hide resolved
Copy link

@smoogipoo smoogipoo left a comment

Choose a reason for hiding this comment

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

This seems fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants