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

New combo configuration options #15083

Merged
merged 3 commits into from
Jan 9, 2022
Merged

Conversation

sevanteri
Copy link
Contributor

@sevanteri sevanteri commented Nov 6, 2021

Description

Here's a couple of new configuration features for combos.

COMBO_MUST_PRESS_IN_ORDER to force combos to only activate if the keys are pressed in the same order as they are defined in the combo's key array.

Per combo configuration can be modified by defining COMBO_MUST_PRESS_IN_ORDER_PER_COMBO and defining
bool get_combo_must_press_in_order(uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record) function in which you choose which combos require the correct key order.

This feature even allows multiple combos from the same keys. For example on qwerty layout, JK can produce / and KJ can produce \. Just define two combos using the same keys but put the keycodes in reverse order for the other one.

COMBO_SHOULD_TRIGGER and its companying function bool combo_should_trigger(uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record) enable disallowing combos to be activated when you choose so. For
example on certain layers, or when a timer is running.

Types of Changes

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

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

`COMBO_MUST_PRESS_IN_ORDER` to force combos to only activate if the keys
are pressed in the same order as they are defined in the combo's key
array.

Per combo configuration can be modified by defining
`COMBO_MUST_PRESS_IN_ORDER_PER_COMBO` and defining
`bool get_combo_must_press_in_order(uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record)`
function in which you choose which combos require the correct key order.

`COMBO_SHOULD_TRIGGER` and its companying function
`bool combo_should_trigger(uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record)`
enable disallowing combos to be activated when you choose so. For
example on certain layers, or when a timer is running.
@tzarc tzarc requested a review from a team December 27, 2021 00:57
docs/feature_combo.md Outdated Show resolved Hide resolved
docs/feature_combo.md Show resolved Hide resolved
Co-authored-by: precondition <[email protected]>
@fauxpark
Copy link
Member

fauxpark commented Jan 6, 2022

Submodule changes need to be rolled back.

@sevanteri
Copy link
Contributor Author

Submodule changes need to be rolled back.

The one time I think git commit -a is fine...

@drashna drashna merged commit 21958a9 into qmk:develop Jan 9, 2022
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.

6 participants