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

Joystick: add support for 8-way hat switch #24515

Merged
merged 2 commits into from
Nov 9, 2024

Conversation

fauxpark
Copy link
Member

Description

Hat switches function a little differently to regular joystick axes, in that they have a "null" state rather than always having a value. Therefore it cannot simply be added by increasing the axis count.

Currently the report descriptor has been set up for an 8-way hat switch, but this could potentially be increased to anything that divides evenly into 360 and gives a maximum angle that is a whole number (so not 16-way as the pitch is 22.5 degrees and the max angle is 337.5). I've not checked whether the physical min/max tags are necessary so maybe this restriction is irrelevant.

Tested on Proton-C, V-USB not tested but should work too.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@drashna drashna requested a review from a team October 24, 2024 02:40
@drashna drashna merged commit a3cfb1d into qmk:develop Nov 9, 2024
5 checks passed
@fauxpark fauxpark deleted the joystick-hat-switch branch November 10, 2024 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants