summaryrefslogtreecommitdiff
path: root/users/davidkristoffersen/hardware/split_space.c
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2022-07-02 12:18:55 +0000
committerQMK Bot <hello@qmk.fm>2022-07-02 12:18:55 +0000
commitfa0aea2a5abf55237bc1c4a8180af68833f1935a (patch)
tree949b591e0e928f49f6b435359cba83a563ea06b8 /users/davidkristoffersen/hardware/split_space.c
parent65832c0fc3e502582986a8fa7c561c39d9fc447f (diff)
parenta80943579c88255fff9de57978b8e577d184785c (diff)
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'users/davidkristoffersen/hardware/split_space.c')
-rw-r--r--users/davidkristoffersen/hardware/split_space.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/users/davidkristoffersen/hardware/split_space.c b/users/davidkristoffersen/hardware/split_space.c
new file mode 100644
index 0000000000..da25343f3d
--- /dev/null
+++ b/users/davidkristoffersen/hardware/split_space.c
@@ -0,0 +1,23 @@
+// Copyright 2022 David Kristoffersen (@davidkristoffersen)
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "split_space.h"
+
+#ifdef SPLIT_SPACE
+void handle_split_space(uint16_t keycode) {
+ // Disable modifiers when numpad is active
+ if (IS_LAYER_ON(NUMPAD)) clear_oneshot_mods();
+
+ if (keycode == KC_LSPC) {
+ // 2ng tap: Activate ctrl if shift is active
+ if (get_oneshot_mods() & MOD_MASK_SHIFT) {
+ clear_oneshot_mods();
+ set_oneshot_mods(MOD_LCTL);
+ }
+ // 1st. tap: Activate shift if no modifier is active
+ else {
+ set_oneshot_mods(MOD_LSFT);
+ }
+ }
+}
+#endif