summaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
authorzer09 <zer09@users.noreply.github.com>2018-12-10 00:28:46 +0800
committerDrashna Jaelre <drashna@live.com>2018-12-09 08:28:46 -0800
commit614b3a0f7ca266f9d625814a3bbd1c2de34f2f0f (patch)
tree75b135fb2fd6dd896caadc190090bd2e5e900f33 /users
parent11eaccdbce5246e7235ff91d0d04de83f7685919 (diff)
Keymap: Keymap update (#4579)
* Add YREG keycode * Add GM layer * Set tapping term to 105 * update tapping term
Diffstat (limited to 'users')
-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 4cb65c258f..c5ab32f8d4 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 a23705ad8b..e99b26cca0 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 75c1d3cad4..acac8ab09f 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