aboutsummaryrefslogtreecommitdiffstats
path: root/users/zer09
diff options
context:
space:
mode:
Diffstat (limited to 'users/zer09')
-rw-r--r--users/zer09/config.h4
-rw-r--r--users/zer09/tap_dance.c27
-rw-r--r--users/zer09/zer09.h10
3 files changed, 35 insertions, 6 deletions
diff --git a/users/zer09/config.h b/users/zer09/config.h
index 4cb65c258..c5ab32f8d 100644
--- a/users/zer09/config.h
+++ b/users/zer09/config.h
@@ -16,13 +16,13 @@
#define FORCE_NKRO
#ifndef TAPPING_TOGGLE
-#define TAPPING_TOGGLE 1
+#define TAPPING_TOGGLE 1
#endif
#ifdef TAPPING_TERM
#undef TAPPING_TERM
#endif
-#define TAPPING_TERM 120
+#define TAPPING_TERM 95
// Disable action_get_macro and fn_actions, since we don't use these
// and it saves on space in the firmware.
diff --git a/users/zer09/tap_dance.c b/users/zer09/tap_dance.c
index a23705ad8..e99b26cca 100644
--- a/users/zer09/tap_dance.c
+++ b/users/zer09/tap_dance.c
@@ -17,15 +17,27 @@ qk_tap_dance_action_t tap_dance_actions[] = {
};
volatile uint8_t active_layer = _BL;
+volatile uint8_t gm_layer_act = false;
static tap upltap_state = {.state = 0};
static tap dwltap_state = {.state = 0};
static tap lsprtap_state = {.state = 0};
static tap ralttap_state = {.state = 0};
void layer_switcher_tap(uint8_t new_layer) {
- layer_off(active_layer);
- layer_on(new_layer);
- active_layer = new_layer;
+ if (gm_layer_act == true) {
+ layer_off(active_layer);
+ if (new_layer == _BL) {
+ layer_on(_GM);
+ active_layer = _GM;
+ } else {
+ layer_on(new_layer);
+ active_layer = new_layer;
+ }
+ } else {
+ layer_off(active_layer);
+ layer_on(new_layer);
+ active_layer = new_layer;
+ }
}
int cur_dance(qk_tap_dance_state_t *state) {
@@ -162,6 +174,14 @@ void dance_dwly_finished(qk_tap_dance_state_t *state, void *user_data) {
case DOUBLE_HOLD:
layer_switcher_tap(_AL);
break;
+ case TRIPLE_TAP:
+ if (gm_layer_act == true) {
+ gm_layer_act = false;
+ layer_switcher_tap(_BL);
+ } else {
+ gm_layer_act = true;
+ layer_switcher_tap(_GM);
+ }
default:
layer_switcher_tap(_BL);
break;
@@ -174,6 +194,7 @@ void dance_dwly_reset(qk_tap_dance_state_t *state, void *user_data) {
break;
case SINGLE_HOLD:
case DOUBLE_HOLD:
+ case TRIPLE_TAP:
default:
layer_switcher_tap(_BL);
break;
diff --git a/users/zer09/zer09.h b/users/zer09/zer09.h
index 75c1d3cad..acac8ab09 100644
--- a/users/zer09/zer09.h
+++ b/users/zer09/zer09.h
@@ -3,16 +3,24 @@
#include "quantum.h"
-enum custom_keycodes { CK_SAFE = SAFE_RANGE, RGUP, RGDWN, NEWPLACEHOLDER };
+enum custom_keycodes {
+ CK_SAFE = SAFE_RANGE,
+ RGUP,
+ RGDWN,
+ YREG,
+ NEW_SAFE_RANGE
+};
#define _______ KC_TRNS
#define KC_RGUP RGUP
#define KC_RGDWN RGDWN
+#define KC_YREG YREG
#define _BL 0 // The base layer
#define _UL 1 // The up layer
#define _DL 2 // The down layer
#define _VL 3 // The shifted up layer
#define _AL 4 // The assorted layer
+#define _GM 5
#endif