aboutsummaryrefslogtreecommitdiff
path: root/qmk/keyboards/sofle_choc/keymaps/custom
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2026-03-20 09:58:31 +0100
committerSébastien Dailly <sebastien@dailly.me>2026-03-20 09:58:31 +0100
commit815174b171625d427e1d646933100e380e256057 (patch)
tree659895de4434f57a0765a6037d98644e184615a2 /qmk/keyboards/sofle_choc/keymaps/custom
parent99ef365eb092bde14d0db1c8734466037e3e1e75 (diff)
QMK: manage the latch property of the star key betterHEADmaster
Diffstat (limited to 'qmk/keyboards/sofle_choc/keymaps/custom')
-rw-r--r--qmk/keyboards/sofle_choc/keymaps/custom/star_key.c10
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;