Skip to content

Commit

Permalink
Add comments to per-key function samples in tap-hold docs
Browse files Browse the repository at this point in the history
As suggested in the review, add comments before return statements in
sample implementations of `get_ignore_mod_tap_interrupt()`,
`get_hold_on_other_key_press()` and `get_permissive_hold()`.
  • Loading branch information
sigprof committed Sep 2, 2020
1 parent 4b40805 commit 7ea8c1e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/tap_hold.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ You can then add the following function to your keymap:
bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case LT(1, KC_BSPC):
// Immediately select the tap action when another key is tapped.
return true;
default:
// Do not select the tap action when another key is tapped.
return false;
}
}
Expand Down Expand Up @@ -133,8 +135,10 @@ You can then add the following function to your keymap:
bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case LT(1, KC_BSPC):
// Immediately select the tap action when another key is pressed.
return true;
default:
// Do not select the tap action when another key is pressed.
return false;
}
}
Expand Down Expand Up @@ -178,8 +182,12 @@ You can then add the following function to your keymap:
bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case SFT_T(KC_SPC):
// Do not force the mod-tap key press to be handled as a modifier
// if any other key was pressed while the mod-tap key is held down.
return true;
default:
// Force the mod-tap key press to be handled as a modifier if any
// other key was pressed while the mod-tap key is held down.
return false;
}
}
Expand Down

0 comments on commit 7ea8c1e

Please sign in to comment.