summaryrefslogtreecommitdiffstats
path: root/keyboards/durgod/k320/k320.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/durgod/k320/k320.c')
-rw-r--r--keyboards/durgod/k320/k320.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/keyboards/durgod/k320/k320.c b/keyboards/durgod/k320/k320.c
index f5500ea830..42091f36cd 100644
--- a/keyboards/durgod/k320/k320.c
+++ b/keyboards/durgod/k320/k320.c
@@ -40,3 +40,23 @@ void led_init_ports(void) {
off_all_leds();
}
+
+#ifndef WINLOCK_DISABLED
+static bool win_key_locked = false;
+
+bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case KC_TGUI:
+ if (record->event.pressed) {
+ // Toggle GUI lock on key press
+ win_key_locked = !win_key_locked;
+ writePin(LED_WIN_LOCK_PIN, !win_key_locked);
+ }
+ break;
+ case KC_LGUI:
+ if (win_key_locked) { return false; }
+ break;
+ }
+ return process_record_user(keycode, record);
+}
+#endif /* WINLOCK_DISABLED */