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

Merged
merged 36 commits into from May 12, 2018

Conversation

2 participants
@smoogipoo
Contributor

smoogipoo commented Apr 3, 2018

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).

@smoogipoo smoogipoo added the input label Apr 3, 2018

@smoogipoo smoogipoo added this to the April 2018 milestone Apr 3, 2018

@smoogipoo smoogipoo referenced this pull request Apr 3, 2018

Merged

Implement joystick input #2346

1 of 1 task complete
@peppy

This comment has been minimized.

Member

peppy commented Apr 10, 2018

  • Hats should probably be mapped to axes. Implementation should be simple.
  • We need a deadzone for axes by default. Even with multiple calibrations, it's impossible to get 0.00 on most any analog sticks.
@peppy

This comment has been minimized.

Member

peppy commented Apr 10, 2018

Axis to button mapping is currently also very wrong. No matter which axis I trigger, it is always in Axis 1

xAxis = -1;
else if (hatState.IsRight)
xAxis = 1;
if (hatState.IsDown)

This comment has been minimized.

@peppy

peppy Apr 15, 2018

Member

back to front?

This comment has been minimized.

@smoogipoo

smoogipoo Apr 15, 2018

Contributor

What do you mean?

This comment has been minimized.

@peppy

peppy Apr 15, 2018

Member

isup became positive

This comment has been minimized.

@smoogipoo

smoogipoo Apr 15, 2018

Contributor

What would you expect it to be?

This comment has been minimized.

@peppy

peppy Apr 16, 2018

Member

The same as every other axis button ._.

@peppy

This comment has been minimized.

Member

peppy commented Apr 15, 2018

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.

{
public IEnumerable<JoystickButton> Buttons { get; set; } = new List<JoystickButton>();
public IReadOnlyList<float> Axes { get; set; } = new List<float>();

This comment has been minimized.

@peppy

peppy Apr 15, 2018

Member

this seems to always be empty

@peppy peppy modified the milestones: April 2018, May 2018 May 2, 2018

peppy added some commits May 10, 2018

@peppy

peppy approved these changes May 12, 2018

looks good for now!

@peppy peppy merged commit fac6886 into ppy:master May 12, 2018

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment