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
Implement joystick input #1494
Implement joystick input #1494
Conversation
To properly handle in PassThroughInputManagers.
|
Axis to button mapping is currently also very wrong. No matter which axis I trigger, it is always in |
+ Improve testcase a bit
xAxis = -1; | ||
else if (hatState.IsRight) | ||
xAxis = 1; | ||
if (hatState.IsDown) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
I think we may need to have all axes calibrate on startup (on first input frame) to find their zero points. Some controllers (XBOne in this case) have -1 as the default "zero" point for triggers. |
osu.Framework/Input/JoystickState.cs
Outdated
{ | ||
public IEnumerable<JoystickButton> Buttons { get; set; } = new List<JoystickButton>(); | ||
|
||
public IReadOnlyList<float> Axes { get; set; } = new List<float>(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Doesn't work yet due to issues elsewhere.
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.
looks good for now!
Axes + buttons are implemented.
IJoystickState
provices:Buttons
: All the pressed buttons. These include axes as buttons, which is what mania/taiko/catch(?)/osu are all going to use.Axes
: The raw values of all axes.AxisDelta()
: To get the delta for one axis.Currently supports 20 buttons + 10 axes. We can increase this later if needed but it's already a very extreme use-case.
Hats not implemented (I don't have a controller to test these with anyway).Tested on my FP7 EMP controller.
Supports keybindings (see changes in
InputKey
).