diff options
Diffstat (limited to 'qmk/keyboards/sofle_choc')
| -rw-r--r-- | qmk/keyboards/sofle_choc/keymaps/custom/star_key.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/qmk/keyboards/sofle_choc/keymaps/custom/star_key.c b/qmk/keyboards/sofle_choc/keymaps/custom/star_key.c index 03ce6b5..4f3cd42 100644 --- a/qmk/keyboards/sofle_choc/keymaps/custom/star_key.c +++ b/qmk/keyboards/sofle_choc/keymaps/custom/star_key.c @@ -34,7 +34,13 @@ static uint8_t star_number = 0; void star_key_process_record(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case KC_O: - star_number = (star_number + 1) % 3; + // The star key is a latch, which can work in two different ways: + // either as a one shot key, which is resolved on the next key press + // or as a modifier, which trigger if there is another one key + // pressed at the same time. + if (record->event.pressed) { + star_number = (star_number + 1) % 3; + } if (star_number != 0 && is_star == 0) { is_star = 1; is_synced = 0; @@ -47,6 +53,8 @@ void star_key_process_record(uint16_t keycode, keyrecord_t *record) { // Ignore the layer events return; default: + // Automatically disable the star key if there is another one key + // pressed if (star_number != 0) { star_number = 0; is_star = 0; |
