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 HID keyboard mode #88

Merged
merged 10 commits into from
Aug 19, 2024
Merged

Implement HID keyboard mode #88

merged 10 commits into from
Aug 19, 2024

Conversation

ASleepyCat
Copy link
Collaborator

@ASleepyCat ASleepyCat commented Jul 9, 2024

Closes #86.

Keyboard mode has support for HID lighting. HID and keyboard inputs cannot be enabled at the same time, although this can be changed fairly easily if someone wants both inputs sent at the same time.

Due to button restrictions (IIDX back-compat and SDVX only having nine and seven buttons respectively), I've made input mode switching performable only on boot.

Buttons and analog mappings will need to be rebinded in spicecfg, etc. after this is merged.

Major refactoring in general:

  • Add support for keyboard input for IIDX and SDVX
    • IIDX only uses keyboard inputs, SDVX has keyboard and mouse inputs
    • Add HID interfaces for keyboard and mouse input data
      • Each interface can only support one IN and OUT endpoint, so having keyboard and mouse support requires multiple interfaces (at least on our MCU, not sure if this a USB HID or AVR limitation)
  • Remove most function pointers for update calls, replace them with classes
  • Rename analog_turntable to analog_button since it's also used for SDVX knobs
  • Removed function pointers for CALLBACK_USB_GetDescriptor(), instead assign some global variables
  • Renamed some enums from SCREAMING_SNAKE_CASE to PascalCase
  • Change FIXED_CONTROL_ENDPOINT_SIZE and HID_EPSIZE to 64
  • Enable INTERRUPT_CONTROL_ENDPOINT
  • Cleaned up HID report descriptors a little
  • Ignore button inputs if pressed after boot
    • This is mainly to prevent keyboard inputs being sent when inputting a boot combo
  • Fix LR2 compatibility (closes Lunatic Rave 2 not working with beefboard anymore #89)
    • LR2 expects both X and Y axis to be present
  • Fix X and Y axis in SDVX joystick report descriptor being flipped
  • Suppress some warnings in fastled_shim.h

@ASleepyCat ASleepyCat marked this pull request as ready for review August 3, 2024 04:39
@ASleepyCat ASleepyCat requested a review from HWXLR8 August 3, 2024 04:39
Copy link
Owner

@HWXLR8 HWXLR8 left a comment

Choose a reason for hiding this comment

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

Thanks for the huge effort. Code looks good. I don't want to introduce more variables into the mix, so I will defer merging until we have the TT issues sorted.

@HWXLR8
Copy link
Owner

HWXLR8 commented Aug 19, 2024

On second thought, I will merge since your optimization pass PR is based off the same branch. I am an idiot, I stopped reading at "keyboard-mode"
image

@HWXLR8 HWXLR8 merged commit 2163980 into master Aug 19, 2024
2 checks passed
@ASleepyCat ASleepyCat deleted the keyboard-mode branch August 20, 2024 07:37
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.

Lunatic Rave 2 not working with beefboard anymore Implement keyboard mode
2 participants