qmk_firmware icon indicating copy to clipboard operation
qmk_firmware copied to clipboard

[Keymap] Add new IIDX gamepad keymap for Synth Labs Solo

Open hongaaronc opened this issue 3 years ago • 0 comments

Description

These changes add another keymap, which makes this macropad function as a gamepad which works out-of-the-box with the game beatmania IIDX INFINITAS.

I have tested this keymap manually in-game, and verified that the behavior works as expected. Please also refer to the new README to see what the expected behaviors are.

Besides the different keybinds, the main difference between this keymap and other keymaps in this repository are:

  • The rotary encoder in this keymap has slightly different behavior which is required to work properly with what the game expects as input.
    • The expected behavior is that if the encoder is spun continously, the correspondingly mapped key will be held down, rather than emitting multiple keytaps like in the default or VIA keymaps. Also, reversing the direction of the encoder will release the mapped key for the previous direction.
    • The logic for determining if a key is held down is as follows:
      • When a encoder_update_user callback occurs, record the time when the encoder was updated and which direction it was turned
      • In matrix_scan_user, use the last encoder update time and compare it with the current time to determine if the encoder was recently turned or not, if not, release the corresponding key event
      • Additionally, when an encoder is updated, check if the direction has changed, and if so, release the key corresponding to the previous direction before pushing the key for new direction

Types of Changes

  • [ ] Core
  • [ ] Bugfix
  • [ ] New feature
  • [ ] Enhancement/optimization
  • [ ] Keyboard (addition or update)
  • [x] Keymap/layout/userspace (addition ~~or update~~)
  • [ ] Documentation

Issues Fixed or Closed by This PR

  • N/A

Checklist

  • [x] My code follows the code style of this project: C, Python
  • [x] 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.
  • [x] I have read the CONTRIBUTING document.
  • [ ] I have added tests to cover my changes.
  • [x] I have tested the changes and verified that they work and don't break anything (as well as I can manage).

hongaaronc avatar Oct 16 '22 02:10 hongaaronc