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

Implement joystick input #1494

Merged
merged 36 commits into from May 12, 2018
Merged

Implement joystick input #1494

merged 36 commits into from May 12, 2018

Conversation

@smoogipoo
Copy link
Contributor

@smoogipoo 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 area:input label Apr 3, 2018
@smoogipoo smoogipoo added this to the April 2018 milestone Apr 3, 2018
@smoogipoo smoogipoo mentioned this pull request Apr 3, 2018
1 of 1 task complete
@smoogipoo smoogipoo force-pushed the smoogipoo:joystick branch to 73af1ea Apr 3, 2018
@peppy
Copy link
Member

@peppy 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
Copy link
Member

@peppy 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

peppy and others added 7 commits Apr 10, 2018
+ Improve testcase a bit
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
Author 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
Author 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
Copy link
Member

@peppy 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 2 commits May 10, 2018
@peppy
peppy approved these changes May 12, 2018
Copy link
Member

@peppy peppy left a comment

looks good for now!

@peppy peppy merged commit fac6886 into ppy:master May 12, 2018
1 check passed
1 check passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@smoogipoo smoogipoo deleted the smoogipoo:joystick branch Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants