From 7ea8c1ec51a62c131f1a321cf901e737c05fdf63 Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Thu, 3 Sep 2020 00:48:47 +0300 Subject: [PATCH] Add comments to per-key function samples in tap-hold docs 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()`. --- docs/tap_hold.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/tap_hold.md b/docs/tap_hold.md index edb3d832067e..e9bc748e6a42 100644 --- a/docs/tap_hold.md +++ b/docs/tap_hold.md @@ -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; } } @@ -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; } } @@ -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; } }