-
Notifications
You must be signed in to change notification settings - Fork 282
Add support for ignoring Qukeys activation on the same hand #1539
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -141,6 +141,25 @@ class Qukeys : public kaleidoscope::Plugin { | |||||
| minimum_prior_interval_ = min_interval; | ||||||
| } | ||||||
|
|
||||||
| // Enable or disable the opposite-hands rule for home row mods. When enabled, | ||||||
| // a qukey will only resolve to its alternate (modifier) value when the | ||||||
| // subsequent key is on the opposite hand. Same-hand rollover always produces | ||||||
| // the primary (tap) value, preventing accidental modifier activation during | ||||||
| // normal typing. The hand boundary is determined by column index: columns | ||||||
| // 0 through (split_column - 1) are the left hand, and columns split_column | ||||||
| // and above are the right hand. | ||||||
| void setEnableOppositeHandsRule(bool enable) { | ||||||
| require_opposite_hands_ = enable; | ||||||
| } | ||||||
|
|
||||||
| // Set the column index that divides left and right hands. Keys with column | ||||||
| // index less than this value are considered left-hand keys. Default is 8, | ||||||
| // which is correct for Keyboardio Model 01/100 (4x16 matrix, columns 0-7 | ||||||
| // left, 8-15 right). | ||||||
| void setSplitColumn(uint8_t col) { | ||||||
| split_column_ = col; | ||||||
| } | ||||||
|
|
||||||
| // Function for defining the array of qukeys data (in PROGMEM). It's a | ||||||
| // template function that takes as its sole argument an array reference of | ||||||
| // size `_qukeys_count`, so there's no need to use `sizeof` to calculate the | ||||||
|
|
@@ -210,13 +229,21 @@ class Qukeys : public kaleidoscope::Plugin { | |||||
| Key alternate_key{Key_Transparent}; | ||||||
| } queue_head_; | ||||||
|
|
||||||
| // When true, qukeys will only resolve to their alternate value when the | ||||||
| // subsequent keypress is on the opposite hand. | ||||||
| bool require_opposite_hands_{false}; | ||||||
|
|
||||||
| // The column index that divides left and right hands. | ||||||
| uint8_t split_column_{8}; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if it would be possible (and maybe better) to use the driver data instead of hard coding a number that just so happens to work for two of Keyboardio's keyboards. I think this should work:
Suggested change
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll try it out and let you know!
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll try it out and let you know! |
||||||
|
|
||||||
| // Internal helper methods. | ||||||
| bool processQueue(); | ||||||
| void flushEvent(Key event_key); | ||||||
| bool isQukey(KeyAddr k); | ||||||
| bool isDualUseKey(Key key); | ||||||
| bool releaseDelayed(uint16_t overlap_start, uint16_t overlap_end) const; | ||||||
| bool isKeyAddrInQueueBeforeIndex(KeyAddr k, uint8_t index) const; | ||||||
| bool oppositeHands(KeyAddr a, KeyAddr b) const; | ||||||
|
|
||||||
| // Tap-repeat feature support. | ||||||
| struct { | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears to me that this clause should be outside of the parent condition, similar to the spacecadet check at L190