aboutsummaryrefslogtreecommitdiffstats
path: root/users/sethBarberee
diff options
context:
space:
mode:
authorGravatar Seth Barberee <seth.barberee@gmail.com>2019-08-13 12:25:51 -0500
committerGravatar Drashna Jaelre <drashna@live.com>2019-08-13 10:25:51 -0700
commit0ec0d29e9f4d83af724d69efbaefeece57faddd9 (patch)
treea0334556fb16005ae2a98ffd1c5635c8d56476ac /users/sethBarberee
parentd8d2a096742f611e3ade527e7224e8281867c563 (diff)
downloadqmk_firmware-0ec0d29e9f4d83af724d69efbaefeece57faddd9.tar.gz
[Keymap] Adding my userspace and keymaps (#6496)
* add Userspace and keymaps * Adding keymaps for zeal60 and iris * Created my own tap dance that toggles RGB Mode based on whether I toggled caps lock or not * parent 578ed42a7f8f986147cad040d50d4ae1d24a32e2 author Seth Barberee <seth.barberee@gmail.com> 1565065903 -0500 committer Seth Barberee <seth.barberee@gmail.com> 1565065903 -0500 move to userspace add zeal60 * update based on review * move userspace to github name
Diffstat (limited to 'users/sethBarberee')
-rw-r--r--users/sethBarberee/config.h8
-rw-r--r--users/sethBarberee/readme.md6
-rw-r--r--users/sethBarberee/rules.mk1
-rw-r--r--users/sethBarberee/sethBarberee.c45
-rw-r--r--users/sethBarberee/sethBarberee.h20
5 files changed, 80 insertions, 0 deletions
diff --git a/users/sethBarberee/config.h b/users/sethBarberee/config.h
new file mode 100644
index 000000000..a849ac0e7
--- /dev/null
+++ b/users/sethBarberee/config.h
@@ -0,0 +1,8 @@
+#ifdef RGBLIGHT_ENABLE
+# ifndef CAPS_LOCK_MODE
+# define CAPS_LOCK_MODE 1
+# endif
+# ifndef NORMAL_MODE
+# define NORMAL_MODE 4
+# endif
+#endif
diff --git a/users/sethBarberee/readme.md b/users/sethBarberee/readme.md
new file mode 100644
index 000000000..75d892cb8
--- /dev/null
+++ b/users/sethBarberee/readme.md
@@ -0,0 +1,6 @@
+# seth's userspace
+
+## Features
+* Escape/Caps Lock tap dance (1 for Escape / 2 for Caps Lock)
+ * RGB Mode indication for Caps Lock
+ * Solid Mode for Caps On
diff --git a/users/sethBarberee/rules.mk b/users/sethBarberee/rules.mk
new file mode 100644
index 000000000..d8aef6052
--- /dev/null
+++ b/users/sethBarberee/rules.mk
@@ -0,0 +1 @@
+SRC += sethBarberee.c
diff --git a/users/sethBarberee/sethBarberee.c b/users/sethBarberee/sethBarberee.c
new file mode 100644
index 000000000..10f78f63b
--- /dev/null
+++ b/users/sethBarberee/sethBarberee.c
@@ -0,0 +1,45 @@
+#include "sethBarberee.h"
+#ifdef RGBLIGHT_ENABLE
+#ifdef TAP_DANCE_ENABLE
+
+// Initialize it now
+tap caps_status = {
+ .toggled = false,
+ .toggle_mode = CAPS_LOCK_MODE,
+ .normal_mode = NORMAL_MODE
+};
+
+void dance_ecap_finished (qk_tap_dance_state_t *state, void *user_data){
+ if(state->count == 1){
+ register_code(KC_ESC);
+ } else {
+ register_code(KC_CAPS);
+ if(!caps_status.toggled){
+ // Toggling caps so indicate
+ caps_status.toggled = true;
+ rgblight_mode_noeeprom(caps_status.toggle_mode);
+ } else {
+ // Turning off so return to normal mode
+ caps_status.toggled = false;
+ rgblight_mode_noeeprom(caps_status.normal_mode);
+ }
+ }
+}
+
+void dance_ecap_reset (qk_tap_dance_state_t *state, void *user_data){
+ if(state->count == 1){
+ unregister_code(KC_ESC);
+ } else {
+ unregister_code(KC_CAPS);
+ }
+}
+
+//Tap Dance Definitions
+qk_tap_dance_action_t tap_dance_actions[] = {
+ //Tap once for Esc, twice for Caps Lock
+ [TD_ECAP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_ecap_finished, dance_ecap_reset),
+// Other declarations would go here, separated by commas, if you have them
+};
+
+#endif
+#endif
diff --git a/users/sethBarberee/sethBarberee.h b/users/sethBarberee/sethBarberee.h
new file mode 100644
index 000000000..23774ba4e
--- /dev/null
+++ b/users/sethBarberee/sethBarberee.h
@@ -0,0 +1,20 @@
+#ifndef USERSPACE
+#define USERSPACE
+
+#include "quantum.h"
+
+#ifdef TAP_DANCE_ENABLE // only enable for tap dances
+ enum {
+ TD_ECAP = 0,
+ };
+
+ #define KC_ECAP TD(TD_ECAP)
+
+ typedef struct {
+ bool toggled; // store whether we have toggled caps lock
+ int toggle_mode; // idk why but maybe do something with this..
+ int normal_mode;
+ } tap;
+#endif
+
+#endif