summaryrefslogtreecommitdiffstats
path: root/users/dshields/dshields.c
diff options
context:
space:
mode:
Diffstat (limited to 'users/dshields/dshields.c')
-rw-r--r--users/dshields/dshields.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/users/dshields/dshields.c b/users/dshields/dshields.c
new file mode 100644
index 0000000000..8f432a317c
--- /dev/null
+++ b/users/dshields/dshields.c
@@ -0,0 +1,26 @@
+#include "quantum.h"
+#include "dshields.h"
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ if (keycode == KC_ESC && record->event.pressed) {
+ bool rc = true;
+ uint8_t mods = 0;
+ if ((mods = get_oneshot_mods()) && !has_oneshot_mods_timed_out()) {
+ clear_oneshot_mods();
+ unregister_mods(mods);
+ rc = false;
+ }
+ if ((mods = get_oneshot_locked_mods())) {
+ clear_oneshot_locked_mods();
+ unregister_mods(mods);
+ rc = false;
+ }
+ if (is_oneshot_layer_active()) {
+ layer_clear();
+ rc = false;
+ }
+ return rc;
+ }
+ return true;
+}
+