summaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
Diffstat (limited to 'users')
-rw-r--r--users/arkag/arkag.c286
-rw-r--r--users/arkag/arkag.h35
-rw-r--r--users/arkag/config.h2
-rw-r--r--users/cbbrowne/cbbrowne.c0
-rw-r--r--users/cbbrowne/cbbrowne.h39
-rw-r--r--users/cbbrowne/rules.mk1
-rw-r--r--users/drashna/config.h8
-rw-r--r--users/drashna/drashna.c6
-rw-r--r--users/drashna/drashna.h5
-rw-r--r--users/drashna/process_records.c45
-rw-r--r--users/drashna/rgb_stuff.c37
-rw-r--r--users/drashna/rules.mk4
-rw-r--r--users/edvorakjp/edvorakjp.c6
-rw-r--r--users/edvorakjp/edvorakjp.h26
-rw-r--r--users/edvorakjp/edvorakjp_process_record.c129
-rw-r--r--users/edvorakjp/edvorakjp_status.c13
-rw-r--r--users/edvorakjp/edvorakjp_tap_dance.c36
-rw-r--r--users/edvorakjp/readme.md54
-rw-r--r--users/jarred/config.h1
-rw-r--r--users/jarred/jarred.c69
-rw-r--r--users/jarred/jarred.h87
-rw-r--r--users/konstantin/konstantin.c54
-rw-r--r--users/konstantin/konstantin.h33
-rw-r--r--users/konstantin/rgb.c24
-rw-r--r--users/konstantin/rgb.h18
-rw-r--r--users/konstantin/rules.mk15
-rw-r--r--users/konstantin/tap_dance.c126
-rw-r--r--users/konstantin/tap_dance.h12
-rw-r--r--users/konstantin/unicode.c7
-rw-r--r--users/konstantin/unicode.h37
-rw-r--r--users/mechmerlin/changelog.md8
-rw-r--r--users/mechmerlin/config.h34
-rw-r--r--users/mechmerlin/readme.md10
-rw-r--r--users/mechmerlin/rules.mk2
-rw-r--r--users/stanrc85/config.h9
-rw-r--r--users/stanrc85/layer_rgb.c26
-rw-r--r--users/stanrc85/readme.md52
-rw-r--r--users/stanrc85/rules.mk16
-rw-r--r--users/stanrc85/stanrc85.c84
-rw-r--r--users/stanrc85/stanrc85.h44
40 files changed, 986 insertions, 514 deletions
diff --git a/users/arkag/arkag.c b/users/arkag/arkag.c
index 212d06de67..9e8c7af247 100644
--- a/users/arkag/arkag.c
+++ b/users/arkag/arkag.c
@@ -5,34 +5,7 @@
https://github.com/arkag/qmk_firmware/blob/master/keyboards/mechmini/v2/keymaps/arkag/keymap.c
*/
-// Start: Written by konstantin: vomindoraan
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
-void send_unicode_hex_string(const char *str) {
- if (!str) { return; } // Saftey net
- while (*str) {
- // Find the next code point (token) in the string
- for (; *str == ' '; str++);
- size_t n = strcspn(str, " "); // Length of the current token
- char code_point[n+1];
- strncpy(code_point, str, n);
- code_point[n] = '\0'; // Make sure it's null-terminated
-
- // Normalize the code point: make all hex digits lowercase
- for (char *p = code_point; *p; p++) {
- *p = tolower(*p);
- }
-
- // Send the code point as a Unicode input string
- unicode_input_start();
- send_string(code_point);
- unicode_input_finish();
- str += n; // Move to the first ' ' (or '\0') after the current token
- }
-}
-// End: Written by konstantin: vomindoraan
+#include <stdbool.h>
// Start: Written by Chris Lewis
#ifndef MIN
@@ -78,6 +51,8 @@ Color underglow,
flashState flash_state = no_flash;
fadeState fade_state = add_fade;
activityState state = boot;
+bool aesthetic = false,
+ shifty = false;
void set_color (Color new, bool update) {
rgblight_sethsv_eeprom_helper(new.h, new.s, new.v, update);
@@ -146,7 +121,7 @@ void check_state (void) {
case sleeping:
if (!slept) {
- rgblight_mode_noeeprom(4);
+ rgblight_mode_noeeprom(5);
slept = true;
activated = false;
deactivated = false;
@@ -249,11 +224,6 @@ void set_os (uint8_t os, bool update) {
num_extra_flashes_off = 1;
}
-void tap_key(uint8_t keycode) {
- register_code(keycode);
- unregister_code(keycode);
-}
-
// register GUI if Mac or Ctrl if other
void pri_mod(bool press) {
if (press) {
@@ -293,13 +263,13 @@ void surround_type(uint8_t num_of_chars, uint16_t keycode, bool use_shift) {
register_code(KC_LSFT);
}
for (int i = 0; i < num_of_chars; i++) {
- tap_key(keycode);
+ tap_code(keycode);
}
if (use_shift) {
unregister_code(KC_LSFT);
}
for (int i = 0; i < (num_of_chars/2); i++) {
- tap_key(KC_LEFT);
+ tap_code(KC_LEFT);
}
}
@@ -307,7 +277,7 @@ void long_keystroke(size_t num_of_keys, uint16_t keys[]) {
for (int i = 0; i < num_of_keys-1; i++) {
register_code(keys[i]);
}
- tap_key(keys[num_of_keys-1]);
+ tap_code(keys[num_of_keys-1]);
for (int i = 0; i < num_of_keys-1; i++) {
unregister_code(keys[i]);
}
@@ -315,7 +285,10 @@ void long_keystroke(size_t num_of_keys, uint16_t keys[]) {
void dance_grv (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
- tap_key(KC_GRV);
+ tap_code(KC_GRV);
+ if (aesthetic) {
+ tap_code(KC_SPACE);
+ }
} else if (state->count == 2) {
surround_type(2, KC_GRAVE, false);
} else {
@@ -325,7 +298,10 @@ void dance_grv (qk_tap_dance_state_t *state, void *user_data) {
void dance_quot (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
- tap_key(KC_QUOT);
+ tap_code(KC_QUOT);
+ if (aesthetic) {
+ tap_code(KC_SPACE);
+ }
} else if (state->count == 2) {
surround_type(2, KC_QUOTE, false);
} else if (state->count == 3) {
@@ -333,35 +309,73 @@ void dance_quot (qk_tap_dance_state_t *state, void *user_data) {
}
}
-void dance_strk (qk_tap_dance_state_t *state, void *user_data) {
+void dance_hyph (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
- surround_type(4, KC_TILDE, true);
+ tap_code(KC_MINS);
+ if (aesthetic) {
+ tap_code(KC_SPACE);
+ }
} else if (state->count == 2) {
- if (current_os == OS_MAC) {
- long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_4});
- } else if (current_os == OS_WIN) {
- long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_S});
- } else {
- return;
+ register_code(KC_LSFT);
+ tap_code(KC_MINS);
+ if (aesthetic) {
+ tap_code(KC_SPACE);
}
+ unregister_code(KC_LSFT);
+ } else if (state->count == 3) {
+ send_unicode_hex_string("2014");
}
}
-void dance_3 (qk_tap_dance_state_t *state, void *user_data) {
+void dance_obrck (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
- tap_key(KC_3);
+ tap_code(KC_LBRC);
+ if (aesthetic) {
+ tap_code(KC_SPACE);
+ }
} else if (state->count == 2) {
- send_unicode_hex_string("00E8");
- } else if (state->count == 3) {
- send_unicode_hex_string("00E9");
+ register_code(KC_LSFT);
+ tap_code(KC_9);
+ if (aesthetic) {
+ tap_code(KC_SPACE);
+ }
+ unregister_code(KC_LSFT);
}
}
-void dance_c (qk_tap_dance_state_t *state, void *user_data) {
+void dance_cbrck (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
- tap_key(KC_C);
+ tap_code(KC_RBRC);
+ if (aesthetic) {
+ tap_code(KC_SPACE);
+ }
} else if (state->count == 2) {
- send_unicode_hex_string("00E7");
+ register_code(KC_LSFT);
+ tap_code(KC_0);
+ if (aesthetic) {
+ tap_code(KC_SPACE);
+ }
+ unregister_code(KC_LSFT);
+ }
+}
+
+void dance_game (qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count == 1) {
+
+ } else if (state->count == 2) {
+
+ } else if (state->count == 3) {
+ uint8_t layer = biton32(layer_state);
+ if (layer == _QWERTY) {
+ layer_off(_QWERTY);
+ layer_on(_GAMING);
+ // swirling rgb
+ rgblight_mode_noeeprom(12);
+ } else {
+ layer_off(_GAMING);
+ layer_on(_QWERTY);
+ rgblight_mode_noeeprom(1);
+ }
}
}
@@ -383,13 +397,29 @@ void matrix_scan_user(void) {
// begin OS functions
SEQ_TWO_KEYS(KC_P, KC_B) {
if (current_os == OS_WIN) {
- SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_PAUSE) SS_UP(X_LGUI));
+ long_keystroke(2, (uint16_t[]){KC_LGUI, KC_PAUSE});
+ } else {
+ return;
+ }
+ }
+ SEQ_TWO_KEYS(KC_LSFT, M_PMOD) {
+ if (current_os == OS_WIN) {
+ long_keystroke(3, (uint16_t[]){KC_LCTL, KC_LSFT, KC_ESC});
+ } else {
+ }
+ }
+ SEQ_TWO_KEYS(KC_S, KC_S) {
+ if (current_os == OS_MAC) {
+ long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_4});
+ } else if (current_os == OS_WIN) {
+ long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_S});
} else {
+ return;
}
}
SEQ_THREE_KEYS(KC_C, KC_A, KC_D) {
if (current_os == OS_WIN) {
- SEND_STRING(SS_DOWN(X_LCTRL) SS_DOWN(X_LALT) SS_TAP(X_DELETE) SS_UP(X_LALT) SS_UP(X_LCTRL));
+ long_keystroke(3, (uint16_t[]){KC_LCTL, KC_LALT, KC_DEL});
} else {
}
}
@@ -415,33 +445,33 @@ void matrix_scan_user(void) {
SEQ_ONE_KEY(KC_S) {
surround_type(4, KC_GRAVE, true);
}
- SEQ_TWO_KEYS(KC_S, KC_S) {
- if (current_os == OS_MAC) {
- long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_4});
- } else if (current_os == OS_WIN) {
- long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_S});
- } else {
- return;
- }
- }
SEQ_ONE_KEY(KC_C) {
- surround_type(2, KC_GRAVE, false);
+ send_unicode_hex_string("00E7");
}
SEQ_TWO_KEYS(KC_C, KC_C) {
+ surround_type(2, KC_GRAVE, false);
+ }
+ SEQ_THREE_KEYS(KC_C, KC_C, KC_C) {
surround_type(6, KC_GRAVE, false);
}
+ SEQ_ONE_KEY(KC_E) {
+ send_unicode_hex_string("00E8");
+ }
+ SEQ_TWO_KEYS(KC_E, KC_E) {
+ send_unicode_hex_string("00E9");
+ }
// end format functions
// start fancy functions
- SEQ_THREE_KEYS(KC_C, KC_C, KC_C) {
+ SEQ_THREE_KEYS(KC_C, KC_C, KC_ENT) {
surround_type(6, KC_GRAVE, false);
pri_mod(true);
- tap_key(KC_V);
+ tap_code(KC_V);
pri_mod(false);
- tap_key(KC_RGHT);
- tap_key(KC_RGHT);
- tap_key(KC_RGHT);
- tap_key(KC_ENTER);
+ tap_code(KC_RGHT);
+ tap_code(KC_RGHT);
+ tap_code(KC_RGHT);
+ tap_code(KC_ENTER);
}
// end fancy functions
@@ -450,8 +480,8 @@ void matrix_scan_user(void) {
// ™
send_unicode_hex_string("2122");
}
- SEQ_THREE_KEYS(KC_G, KC_G, KC_T) {
- SEND_STRING("@GrahamGoldenTech.com");
+ SEQ_TWO_KEYS(KC_D, KC_D) {
+ SEND_STRING(".\\Administrator");
}
SEQ_THREE_KEYS(KC_L, KC_O, KC_D) {
// ಠ__ಠ
@@ -482,29 +512,103 @@ void matrix_scan_user(void) {
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ if (aesthetic) {
+ switch (keycode) {
+ case KC_A ... KC_0:
+ case KC_SPACE ... KC_SLASH:
+ if (record->event.pressed) {
+ state = active;
+ velocikey_accelerate();
+ tap_code(keycode);
+ tap_code(KC_SPACE);
+ }
+ return false;
+
+ case KC_BSPACE:
+ if (record->event.pressed) {
+ state = active;
+ velocikey_accelerate();
+ tap_code(keycode);
+ tap_code(keycode);
+ }
+ return false;
+ default: // Do nothing
+ break;
+ }
+ }
+
+ if (shifty) {
+ switch (keycode) {
+ case KC_A ... KC_Z:
+ if (record->event.pressed) {
+ int shift = rand() % 2;
+ state = active;
+ velocikey_accelerate();
+ if (shift == 1){
+ register_code(KC_LSFT);
+ }
+ tap_code(keycode);
+ if (shift == 1){
+ unregister_code(KC_LSFT);
+ }
+ }
+ return false;
+ case KC_SPC:
+ if (record->event.pressed) {
+ state = active;
+ velocikey_accelerate();
+ tap_code(keycode);
+ }
+ return false;
+ default: // Do nothing
+ break;
+ }
+ }
+
switch (keycode) {
case M_PMOD:
- if (record->event.pressed) {
- pri_mod(true);
- } else {
- pri_mod(false);
- }
+ pri_mod(record->event.pressed);
return false;
case M_SMOD:
- if (record->event.pressed) {
- sec_mod(true);
- } else {
- sec_mod(false);
- }
+ sec_mod(record->event.pressed);
return false;
case M_OS:
- if (record->event.pressed) {
+ if (record->event.pressed){
set_os((current_os+1) % _OS_COUNT, true);
}
+
return false;
+ case M_SPC:
+ if(record->event.pressed){
+ if (aesthetic) {
+ aesthetic = false;
+ rgblight_mode_noeeprom(1);
+ } else {
+ aesthetic = true;
+ shifty = false;
+ // snake mode
+ rgblight_mode_noeeprom(20);
+ }
+ return false;
+ }
+
+ case M_SFT:
+ if(record->event.pressed){
+ if (shifty) {
+ shifty = false;
+ rgblight_mode_noeeprom(1);
+ } else {
+ shifty = true;
+ aesthetic = false;
+ // knight mode
+ rgblight_mode_noeeprom(23);
+ }
+ return false;
+ }
+
default:
if (record->event.pressed) {
state = active;
@@ -516,13 +620,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
//Tap Dance Definitions
qk_tap_dance_action_t tap_dance_actions[] = {
- [TD_3_GRV_ACT] = ACTION_TAP_DANCE_FN (dance_3),
- [TD_C_CED] = ACTION_TAP_DANCE_FN (dance_c),
[TD_GRV_3GRV] = ACTION_TAP_DANCE_FN (dance_grv),
[TD_SING_DOUB] = ACTION_TAP_DANCE_FN (dance_quot),
- [TD_STRK_SHOT] = ACTION_TAP_DANCE_FN (dance_strk),
- [TD_HYPH_UNDR] = ACTION_TAP_DANCE_DOUBLE (KC_MINS, LSFT(KC_MINS)),
- [TD_BRCK_PARN_O] = ACTION_TAP_DANCE_DOUBLE (KC_LBRC, LSFT(KC_9)),
- [TD_BRCK_PARN_C] = ACTION_TAP_DANCE_DOUBLE (KC_RBRC, LSFT(KC_0)),
+ [TD_HYPH_UNDR] = ACTION_TAP_DANCE_FN (dance_hyph),
+ [TD_BRCK_PARN_O] = ACTION_TAP_DANCE_FN (dance_obrck),
+ [TD_BRCK_PARN_C] = ACTION_TAP_DANCE_FN (dance_cbrck),
[TD_LALT_RALT] = ACTION_TAP_DANCE_DOUBLE (KC_LALT, KC_RALT),
+ [TD_GAME] = ACTION_TAP_DANCE_FN (dance_game),
};
diff --git a/users/arkag/arkag.h b/users/arkag/arkag.h
index a4672a8e82..fdc4a5fee6 100644
--- a/users/arkag/arkag.h
+++ b/users/arkag/arkag.h
@@ -14,12 +14,13 @@
#define STRIKE TD(TD_STRK_SHOT)
#define HYPHEN TD(TD_HYPH_UNDR)
#define CEDILLA TD(TD_C_CED)
+#define GAME TD(TD_GAME)
#define RAISE MO(1)
#define LOWER MO(2)
-#define KEEB MO(3)
-#define MEDIA MO(4)
-#define LAZY MO(5)
+#define MEDIA MO(3)
+#define FUNCT MO(4)
+#define KEEB MO(5)
#define MOD_CTL_MASK (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL))
#define MOD_GUI_MASK (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI))
@@ -37,9 +38,10 @@ enum {
_QWERTY = 0,
_RAISE,
_LOWER,
- _KEEB,
_MEDIA,
- _LAZY,
+ _FUNCT,
+ _KEEB,
+ _GAMING,
};
typedef enum {
@@ -76,22 +78,9 @@ typedef enum {
enum custom_keycodes {
M_PMOD = SAFE_RANGE,
M_SMOD,
- M_P_B,
- M_C_A_D,
- M_CALC,
M_OS,
- M_TF,
- M_TM,
- M_GGT,
- M_LOD,
- M_LENNY,
- M_BOLD,
- M_ITAL,
- M_ULIN,
- M_SNIPT,
- M_REPO,
- M_SHRUG,
- M_UF,
+ M_SFT,
+ M_SPC,
};
enum tapdances {
@@ -101,16 +90,13 @@ enum tapdances {
TD_SLSH_HTTP,
TD_SING_DOUB,
TD_HYPH_UNDR,
- TD_STRK_SHOT,
TD_SPECIAL,
TD_BRCK_PARN_O,
TD_BRCK_PARN_C,
TD_LALT_RALT,
- SPC_SFT_NSFT,
+ TD_GAME,
};
-void send_unicode_hex_string(const char *str);
-
void velocikey_accelerate(void);
void velocikey_decelerate(void);
uint8_t velocikey_match_speed(uint8_t minValue, uint8_t maxValue);
@@ -146,6 +132,7 @@ void dance_quot (qk_tap_dance_state_t *state, void *user_data);
void dance_strk (qk_tap_dance_state_t *state, void *user_data);
void dance_3 (qk_tap_dance_state_t *state, void *user_data);
void dance_c (qk_tap_dance_state_t *state, void *user_data);
+void dance_game (qk_tap_dance_state_t *state, void *user_data);
int cur_dance (qk_tap_dance_state_t *state);
void spc_finished (qk_tap_dance_state_t *state, void *user_data);
diff --git a/users/arkag/config.h b/users/arkag/config.h
index 2e0a9ad019..5a89a18f60 100644
--- a/users/arkag/config.h
+++ b/users/arkag/config.h
@@ -1,6 +1,6 @@
#pragma once
#define TAPPING_TERM 200
-#define LEADER_TIMEOUT 250
+#define LEADER_TIMEOUT 300
#define LEADER_PER_KEY_TIMING
diff --git a/users/cbbrowne/cbbrowne.c b/users/cbbrowne/cbbrowne.c
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/users/cbbrowne/cbbrowne.c
diff --git a/users/cbbrowne/cbbrowne.h b/users/cbbrowne/cbbrowne.h
new file mode 100644
index 0000000000..301636c053
--- /dev/null
+++ b/users/cbbrowne/cbbrowne.h
@@ -0,0 +1,39 @@
+#ifndef USERSPACE
+#define USERSPACE
+
+#ifdef BACKLIGHT_ENABLE
+#include "backlight.h"
+#endif
+#include "quantum.h"
+#include "config.h"
+
+#ifndef CONFIG_USER_H
+#define CONFIG_USER_H
+
+#ifndef NO_DEBUG
+#define NO_DEBUG
+#endif
+#ifndef NO_PRINT
+#define NO_PRINT
+#endif
+
+/* cbbrowne user configuration */
+
+#define randadd 53
+#define randmul 181
+#define randmod 167
+
+/* Filler to make layering a bit clearer *
+ * borrowed from basic keymap */
+
+#define _______ KC_TRNS
+#define _____ KC_NO
+
+#define LEADER_TIMEOUT 300
+#ifndef LIGHT_CONFIG_H
+#define BACKLIGHT_BREATHING
+#endif
+
+#endif
+
+#endif
diff --git a/users/cbbrowne/rules.mk b/users/cbbrowne/rules.mk
new file mode 100644
index 0000000000..497638cdb3
--- /dev/null
+++ b/users/cbbrowne/rules.mk
@@ -0,0 +1 @@
+SRC += cbbrowne.c
diff --git a/users/drashna/config.h b/users/drashna/config.h
index 2e125d1e4e..2abd326dac 100644
--- a/users/drashna/config.h
+++ b/users/drashna/config.h
@@ -15,10 +15,10 @@
// #ifdef RGBLIGHT_ENABLE
// #define NO_MUSIC_MODE
// #endif //RGBLIGHT_ENABLE/
- #ifndef __arm__
- #undef NOTE_REST
- #define NOTE_REST 1.00f
- #endif // !__arm__
+ // #ifndef __arm__
+ // #undef NOTE_REST
+ // #define NOTE_REST 1.00f
+ // #endif // !__arm__
#define UNICODE_SONG_OSX SONG(RICK_ROLL)
#define UNICODE_SONG_LNX SONG(RICK_ROLL)
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c
index 8019f26676..6968a4b928 100644
--- a/users/drashna/drashna.c
+++ b/users/drashna/drashna.c
@@ -144,9 +144,9 @@ void shutdown_user (void) {
rgblight_setrgb_red();
#endif // RGBLIGHT_ENABLE
#ifdef RGB_MATRIX_ENABLE
- uint16_t timer_start = timer_read();
- rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 );
- while(timer_elapsed(timer_start) < 250) { wait_ms(1); }
+ // uint16_t timer_start = timer_read();
+ // rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 );
+ // while(timer_elapsed(timer_start) < 250) { wait_ms(1); }
#endif //RGB_MATRIX_ENABLE
shutdown_keymap();
}
diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h
index ca55198e3e..c19b189434 100644
--- a/users/drashna/drashna.h
+++ b/users/drashna/drashna.h
@@ -53,11 +53,6 @@ enum userspace_layers {
/*
define modifiers here, since MOD_* doesn't seem to work for these
*/
-#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
-#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL))
-#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
-#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))
-
bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed);
diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c
index 73cad92f60..2d9025b375 100644
--- a/users/drashna/process_records.c
+++ b/users/drashna/process_records.c
@@ -12,7 +12,6 @@ bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
return true;
}
-
// Defines actions tor my global custom keycodes. Defined in drashna.h file
// Then runs the _keymap's record handier if not processed here
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
@@ -35,30 +34,28 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
if (!record->event.pressed) {
- #if !defined(KEYBOARD_viterbi)
- uint8_t temp_mod = get_mods();
- uint8_t temp_osm = get_oneshot_mods();
- clear_mods(); clear_oneshot_mods();
- #endif
+ uint8_t temp_mod = get_mods();
+ uint8_t temp_osm = get_oneshot_mods();
+ clear_mods(); clear_oneshot_mods();
send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), MACRO_TIMER);
- #if defined(KEYBOARD_viterbi)
- send_string_with_delay_P(PSTR(":dfu" SS_TAP(X_ENTER)), MACRO_TIMER);
- #else
- if (temp_mod & MODS_SHIFT_MASK || temp_osm & MODS_SHIFT_MASK) {
- #if defined(__arm__)
- send_string_with_delay_P(PSTR(":dfu-util"), MACRO_TIMER);
- #elif defined(BOOTLOADER_DFU)
- send_string_with_delay_P(PSTR(":dfu"), MACRO_TIMER);
- #elif defined(BOOTLOADER_HALFKAY)
- send_string_with_delay_P(PSTR(":teensy"), MACRO_TIMER);
- #elif defined(BOOTLOADER_CATERINA)
- send_string_with_delay_P(PSTR(":avrdude"), MACRO_TIMER);
- #endif // bootloader options
- }
- if (temp_mod & MODS_CTRL_MASK || temp_osm & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), MACRO_TIMER); }
- send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), MACRO_TIMER);
- set_mods(temp_mod);
- #endif
+#ifndef MAKE_BOOTLOADER
+ if ( ( temp_mod | temp_osm ) & MOD_MASK_SHIFT )
+#endif
+ {
+ #if defined(__arm__)
+ send_string_with_delay_P(PSTR(":dfu-util"), MACRO_TIMER);
+ #elif defined(BOOTLOADER_DFU)
+ send_string_with_delay_P(PSTR(":dfu"), MACRO_TIMER);
+ #elif defined(BOOTLOADER_HALFKAY)
+ send_string_with_delay_P(PSTR(":teensy"), MACRO_TIMER);
+ #elif defined(BOOTLOADER_CATERINA)
+ send_string_with_delay_P(PSTR(":avrdude"), MACRO_TIMER);
+ #endif // bootloader options
+ }
+ if ( ( temp_mod | temp_osm ) & MOD_MASK_CTRL) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), MACRO_TIMER); }
+ send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), MACRO_TIMER);
+ set_mods(temp_mod);
+ set_oneshot_mods(temp_osm);
}
break;
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c
index 7eaa7e9491..a98ad590cc 100644
--- a/users/drashna/rgb_stuff.c
+++ b/users/drashna/rgb_stuff.c
@@ -4,6 +4,7 @@
#if defined(RGBLIGHT_ENABLE)
extern rgblight_config_t rgblight_config;
+bool has_initialized;
#elif defined(RGB_MATRIX_ENABLE)
extern rgb_config_t rgb_matrix_config;
#endif
@@ -17,7 +18,7 @@ void rgblight_sethsv_default_helper(uint8_t index) {
#ifdef INDICATOR_LIGHTS
void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) {
- if (this_mod & MODS_SHIFT_MASK || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MODS_SHIFT_MASK) {
+ if ( (this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK) ) {
#ifdef SHFT_LED1
rgblight_sethsv_at(120, 255, 255, SHFT_LED1);
#endif // SHFT_LED1
@@ -32,7 +33,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
rgblight_sethsv_default_helper(SHFT_LED2);
#endif // SHFT_LED2
}
- if (this_mod & MODS_CTRL_MASK || this_osm & MODS_CTRL_MASK) {
+ if ( (this_mod | this_osm) & MOD_MASK_CTRL) {
#ifdef CTRL_LED1
rgblight_sethsv_at(0, 255, 255, CTRL_LED1);
#endif // CTRL_LED1
@@ -47,7 +48,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
rgblight_sethsv_default_helper(CTRL_LED2);
#endif // CTRL_LED2
}
- if (this_mod & MODS_GUI_MASK || this_osm & MODS_GUI_MASK) {
+ if ( (this_mod | this_osm) & MOD_MASK_GUI) {
#ifdef GUI_LED1
rgblight_sethsv_at(51, 255, 255, GUI_LED1);
#endif // GUI_LED1
@@ -62,7 +63,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
rgblight_sethsv_default_helper(GUI_LED2);
#endif // GUI_LED2
}
- if (this_mod & MODS_ALT_MASK || this_osm & MODS_ALT_MASK) {
+ if ( (this_mod | this_osm) & MOD_MASK_ALT) {
#ifdef ALT_LED1
rgblight_sethsv_at(240, 255, 255, ALT_LED1);
#endif // ALT_LED1
@@ -81,7 +82,9 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) {
}
void matrix_scan_indicator(void) {
- set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods());
+ if (has_initialized) {
+ set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods());
+ }
}
#endif //INDICATOR_LIGHTS
@@ -244,22 +247,16 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
void keyboard_post_init_rgb(void) {
-
#ifdef RGBLIGHT_ENABLE
- if (userspace_config.rgb_layer_change) {
- rgblight_enable_noeeprom();
- switch (biton32(eeconfig_read_default_layer())) {
- case _COLEMAK:
- rgblight_sethsv_noeeprom_magenta(); break;
- case _DVORAK:
- rgblight_sethsv_noeeprom_springgreen(); break;
- case _WORKMAN:
- rgblight_sethsv_noeeprom_goldenrod(); break;
- default:
- rgblight_sethsv_noeeprom_cyan(); break;
- }
- rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
- }
+ rgblight_enable_noeeprom();
+ layer_state_set_user(layer_state);
+ uint16_t old_hue = rgblight_config.hue;
+ rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
+ for (uint16_t i = 360; i > 0; i--) {
+ rgblight_sethsv_noeeprom( ( i + old_hue) % 360, 255, 255);
+ wait_ms(10);
+ }
+ layer_state_set_user(layer_state);
#endif
}
diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk
index 6d8612e71a..5050704a53 100644
--- a/users/drashna/rules.mk
+++ b/users/drashna/rules.mk
@@ -42,3 +42,7 @@ ifdef CONSOLE_ENABLE
OPT_DEFS += -DKEYLOGGER_ENABLE
endif
endif
+
+ifeq ($(strip $(MAKE_BOOTLOADER)), yes)
+ OPT_DEFS += -DMAKE_BOOTLOADER
+endif
diff --git a/users/edvorakjp/edvorakjp.c b/users/edvorakjp/edvorakjp.c
index 1ac6107942..892ce4be3b 100644
--- a/users/edvorakjp/edvorakjp.c
+++ b/users/edvorakjp/edvorakjp.c
@@ -1,10 +1,5 @@
#include "edvorakjp.h"
-void dvorakj_layer_off(void) {
- layer_off(_EDVORAKJ1);
- layer_off(_EDVORAKJ2);
-}
-
void matrix_init_user(void) {
edvorakjp_status_init();
matrix_init_keymap();
@@ -25,7 +20,6 @@ uint32_t layer_state_set_keymap(uint32_t state) {
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return process_record_keymap(keycode, record) &&\
- process_record_edvorakjp_ext(keycode, record) &&\
process_record_edvorakjp_swap_scln(keycode, record) &&\
process_record_edvorakjp_config(keycode, record) &&\
process_record_layer(keycode, record) &&\
diff --git a/users/edvorakjp/edvorakjp.h b/users/edvorakjp/edvorakjp.h
index e781bf2378..688cdeffb3 100644
--- a/users/edvorakjp/edvorakjp.h
+++ b/users/edvorakjp/edvorakjp.h
@@ -10,9 +10,6 @@ extern keymap_config_t keymap_config;
enum edvorakjp_layers {
_EDVORAK = 0,
- _EDVORAKJ1,
- _EDVORAKJ2,
- _QWERTY,
_LOWER,
_RAISE,
_ADJUST,
@@ -21,26 +18,24 @@ enum edvorakjp_layers {
enum edvorakjp_keycodes {
EDVORAK = SAFE_RANGE,
- QWERTY,
LOWER,
RAISE,
KC_MAC,
KC_WIN,
- KC_EXTON,
- KC_EXTOFF,
KC_JPN,
KC_ENG,
- KC_AI,
- KC_OU,
- KC_EI,
- KC_ANN,
- KC_ONN,
- KC_ENN,
- KC_INN,
- KC_UNN,
NEW_SAFE_RANGE
};
+#define KC_LC(k) LCTL_T(KC_##k)
+#define KC_LS(k) LSFT_T(KC_##k)
+#define KC_LA(k) LALT_T(KC_##k)
+#define KC_LG(k) LGUI_T(KC_##k)
+#define KC_RC(k) RCTL_T(KC_##k)
+#define KC_RS(k) RSFT_T(KC_##k)
+#define KC_RG(k) RGUI_T(KC_##k)
+#define KC_RA(k) RALT_T(KC_##k)
+
enum tap_dance_code {
TD_LOWER = 0,
TD_RAISE
@@ -57,8 +52,6 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
// status
void edvorakjp_status_init(void);
-bool get_enable_jp_extra_layer(void);
-void set_enable_jp_extra_layer(bool new_state);
bool get_enable_kc_lang(void);
void set_enable_kc_lang(bool new_state);
bool get_japanese_mode(void);
@@ -69,7 +62,6 @@ void set_japanese_mode(bool new_state);
* return false if processed, or return true if not processed.
* You can add your original macros in process_record_keymap() in keymap.c.
*/
-bool process_record_edvorakjp_ext(uint16_t keycode, keyrecord_t *record);
bool process_record_edvorakjp_swap_scln(uint16_t keycode, keyrecord_t *record);
bool process_record_edvorakjp_config(uint16_t keycode, keyrecord_t *record);
bool process_record_layer(uint16_t keycode, keyrecord_t *record);
diff --git a/users/edvorakjp/edvorakjp_process_record.c b/users/edvorakjp/edvorakjp_process_record.c
index 2dcdab2a25..ecc8db9363 100644
--- a/users/edvorakjp/edvorakjp_process_record.c
+++ b/users/edvorakjp/edvorakjp_process_record.c
@@ -7,114 +7,6 @@ static uint16_t time_on_pressed;
* Each process_record_* methods defined here are
* return false if handle edvorak_keycodes, or return true others.
*/
-bool process_record_edvorakjp_ext(uint16_t keycode, keyrecord_t *record) {
- if (!(default_layer_state == 1UL<<_EDVORAK &&
- get_enable_jp_extra_layer() && get_japanese_mode())) {
- return true;
- }
-
- // consonant keys
- // layer_on(J1) or layer_on(J2) are defined based on key positions.
- switch (keycode) {
- // right hand's left side w/o N
- case KC_F:
- case KC_G:
- case KC_R:
- case KC_D:
- case KC_T:
- case KC_B:
- case KC_H:
- case KC_J:
- if (record->event.pressed) {
- layer_on(_EDVORAKJ1);
- }
- return true;
-
- // N: toggle layer
- case KC_N:
- if (record->event.pressed) {
- biton32(layer_state) == _EDVORAK ? layer_on(_EDVORAKJ1) : dvorakj_layer_off();
- }
- return true;
-
- // left hand up and right hand's right side
- case KC_Y:
- case KC_P:
- case KC_W:
- case KC_Q:
- case KC_S:
- case KC_M:
- case KC_K:
- case KC_L:
- if (record->event.pressed) {
- layer_on(_EDVORAKJ2);
- }
- return true;
- // left hand down
- // If return true, QMK sends keycode in new layer,
- // but these keys are only available in old layer.
- case KC_X:
- case KC_C:
- case KC_V:
- case KC_Z:
- if (record->event.pressed) {
- layer_on(_EDVORAKJ2);
- tap_code(keycode);
- }
- return false;
- }
-
- // vowel keys, symbol keys and modifier keys
- if (record->event.pressed) {
- dvorakj_layer_off();
- }
- switch (keycode) {
- // combination vowel keys
- case KC_AI:
- if (record->event.pressed) {
- SEND_STRING("ai");
- }
- return false;
- case KC_OU:
- if (record->event.pressed) {
- SEND_STRING("ou");
- }
- return false;
- case KC_EI:
- if (record->event.pressed) {
- SEND_STRING("ei");
- }
- return false;
- case KC_ANN:
- if (record->event.pressed) {
- SEND_STRING("ann");
- }
- return false;
- case KC_ONN:
- if (record->event.pressed) {
- SEND_STRING("onn");
- }
- return false;
- case KC_ENN:
- if (record->event.pressed) {
- SEND_STRING("enn");
- }
- return false;
- case KC_INN:
- if (record->event.pressed) {
- SEND_STRING("inn");
- }
- return false;
- case KC_UNN:
- if (record->event.pressed) {
- SEND_STRING("unn");
- }
- return false;
- }
- // AOEIU and other (symbol, modifier) keys
- return true;
-}
-
bool process_record_edvorakjp_swap_scln(uint16_t keycode, keyrecord_t *record) {
#ifdef SWAP_SCLN
static const uint8_t shift_bits = MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT);
@@ -146,30 +38,13 @@ bool process_record_edvorakjp_config(uint16_t keycode, keyrecord_t *record) {
set_enable_kc_lang(keycode == KC_MAC);
}
return false;
- case KC_EXTON:
- case KC_EXTOFF:
- if (record->event.pressed) {
- set_enable_jp_extra_layer(keycode == KC_EXTON);
- }
- return false;
}
return true;
}
bool process_record_layer(uint16_t keycode, keyrecord_t *record) {
- switch (keycode) {
- case EDVORAK:
- if (record->event.pressed) {
- set_single_persistent_default_layer(_EDVORAK);
- }
- return false;
- case QWERTY:
- if (record->event.pressed) {
- dvorakj_layer_off();
- set_single_persistent_default_layer(_QWERTY);
- }
- return false;
#if TAP_DANCE_ENABLE != yes
+ switch (keycode) {
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
@@ -196,8 +71,8 @@ bool process_record_layer(uint16_t keycode, keyrecord_t *record) {
time_on_pressed = 0;
}
return false;
-#endif
}
+#endif
return true;
}
diff --git a/users/edvorakjp/edvorakjp_status.c b/users/edvorakjp/edvorakjp_status.c
index a60c8d853b..128fc3bd28 100644
--- a/users/edvorakjp/edvorakjp_status.c
+++ b/users/edvorakjp/edvorakjp_status.c
@@ -4,8 +4,7 @@
typedef union {
uint8_t raw;
struct {
- bool enable_jp_extra_layer : 1;
- bool enable_kc_lang : 1; // for macOS
+ bool enable_kc_lang; // for macOS
};
} edvorakjp_config_t;
static edvorakjp_config_t edvorakjp_config;
@@ -34,15 +33,6 @@ void edvorakjp_status_init(void) {
edvorakjp_config.raw = eeconfig_read_edvorakjp();
}
-bool get_enable_jp_extra_layer(void) {
- return edvorakjp_config.enable_jp_extra_layer;
-}
-
-void set_enable_jp_extra_layer(bool new_state) {
- edvorakjp_config.enable_jp_extra_layer = new_state;
- eeconfig_update_edvorakjp(edvorakjp_config.raw);
-}
-
bool get_enable_kc_lang(void) {
return edvorakjp_config.enable_kc_lang;
}
@@ -65,7 +55,6 @@ void set_japanese_mode(bool new_state) {
SEND_STRING(SS_LALT("`"));
}
} else {
- dvorakj_layer_off();
if (edvorakjp_config.enable_kc_lang) {
SEND_STRING(SS_TAP(X_LANG2));
} else {
diff --git a/users/edvorakjp/edvorakjp_tap_dance.c b/users/edvorakjp/edvorakjp_tap_dance.c
index 62c0c100a2..d5369f9266 100644
--- a/users/edvorakjp/edvorakjp_tap_dance.c
+++ b/users/edvorakjp/edvorakjp_tap_dance.c
@@ -8,8 +8,11 @@ enum tap_state {
HOLD
};
-static int td_status_lower = NONE;
-static int td_status_raise = NONE;
+typedef struct {
+ uint8_t lower;
+ uint8_t raise;
+} td_status_t;
+static td_status_t td_status = {NONE, NONE};
int cur_dance(qk_tap_dance_state_t *state) {
if (state->interrupted || !state->pressed) {
@@ -20,14 +23,14 @@ int cur_dance(qk_tap_dance_state_t *state) {
}
void td_lower_finished(qk_tap_dance_state_t *state, void *user_data) {
- td_status_lower = cur_dance(state);
- switch(td_status_lower) {
+ td_status.lower = cur_dance(state);
+ switch(td_status.lower) {
case SINGLE_TAP:
set_japanese_mode(false);
- register_code(KC_ESC);
break;
case DOUBLE_TAP:
set_japanese_mode(false);
+ register_code(KC_ESC);
break;
case HOLD:
break;
@@ -36,18 +39,19 @@ void td_lower_finished(qk_tap_dance_state_t *state, void *user_data) {
}
void td_lower_reset(qk_tap_dance_state_t *state, void *user_data) {
- if (td_status_lower == SINGLE_TAP) {
+ if (td_status.lower == DOUBLE_TAP) {
unregister_code(KC_ESC);
}
layer_off(_LOWER);
- td_status_lower = NONE;
+ td_status.lower = NONE;
}
void td_raise_finished(qk_tap_dance_state_t *state, void *user_data) {
- td_status_raise = cur_dance(state);
- switch(td_status_raise) {
- case SINGLE_TAP:
+ td_status.raise = cur_dance(state);
+ switch(td_status.raise) {
case DOUBLE_TAP:
+ // same as single
+ case SINGLE_TAP:
set_japanese_mode(true);
break;
case HOLD:
@@ -58,14 +62,12 @@ void td_raise_finished(qk_tap_dance_state_t *state, void *user_data) {
void td_raise_reset(qk_tap_dance_state_t *state, void *user_data) {
layer_off(_RAISE);
- td_status_raise = NONE;
+ td_status.raise = NONE;
}
qk_tap_dance_action_t tap_dance_actions[] = {
- [TD_LOWER] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(
- NULL, td_lower_finished, td_lower_reset, TAPPING_TERM * 1.5
- ),
- [TD_RAISE] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(
- NULL, td_raise_finished, td_raise_reset, TAPPING_TERM * 1.5
- )
+ [TD_LOWER] =
+ ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, td_lower_finished, td_lower_reset, 100),
+ [TD_RAISE] =
+ ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, td_raise_finished, td_raise_reset, 100)
};
diff --git a/users/edvorakjp/readme.md b/users/edvorakjp/readme.md
index 077ba4abdc..679d84b3de 100644
--- a/users/edvorakjp/readme.md
+++ b/users/edvorakjp/readme.md
@@ -5,49 +5,20 @@ epaew's Enhanced Dvorak layout for Japanese Programmer
## Layout overview
This is a sample. You can swap any symbol keys and modifier keys.
-- Base layer (for ansi layout)
+- Basic layout (for ansi)
```
//+----+----+----+----+----+----+----+----+----+----+----+----+----+---------+
` , ! , @ , # , $ , % , ^ , & , * , ( , ) , [ , ] , BSPC ,
//+----+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+-------+
- TAB , ' , , , . , Y , P , F , G , R , W , Q , / , = , \ ,
+ TAB , ' , , , . , Y , Q , F , G , R , W , P , / , = , \ ,
//+------++---++---++---++---++---++---++---++---++---++---++---++---+-------+
CAPS , A , O , E , I , U , D , T , N , S , M , - , ENT ,
//+-------+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-----------+
- LSFT , ; , X , C , V , Z , B , H , J , K , L , RSFT ,
+ LSFT , : , X , C , V , Z , H , J , K , L , B , RSFT ,
//+------+--+---++----++---+----+----+----+----+-+--+---++----++------+------+
LCTL , LGUI , LALT , SPACE , RALT , RGUI , MENU , RCTL
//+------+------+------+-------------------------+------+------+------+------+
```
-- Base layer (for iso layout)
- - Two C keys are placed, it's on purpose.
-```
- //+----+----+----+----+----+----+----+----+----+----+----+----+----+---------+
- ` , ! , @ , # , $ , % , ^ , & , * , ( , ) , [ , ] , BSPC ,
- //+----+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+-------+
- TAB , ' , , , . , Y , P , F , G , R , W , C , / , = ,
- //+------++---++---++---++---++---++---++---++---++---++---++---++---++
- CAPS , A , O , E , I , U , D , T , N , S , M , ; , - , ENT ,
- //+-------+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+------+
- LSFT , Q , X , C , V , Z , B , H , J , K , L , \ , RSFT ,
- //+------+--+---++----++---+----+----+----+----+-+--+---++----++---+--+------+
- LCTL , LGUI , LALT , SPACE , RALT , RGUI , MENU , RCTL
- //+------+------+------+-------------------------+------+------+------+------+
-```
-- Additional layer (common, blanks are transparent)
-```
- //+----+----+----+----+----+----+----+----+----+----+----+----+----+---------+
- , , , , , , , , , , , , , ,
- //+----+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+-------+
- , AI , OU , EI , , , , , , , , , , ,
- //+------++---++---++---++---++---++---++---++---++---++---++---++---+-------+
- , A , O , E , I , U , , Y1 , N , Y2 , , , ,
- //+-------+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-----------+
- ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , ,
- //+------+--+---++----++---+----+----+----+----+-+--+---++----++------+------+
- , , , , , , ,
- //+------+------+------+-------------------------+------+------+------+------+
-```
And you can see [my iris keyboard layout](../../keyboards/iris/keymaps/edvorakjp/keymap.c) for sample implementation, too.
@@ -57,36 +28,25 @@ This is a sample. You can swap any symbol keys and modifier keys.
- IME 切り替えキー
- 長押しでレイヤー切り替え、短押しでIME切り替え
- macOS(かな/英数)、Windows(Alt+\`)の両方に対応
- - DvorakJP(<http://www7.plala.or.jp/dvorakjp/>)を参考にした日本語入力用キーの導入
- - 拗音入力用のYキーを追加配置
- - 二重母音入力用のキー(AI, OU, EI)
- - 撥音入力用のキー(ANN, ONN, ENN, INN, UNN)
- - いずれかの子音を押下することで Additional layer が出現し、いずれかの母音を押下することで Base layer に戻ります(※1※2)
- - ※1促音の入力に使うため、また連続で同じ指での打鍵を減らすために、
- FGRDTNBHJ を押下した場合はy1が、それ以外の子音を押下した場合はy2が出現しません
- - ※2撥音の入力のため、nを2連打すると、Base layerに戻ります
- Define some custom keys for typing Japanese
- IME switching
- act as LOWER/RAISE when hold, act as IME switching when tapped
- for macOS(かな/英数), for Windows(Alt+\`)
- - oneshot combination keys, inspired from DvorakJP (<http://www7.plala.or.jp/dvorakjp/>)
- - additional Y key to enter a contracted sound
- - diphthong keys (AI, OU, EI)
- - syllabic nasal (ANN, ONN, ENN, INN, UNN)
- - Additional layer is appeared when you taps any consonant keys, and disappeared when you taps any diphthong keys.
## for Programmer
- Dvorak 配列をベースに、ショートカットでよく利用される XCV は QWERTY 配列の位置を維持
- 一部にVimユーザ用のキー配置を実施
- HJKL キーを横並びで配置
- - Shift押下時と非押下時で、";"キーの挙動を入れ替え(`config.h` 内で `#define SWAP_SCLN` の宣言が必要です)
+ - Shift押下時と非押下時で、";"キーの挙動を入れ替え
+ (`config.h` 内で `#define SWAP_SCLN` の宣言が必要です)
- デフォルトレイヤーには、数字キーの代わりに記号 `!@#$%^&*()` を配置
- mainly based on Dvorak layout, but XCV is available in the same position of QWERTY layout
- for Vim users
- HJKL is lining side by side
- - swap the ";" key behavior. i.e. send ":" normally and send ";" when you hold shift. (need `#define SWAP_SCLN` in your `config.h`)
+ - swap the ";" key behavior. i.e. send ":" normally and send ";" when you hold shift.
+ (need `#define SWAP_SCLN` in your `config.h`)
- we can type `!@#$%^&*()` keys without shift keys in base layer
## License
diff --git a/users/jarred/config.h b/users/jarred/config.h
index f282088144..e63ec4d9b7 100644
--- a/users/jarred/config.h
+++ b/users/jarred/config.h
@@ -39,6 +39,7 @@
#undef TAPPING_TERM
#undef IGNORE_MOD_TAP_INTERRUPT
+#define PERMISSIVE_HOLD
#define TAPPING_TOGGLE 1
#define TAPPING_TERM 200
#define IGNORE_MOD_TAP_INTERRUPT
diff --git a/users/jarred/jarred.c b/users/jarred/jarred.c
index 33162b6891..b37c4cfbb7 100644
--- a/users/jarred/jarred.c
+++ b/users/jarred/jarred.c
@@ -17,16 +17,81 @@
#include "jarred.h"
#include "version.h"
+__attribute__ ((weak))
+bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
+ return true;
+}
+
+bool lowerPressed, raisePressed;
+
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
+ case LOWER:
+ case RAISE:
+ // Both lower and raise activate the same layer
+ if (record->event.pressed) {
+ layer_on(_LW);
+ } else {
+ layer_off(_LW);
+ }
+
+ // But keep track of each to active adjust layer
+ if (keycode == LOWER) {
+ lowerPressed = record->event.pressed;
+ } else {
+ raisePressed = record->event.pressed;
+ }
+
+ // When both are pressed, activate adjust
+ if (lowerPressed && raisePressed) {
+ layer_on(_NP);
+ } else {
+ layer_off(_NP);
+ }
+
+ break;
+
+ case NUMPAD:
+ if (record->event.pressed) {
+ layer_on(_NP);
+ } else {
+ layer_off(_NP);
+ }
+ break;
+
+ case NAVI:
+ if (record->event.pressed) {
+ layer_on(_NV);
+ } else {
+ layer_off(_NV);
+
+ // Release mods set by ALT_TAB and CTL_TAB
+ unregister_code(KC_LALT);
+ unregister_code(KC_LCTL);
+ }
+ break;
+
case VRSN: // Prints firmware version
if (record->event.pressed) {
send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER);
}
- return false;
+ break;
+
+ case ALT_TAB:
+ if (record->event.pressed) {
+ register_code(KC_LALT);
+ tap_code(KC_TAB);
+ }
+ break;
+
+ case CTL_TAB:
+ if (record->event.pressed) {
+ register_code(KC_LCTL);
+ tap_code(KC_TAB);
+ }
break;
}
- return true;
+ return process_record_keymap(keycode, record);
}
diff --git a/users/jarred/jarred.h b/users/jarred/jarred.h
index a6774ce264..ae48adb70c 100644
--- a/users/jarred/jarred.h
+++ b/users/jarred/jarred.h
@@ -13,6 +13,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
+// TODO: Add Alt-Tab to nav + W layer
#ifndef USERSPACE
#define USERSPACE
@@ -20,31 +22,60 @@
#include "quantum.h"
enum userspace_custom_keycodes {
- VRSN = SAFE_RANGE // Prints QMK Firmware and board info
+ VRSN = SAFE_RANGE, // Prints QMK Firmware and board info
+ ALT_TAB,
+ CTL_TAB,
+
+ // Layer keys
+ NAVI,
+ LOWER,
+ RAISE,
+ NUMPAD
};
// Layers
-#define _QW 0
-#define _LW 1
-#define _NV 2
-#define _NP 3
-#define _MS 4 // Mouse
+enum {
+ _QW = 0,
+ _GAME,
+ _LW,
+ _NV,
+ _NP,
+ _MS,
+};
+
+#define MS_A LT(_MS,KC_A)
-#define MS_A LT(_MS,KC_A)
+#define WIN_Z LGUI_T(KC_Z)
+#define CTL_SLH RCTL_T(KC_SLSH)
// Wrappers
#define LAYOUT_planck_grid_wrapper(...) LAYOUT_planck_grid(__VA_ARGS__)
+#define LAYOUT_atreus62_grid_wrapper(...) LAYOUT(__VA_ARGS__)
+#define LAYOUT_ergotravel_grid_wrapper(...) LAYOUT(__VA_ARGS__)
/* Qwerty Layer */
#define QWERTY_L1 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T
-#define QWERTY_L2 MO(_NV), KC_A, KC_S, KC_D, KC_F, KC_G
-#define QWERTY_L3 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B
-#define QWERTY_L4 KC_LCTL, KC_LGUI, MO(_NP), KC_LALT, MO(_LW), KC_SPC
+#define QWERTY_L2 NAVI, KC_A, KC_S, KC_D, KC_F, KC_G
+#define QWERTY_L3 KC_LSFT, WIN_Z, KC_X, KC_C, KC_V, KC_B
+#define QWERTY_L4 KC_LCTL, KC_LGUI, NUMPAD, KC_LALT, LOWER, KC_SPC
#define QWERTY_R1 KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC
#define QWERTY_R2 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT
-#define QWERTY_R3 KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT
-#define QWERTY_R4 KC_ENT, MO(_LW), KC_RALT, MO(_MS), KC_APP, KC_RCTL
+#define QWERTY_R3 KC_N, KC_M, KC_COMM, KC_DOT, CTL_SLH, KC_RSFT
+#define QWERTY_R4 KC_ENT, RAISE, KC_RALT, MO(_MS), KC_APP, KC_RCTL
+
+#define QWERTY_4_DOX KC_LCTL, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT
+
+/* Game Layer */
+#define GAME_L1 _______, _______, _______, _______, _______, _______
+#define GAME_L2 _______, _______, _______, _______, _______, _______
+#define GAME_L3 _______, _______, _______, _______, _______, _______
+#define GAME_L4 _______, _______, KC_LALT, LOWER, KC_SPC, KC_SPC
+
+#define GAME_R1 _______, _______, _______, _______, _______, _______
+#define GAME_R2 _______, _______, _______, _______, _______, _______
+#define GAME_R3 _______, _______, _______, _______, _______, _______
+#define GAME_R4 _______, _______, _______, _______, _______, _______
/* Lower / Upper Layer */
#define LOWER_L1 KC_ESC , KC_1, KC_2, KC_3, KC_4, KC_5
@@ -57,27 +88,33 @@ enum userspace_custom_keycodes {
#define LOWER_R3 KC_F12, KC_GRV, _______, _______, _______, _______
#define LOWER_R4 _______, _______, _______, _______, _______, _______
+#define LOWER_4_DOX _______, _______, _______, _______, _______, _______
+
/* Navigation Layer */
#define NAV_L1 _______, _______, _______, KC_LGUI, KC_DEL, KC_BSPC
#define NAV_L2 _______, _______, _______, KC_LSFT, KC_LCTL, KC_ENT
#define NAV_L3 _______, _______, _______, _______, _______, _______
-#define NAV_L4 _______, _______, _______, _______, _______, _______
+#define NAV_L4 _______, _______, _______, CTL_TAB, ALT_TAB, _______
#define NAV_R1 _______, KC_HOME, KC_UP , KC_END , KC_INS, _______
#define NAV_R2 _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, _______
#define NAV_R3 _______, KC_PGUP, KC_PGDN, _______, _______, _______
-#define NAV_R4 _______, _______, _______, _______, _______, _______
+#define NAV_R4 _______, KC_APP, _______, _______, _______, _______
+
+#define NAV_4_DOX CTL_TAB, ALT_TAB, _______, _______, KC_APP, _______
/* Numpad Layer */
-#define NUMPAD_L1 RGB_TOG, RGB_MOD, _______, _______, RGB_HUD, RGB_HUI
+#define NUMPAD_L1 RGB_TOG, RGB_MOD,RGB_RMOD, _______, RGB_HUD, RGB_HUI
#define NUMPAD_L2 BL_TOGG, BL_STEP, BL_BRTG, _______, RGB_SAD, RGB_SAI
#define NUMPAD_L3 _______, _______, _______, _______, RGB_VAD, RGB_VAI
-#define NUMPAD_L4 RESET, VRSN, _______, _______, RGB_SPD, RGB_SPI
+#define NUMPAD_L4 _______, _______, _______, _______, RGB_SPD, RGB_SPI
+
+#define NUMPAD_R1 DF(_QW),DF(_GAME), _______, _______, _______, RESET
+#define NUMPAD_R2 _______, _______, _______, _______, _______, _______
+#define NUMPAD_R3 VRSN, _______, _______, _______, _______, _______
+#define NUMPAD_R4 _______, _______, _______, _______, _______, _______
-#define NUMPAD_R1 _______, KC_P7, KC_P8, KC_P9, KC_PMNS, _______
-#define NUMPAD_R2 _______, KC_P4, KC_P5, KC_P6, KC_PPLS, _______
-#define NUMPAD_R3 _______, KC_P1, KC_P2, KC_P3, KC_PAST, KC_ENT
-#define NUMPAD_R4 _______, KC_P0, XXXXXXX, KC_PDOT, KC_PSLS, KC_ENT
+#define NUMPAD_4_DOX _______, _______, _______, _______, _______, _______
/* Mouse Layer */
#define MOUSE_L1 _______, _______, _______, _______, _______, _______
@@ -90,11 +127,20 @@ enum userspace_custom_keycodes {
#define MOUSE_R3 _______, _______, _______, _______, _______, _______
#define MOUSE_R4 KC_BTN2, _______, _______, _______, _______, _______
+#define MOUSE_4_DOX _______, _______, _______, _______, _______, _______
+
+#define BLANK_12 KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO
+
#define QWERTY_1_12 QWERTY_L1, QWERTY_R1
#define QWERTY_2_12 QWERTY_L2, QWERTY_R2
#define QWERTY_3_12 QWERTY_L3, QWERTY_R3
#define QWERTY_4_12 QWERTY_L4, QWERTY_R4
+#define GAME_1_12 GAME_L1, GAME_R1
+#define GAME_2_12 GAME_L2, GAME_R2
+#define GAME_3_12 GAME_L3, GAME_R3
+#define GAME_4_12 GAME_L4, GAME_R4
+
#define LOWER_1_12 LOWER_L1, LOWER_R1
#define LOWER_2_12 LOWER_L2, LOWER_R2
#define LOWER_3_12 LOWER_L3, LOWER_R3
@@ -116,6 +162,7 @@ enum userspace_custom_keycodes {
#define MOUSE_4_12 MOUSE_L4, MOUSE_R4
#define QWERTY_4x12 QWERTY_1_12, QWERTY_2_12, QWERTY_3_12, QWERTY_4_12
+#define GAME_4x12 GAME_1_12, GAME_2_12, GAME_3_12, GAME_4_12
#define LOWER_4x12 LOWER_1_12, LOWER_2_12, LOWER_3_12, LOWER_4_12
#define NAV_4x12 NAV_1_12, NAV_2_12, NAV_3_12, NAV_4_12
#define NUMPAD_4x12 NUMPAD_1_12, NUMPAD_2_12, NUMPAD_3_12, NUMPAD_4_12
diff --git a/users/konstantin/konstantin.c b/users/konstantin/konstantin.c
index 47596279c3..753742fa78 100644
--- a/users/konstantin/konstantin.c
+++ b/users/konstantin/konstantin.c
@@ -1,15 +1,25 @@
#include "konstantin.h"
-#ifdef LAYER_NUMPAD
-static void toggle_numpad(void) {
- layer_invert(L_NUMPAD);
- bool numpad_on = IS_LAYER_ON(L_NUMPAD);
- bool num_lock_on = IS_HOST_LED_ON(USB_LED_NUM_LOCK);
- if (num_lock_on != numpad_on) {
- tap_code(KC_NLCK); // Toggle Num Lock to match layer state
- }
+__attribute__((weak))
+void keyboard_pre_init_keymap(void) {}
+
+void keyboard_pre_init_user(void) {
+ keyboard_pre_init_keymap();
+}
+
+__attribute__((weak))
+void eeconfig_init_keymap(void) {}
+
+void eeconfig_init_user(void) {
+ eeconfig_init_keymap();
+}
+
+__attribute__((weak))
+void keyboard_post_init_keymap(void) {}
+
+void keyboard_post_init_user(void) {
+ keyboard_post_init_keymap();
}
-#endif
__attribute__((weak))
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
@@ -21,6 +31,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
}
+#ifdef LAYER_NUMPAD
+ void toggle_numpad(void) {
+ layer_invert(L_NUMPAD);
+ bool numpad = IS_LAYER_ON(L_NUMPAD), num_lock = IS_HOST_LED_ON(USB_LED_NUM_LOCK);
+ if (num_lock != numpad) {
+ tap_code(KC_NLCK); // Toggle Num Lock to match layer state
+ }
+ }
+#endif
+
switch (keycode) {
case CLEAR:
if (record->event.pressed) {
@@ -28,12 +48,24 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return false;
+ case DST_P_R:
+ (record->event.pressed ? register_code16 : unregister_code16)(
+ (get_mods() & DST_MOD_MASK) ? DST_REM : DST_PRV
+ );
+ return false;
+
+ case DST_N_A:
+ (record->event.pressed ? register_code16 : unregister_code16)(
+ (get_mods() & DST_MOD_MASK) ? DST_ADD : DST_NXT
+ );
+ return false;
+
#ifdef LAYER_FN
- static bool fn_lock;
+ static bool fn_lock;
case FN_FNLK:
if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) {
- fn_lock = !IS_LAYER_ON(L_FN); // Fn layer will be toggled after this
+ fn_lock = !IS_LAYER_ON(L_FN); // Fn layer will be toggled after this
}
return true;
#endif
diff --git a/users/konstantin/konstantin.h b/users/konstantin/konstantin.h
index f67f9f1b7e..0639b93a6d 100644
--- a/users/konstantin/konstantin.h
+++ b/users/konstantin/konstantin.h
@@ -1,10 +1,13 @@
#pragma once
#include "quantum.h"
+#if defined(RGBLIGHT_ENABLE) || defined(RGBMATRIX_ENABLE)
+ #include "rgb.h"
+#endif
#ifdef TAP_DANCE_ENABLE
#include "tap_dance.h"
#endif
-#ifdef UNICODE_ENABLE
+#if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE)
#include "unicode.h"
#endif
@@ -14,6 +17,10 @@
#define FN_FNLK TT(L_FN)
#endif
+#define KC_SYSR LALT(KC_PSCR)
+#undef KC_BRK
+#define KC_BRK LCTL(KC_PAUS)
+
#define MV_UP LCTL(KC_UP)
#define MV_DOWN LCTL(KC_DOWN)
#define MV_LEFT LCTL(KC_LEFT)
@@ -23,20 +30,30 @@
#define PRV_TAB LCTL(KC_PGUP)
#define NXT_TAB LCTL(KC_PGDN)
+#define DST_ADD LCTL(LGUI(KC_D))
+#define DST_REM LCTL(LGUI(KC_F4))
+#define DST_PRV LCTL(LGUI(KC_LEFT))
+#define DST_NXT LCTL(LGUI(KC_RGHT))
+#ifndef DST_MOD_MASK
+ #define DST_MOD_MASK MOD_MASK_CTRL
+#endif
+
#define LCT_CPS LCTL_T(KC_CAPS)
#ifdef SEND_STRING_CLEAN
#undef SEND_STRING
- #define SEND_STRING(...) { \
- uint8_t ss_mods = get_mods(); \
- clear_mods(); \
- send_string_P(PSTR(__VA_ARGS__)); \
- set_mods(ss_mods); \
+ #define SEND_STRING(string) { \
+ uint8_t ss_mods = get_mods(); \
+ clear_mods(); \
+ send_string_P(PSTR(string)); \
+ set_mods(ss_mods); \
}
#endif
enum keycodes_user {
CLEAR = SAFE_RANGE,
+ DST_P_R,
+ DST_N_A,
#ifdef LAYER_NUMPAD
NUMPAD,
#endif
@@ -56,5 +73,9 @@ enum layers_user {
L_RANGE_KEYMAP,
};
+void keyboard_pre_init_keymap(void);
+void eeconfig_init_keymap(void);
+void keyboard_post_init_keymap(void);
+
bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
uint32_t layer_state_set_keymap(uint32_t state);
diff --git a/users/konstantin/rgb.c b/users/konstantin/rgb.c
new file mode 100644
index 0000000000..0f0c73c49e
--- /dev/null
+++ b/users/konstantin/rgb.c
@@ -0,0 +1,24 @@
+#include "rgb.h"
+
+#ifdef RGBLIGHT_EFFECT_BREATHING
+const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {20, 30, 5, 10};
+#endif
+
+#ifdef RGBLIGHT_EFFECT_RAINBOW_MOOD
+const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {20, 50, 100};
+#endif
+
+#ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL
+const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {20, 50, 100};
+#endif
+
+#ifdef RGBLIGHT_EFFECT_SNAKE
+const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {20, 50, 100};
+#endif
+
+#ifdef RGBLIGHT_EFFECT_KNIGHT
+const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {20, 50, 100};
+#endif
+
+const hsv_t GODSPEED_BLUE = { .h = 280, .s = 68, .v = RGBLIGHT_LIMIT_VAL };
+const hsv_t GODSPEED_YELLOW = { .h = 38, .s = 153, .v = RGBLIGHT_LIMIT_VAL };
diff --git a/users/konstantin/rgb.h b/users/konstantin/rgb.h
new file mode 100644
index 0000000000..53b5821b0e
--- /dev/null
+++ b/users/konstantin/rgb.h
@@ -0,0 +1,18 @@
+#pragma once
+
+#include "quantum.h"
+
+typedef struct {
+ uint16_t h; // 0–360
+ uint8_t s; // 0–255
+ uint8_t v; // 0–255
+} hsv_t;
+
+typedef struct {
+ uint8_t r; // 0–255
+ uint8_t g; // 0–255
+ uint8_t b; // 0–255
+} rgb_t;
+
+extern const hsv_t GODSPEED_BLUE;
+extern const hsv_t GODSPEED_YELLOW;
diff --git a/users/konstantin/rules.mk b/users/konstantin/rules.mk
index d2522b9523..6bda030fb0 100644
--- a/users/konstantin/rules.mk
+++ b/users/konstantin/rules.mk
@@ -1,15 +1,12 @@
-BOOTMAGIC_ENABLE = no
-COMMAND_ENABLE = yes
-CONSOLE_ENABLE = yes
-EXTRAKEY_ENABLE = yes
-MOUSEKEY_ENABLE = yes
-NKRO_ENABLE = yes
-TAP_DANCE_ENABLE = yes
-UNICODE_ENABLE = yes
-
SRC += konstantin.c
+ifneq (,$(filter yes,$(RGBLIGHT_ENABLE) $(RGB_MATRIX_ENABLE))) # if either is yes
+ SRC += rgb.c
+endif
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
SRC += tap_dance.c
endif
+ifneq (,$(filter yes,$(UNICODE_ENABLE) $(UNICODEMAP_ENABLE))) # if either is yes
+ SRC += unicode.c
+endif
EXTRAFLAGS += -flto
diff --git a/users/konstantin/tap_dance.c b/users/konstantin/tap_dance.c
index b13f33c024..0b405939b3 100644
--- a/users/konstantin/tap_dance.c
+++ b/users/konstantin/tap_dance.c
@@ -1,93 +1,117 @@
#include "tap_dance.h"
#include "konstantin.h"
-#define ACTION_TAP_DANCE_DOUBLE_MODS(mod1, mod2) { \
- .fn = { td_double_mods_each, NULL, td_double_mods_reset }, \
- .user_data = &(qk_tap_dance_pair_t){ mod1, mod2 }, \
+#define ACTION_TAP_DANCE_DOUBLE_MOD(mod1, mod2) { \
+ .fn = { td_double_mod_each, NULL, td_double_mod_reset }, \
+ .user_data = &(qk_tap_dance_pair_t){ mod1, mod2 }, \
}
-void td_double_mods_each(qk_tap_dance_state_t *state, void *user_data) {
- qk_tap_dance_pair_t *mods = (qk_tap_dance_pair_t *)user_data;
+void td_double_mod_each(qk_tap_dance_state_t *state, void *user_data) {
+ qk_tap_dance_pair_t *data = (qk_tap_dance_pair_t *)user_data;
+
// Single tap → mod1, double tap → mod2, triple tap etc. → mod1+mod2
if (state->count == 1 || state->count == 3) {
- register_code(mods->kc1);
+ register_code(data->kc1);
} else if (state->count == 2) {
- unregister_code(mods->kc1);
- register_code(mods->kc2);
+ unregister_code(data->kc1);
+ register_code(data->kc2);
}
- // Prevent tap dance from sending kc1 and kc2 as weak mods
- state->weak_mods &= ~(MOD_BIT(mods->kc1) | MOD_BIT(mods->kc2));
+ // Prevent tap dance from sending the mods as weak mods
+ state->weak_mods &= ~(MOD_BIT(data->kc1) | MOD_BIT(data->kc2));
}
-void td_double_mods_reset(qk_tap_dance_state_t *state, void *user_data) {
- qk_tap_dance_pair_t *mods = (qk_tap_dance_pair_t *)user_data;
+void td_double_mod_reset(qk_tap_dance_state_t *state, void *user_data) {
+ qk_tap_dance_pair_t *data = (qk_tap_dance_pair_t *)user_data;
+
if (state->count == 1 || state->count >= 3) {
- unregister_code(mods->kc1);
+ unregister_code(data->kc1);
}
if (state->count >= 2) {
- unregister_code(mods->kc2);
+ unregister_code(data->kc2);
}
}
-struct {
- bool fn_on; // Layer state when tap dance started
- bool started;
-} td_fn_rctrl_data;
-
-void td_fn_rctrl_each(qk_tap_dance_state_t *state, void *user_data) {
- if (!td_fn_rctrl_data.started) {
- td_fn_rctrl_data.fn_on = IS_LAYER_ON(L_FN);
- td_fn_rctrl_data.started = true;
+#define ACTION_TAP_DANCE_MOD_LAYER(mod, layer) { \
+ .fn = { td_mod_layer_each, NULL, td_mod_layer_reset }, \
+ .user_data = &(qk_tap_dance_dual_role_t){ mod, layer }, \
}
- // Single tap → Fn, double tap → RCtrl, triple tap etc. → Fn+RCtrl
+
+void td_mod_layer_each(qk_tap_dance_state_t *state, void *user_data) {
+ qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data;
+
+ // Single tap → mod, double tap → layer, triple tap etc. → mod+layer
if (state->count == 1 || state->count == 3) {
- layer_on(L_FN);
+ register_code(data->kc);
} else if (state->count == 2) {
- if (!td_fn_rctrl_data.fn_on) {
- layer_off(L_FN);
- }
- register_code(KC_RCTL);
+ unregister_code(data->kc);
+ // Prevent tap dance from sending the mod as a weak mod
+ state->weak_mods &= ~MOD_BIT(data->kc);
+ layer_on(data->layer);
}
}
-void td_fn_rctrl_reset(qk_tap_dance_state_t *state, void *user_data) {
- if ((state->count == 1 || state->count >= 3) && !td_fn_rctrl_data.fn_on) {
- layer_off(L_FN);
+void td_mod_layer_reset(qk_tap_dance_state_t *state, void *user_data) {
+ qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data;
+
+ if (state->count == 1 || state->count >= 3) {
+ unregister_code(data->kc);
}
if (state->count >= 2) {
- unregister_code(KC_RCTL);
+ layer_off(data->layer);
}
- td_fn_rctrl_data.started = false;
}
-void td_lsft_fn_each(qk_tap_dance_state_t *state, void *user_data) {
- // Single tap → LShift, double tap → Fn, triple tap etc. → Fn+LShift
+#define ACTION_TAP_DANCE_LAYER_MOD(layer, mod) { \
+ .fn = { td_layer_mod_each, NULL, td_layer_mod_reset }, \
+ .user_data = &(qk_tap_dance_layer_mod_t){ layer, mod, 0, 0 }, \
+ }
+
+typedef struct {
+ uint8_t layer;
+ uint16_t kc;
+ bool layer_on; // Layer state when tap dance started
+ bool started;
+} qk_tap_dance_layer_mod_t;
+
+void td_layer_mod_each(qk_tap_dance_state_t *state, void *user_data) {
+ qk_tap_dance_layer_mod_t *data = (qk_tap_dance_layer_mod_t *)user_data;
+ if (!data->started) {
+ data->layer_on = IS_LAYER_ON(data->layer);
+ data->started = true;
+ }
+
+ // Single tap → layer, double tap → mod, triple tap etc. → layer+mod
if (state->count == 1 || state->count == 3) {
- register_code(KC_LSFT);
+ layer_on(data->layer);
} else if (state->count == 2) {
- unregister_code(KC_LSFT);
- // Prevent tap dance from sending LShift as a weak mod
- state->weak_mods &= ~MOD_BIT(KC_LSFT);
- layer_on(L_FN);
+ if (!data->layer_on) {
+ layer_off(data->layer);
+ }
+ register_code(data->kc);
}
}
-void td_lsft_fn_reset(qk_tap_dance_state_t *state, void *user_data) {
- if (state->count == 1 || state->count >= 3) {
- unregister_code(KC_LSFT);
+void td_layer_mod_reset(qk_tap_dance_state_t *state, void *user_data) {
+ qk_tap_dance_layer_mod_t *data = (qk_tap_dance_layer_mod_t *)user_data;
+
+ if ((state->count == 1 || state->count >= 3) && !data->layer_on) {
+ layer_off(data->layer);
}
if (state->count >= 2) {
- layer_off(L_FN);
+ unregister_code(data->kc);
}
+
+ data->started = false;
}
qk_tap_dance_action_t tap_dance_actions[] = {
- [TD_DESKTOP] = ACTION_TAP_DANCE_DOUBLE(LCTL(LGUI(KC_D)), LCTL(LGUI(KC_F4))), // Add/close virtual desktop
+ [TD_DST_A_R] = ACTION_TAP_DANCE_DOUBLE(DST_ADD, DST_REM),
- [TD_RAL_LAL] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RALT, KC_LALT),
- [TD_RAL_RGU] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RALT, KC_RGUI),
- [TD_RCT_RSF] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RCTL, KC_RSFT),
+ [TD_RAL_LAL] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RALT, KC_LALT),
+ [TD_RAL_RGU] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RALT, KC_RGUI),
+ [TD_RCT_RSF] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RCTL, KC_RSFT),
- [TD_FN_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(td_fn_rctrl_each, NULL, td_fn_rctrl_reset),
- [TD_LSFT_FN] = ACTION_TAP_DANCE_FN_ADVANCED(td_lsft_fn_each, NULL, td_lsft_fn_reset),
+ [TD_LSFT_FN] = ACTION_TAP_DANCE_MOD_LAYER(KC_LSFT, L_FN),
+ [TD_RCTL_FN] = ACTION_TAP_DANCE_MOD_LAYER(KC_RCTL, L_FN),
+ [TD_FN_RCTL] = ACTION_TAP_DANCE_LAYER_MOD(L_FN, KC_RCTL),
};
diff --git a/users/konstantin/tap_dance.h b/users/konstantin/tap_dance.h
index 922a635141..ad7c04cb7f 100644
--- a/users/konstantin/tap_dance.h
+++ b/users/konstantin/tap_dance.h
@@ -2,24 +2,24 @@
#include "quantum.h"
-#define DESKTOP TD(TD_DESKTOP)
-#define DSKTP_L LCTL(LGUI(KC_LEFT))
-#define DSKTP_R LCTL(LGUI(KC_RGHT))
+#define DST_A_R TD(TD_DST_A_R)
#define RAL_LAL TD(TD_RAL_LAL)
#define RAL_RGU TD(TD_RAL_RGU)
#define RCT_RSF TD(TD_RCT_RSF)
-#define FN_RCTL TD(TD_FN_RCTL)
#define LSFT_FN TD(TD_LSFT_FN)
+#define RCTL_FN TD(TD_RCTL_FN)
+#define FN_RCTL TD(TD_FN_RCTL)
enum tap_dance {
- TD_DESKTOP,
+ TD_DST_A_R,
TD_RAL_LAL,
TD_RAL_RGU,
TD_RCT_RSF,
- TD_FN_RCTL,
TD_LSFT_FN,
+ TD_RCTL_FN,
+ TD_FN_RCTL,
};
diff --git a/users/konstantin/unicode.c b/users/konstantin/unicode.c
new file mode 100644
index 0000000000..144c0aaf75
--- /dev/null
+++ b/users/konstantin/unicode.c
@@ -0,0 +1,7 @@
+#include "unicode.h"
+
+#ifdef UNICODEMAP_ENABLE
+const uint32_t PROGMEM unicode_map[] = {
+ FOREACH_UNICODE(UCM_ENTRY)
+};
+#endif
diff --git a/users/konstantin/unicode.h b/users/konstantin/unicode.h
index 09af7e1c7f..c8eddabb71 100644
--- a/users/konstantin/unicode.h
+++ b/users/konstantin/unicode.h
@@ -2,10 +2,33 @@
#include "quantum.h"
-#define COMMA UC(0x002C)
-#define L_PAREN UC(0x0028)
-#define R_PAREN UC(0x0029)
-#define EQUALS UC(0x003D)
-#define TIMES UC(0x00D7)
-#define DIVIDE UC(0x00F7)
-#define MINUS UC(0x2212)
+#define FOREACH_UNICODE(M) \
+ M(COMMA, 0x002C) \
+ M(L_PAREN, 0x0028) \
+ M(R_PAREN, 0x0029) \
+ M(EQUALS, 0x003D) \
+ M(TIMES, 0x00D7) \
+ M(DIVIDE, 0x00F7) \
+ M(MINUS, 0x2212)
+
+#define UC_KEYCODE(name, code) name = UC(code),
+
+#define UCM_NAME(name, code) UCM_ ## name,
+#define UCM_ENTRY(name, code) [UCM_ ## name] = code,
+#define UCM_KEYCODE(name, code) name = X(UCM_ ## name),
+
+#if defined(UNICODE_ENABLE)
+enum unicode_keycodes {
+ FOREACH_UNICODE(UC_KEYCODE)
+};
+#elif defined(UNICODEMAP_ENABLE)
+enum unicode_names {
+ FOREACH_UNICODE(UCM_NAME)
+};
+
+extern const uint32_t PROGMEM unicode_map[];
+
+enum unicode_keycodes {
+ FOREACH_UNICODE(UCM_KEYCODE)
+};
+#endif
diff --git a/users/mechmerlin/changelog.md b/users/mechmerlin/changelog.md
index 11b3ba708f..ec4b20108f 100644
--- a/users/mechmerlin/changelog.md
+++ b/users/mechmerlin/changelog.md
@@ -1,6 +1,14 @@
# Changelog
All notable changes to my userspace will be documented in this file.
+## [0.2.1] - 2019-03-01
+### Fixed
+- `config.h` usage of `#ifdef RGBLIGHT_ENABLE` caused problems for other of my boards that had `RGBLIGHT_ENABLE`.
+
+## [0.2.0] - 2019-02-27
+### Changed
+- Moved `AUDIO_CLICKY` from community layout `66_ansi` into user space.
+
## [0.1.1] - 2018-10-26
### Added
- Added a changelog, aka THIS VERY FILE!
diff --git a/users/mechmerlin/config.h b/users/mechmerlin/config.h
index 3d58c230af..9ca39a12ac 100644
--- a/users/mechmerlin/config.h
+++ b/users/mechmerlin/config.h
@@ -1,5 +1,37 @@
#pragma once
#ifdef RGBLIGHT_ENABLE
-#define RGBLIGHT_SLEEP
+ #define RGBLIGHT_SLEEP
+ #define RGBLIGHT_ANIMATIONS
#endif // RGBLIGHT_ENABLE
+
+#ifdef AUDIO_CLICKY
+ #define AUDIO_CLICKY_ON
+ #define AUDIO_CLICKY_FREQ_DEFAULT 261.63f
+ #define AUDIO_CLICKY_FREQ_MIN 65.41f
+ #define AUDIO_CLICKY_FREQ_MAX 1046.5f
+ //#define AUDIO_CLICKY_FREQ_FACTOR 1.18921f
+ //#define AUDIO_CLICKY_FREQ_FACTOR 2.71828f // e
+ #define AUDIO_CLICKY_FREQ_FACTOR 1.61803f // golden ratio
+ #define AUDIO_CLICKY_FREQ_RANDOMNESS 17.0f
+#endif
+
+// Enable features depending on keyboard
+#if defined(KEYBOARD_clueboard_66_hotswap_prototype)
+ #ifndef RGBLIGHT_ENABLE
+ #define RGBLIGHT_ENABLE
+ #endif
+
+ #ifndef AUDIO_CLICKY
+ #define AUDIO_CLICKY
+ #endif
+
+#elif defined(KEYBOARD_clueboard_66_hotswap_gen1)
+ #ifndef AUDIO_CLICKY
+ #define AUDIO_CLICKY
+ #endif
+#else
+ #ifndef RGBLIGHT_ENABLE
+ #define RGBLIGHT_ENABLE
+ #endif
+#endif
diff --git a/users/mechmerlin/readme.md b/users/mechmerlin/readme.md
index 1e86a64107..24335a7ce2 100644
--- a/users/mechmerlin/readme.md
+++ b/users/mechmerlin/readme.md
@@ -1,4 +1,4 @@
-# MechMerlin's Userspace v0.1.1
+# MechMerlin's Userspace v0.2.0
This is a collection of my most commonly used QMK features.
@@ -38,3 +38,11 @@ This is just a wrapper for `CTL_T(KC_CAPS)`. This is a hold for control and tap
### RGBLIGHT_SLEEP
Ensures that when my computer is in sleep mode, the keyboard underglow lights will also be off.
+
+### Audio Clicky
+
+If a board has a speaker, enable beeps and boops per switch actuation. This is currently only available on prototype/gen1 clueboard 66_hotswaps.
+
+### Velocikey
+
+[Velocikey](https://github.com/qmk/qmk_firmware/blob/master/docs/feature_velocikey.md) is an RGBLIGHT feature in which the faster you type, the faster the ARE GEE BEES.
diff --git a/users/mechmerlin/rules.mk b/users/mechmerlin/rules.mk
index 70c20ec71e..088743c467 100644
--- a/users/mechmerlin/rules.mk
+++ b/users/mechmerlin/rules.mk
@@ -1 +1 @@
-SRC += mechmerlin.c \ No newline at end of file
+SRC += mechmerlin.c
diff --git a/users/stanrc85/config.h b/users/stanrc85/config.h
new file mode 100644
index 0000000000..14284435be
--- /dev/null
+++ b/users/stanrc85/config.h
@@ -0,0 +1,9 @@
+#pragma once
+
+#define TAPPING_TERM 200
+#define RETRO_TAPPING
+
+#ifdef RGBLIGHT_ENABLE
+ #define RGBLIGHT_LIMIT_VAL 175
+ #define RGBLIGHT_SLEEP
+#endif
diff --git a/users/stanrc85/layer_rgb.c b/users/stanrc85/layer_rgb.c
new file mode 100644
index 0000000000..ac5d181224
--- /dev/null
+++ b/users/stanrc85/layer_rgb.c
@@ -0,0 +1,26 @@
+#include "stanrc85.h"
+
+void matrix_init_user(void) {
+ rgblight_setrgb(0xFF, 0x00, 0x00);
+};
+
+uint32_t layer_state_set_user(uint32_t state) {
+ switch (biton32(state)) {
+ case 0:
+ rgblight_setrgb (0xFF, 0x00, 0x00);
+ break;
+ case 1:
+ rgblight_setrgb (0x00, 0xFF, 0x00);
+ break;
+ case 2:
+ rgblight_setrgb (0x00, 0x00, 0xFF);
+ break;
+ case 3:
+ rgblight_setrgb (0xFF, 0xFF, 0xFF);
+ break;
+ default: // for any other layers, or the default layer
+ rgblight_setrgb (0xFF, 0x00, 0x00);
+ break;
+ }
+ return state;
+}
diff --git a/users/stanrc85/readme.md b/users/stanrc85/readme.md
new file mode 100644
index 0000000000..9009a71d5f
--- /dev/null
+++ b/users/stanrc85/readme.md
@@ -0,0 +1,52 @@
+<!-- Copyright 2019 Stanrc85
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.-->
+
+# Stanrc85's Standard ANSI 60% Layout
+
+Shared keymap between two 60% PCB:
+- 1upkeyboards60HSE
+- DZ60 (hotswap)
+
+## Keymap Notes
+- Layer 0 is default QWERTY layout with additional custom features:
+ - SpaceFN to function layer 2 on `Space`
+ - `CTRL` when held and `ESC` when tapped on `CAPS LOCK`
+ - Tap Dance on `Fn1` for `CTRL+ALT+DEL` and `WIN+L`
+ - Tap Dance on `ESC` for `ESC` and ` ` `
+
+![Base QWERTY Layer](https://imgur.com/lGcyLJx.png)
+
+- Layer 1 is default QWERTY with no custom features used mostly for gaming
+ - Enabled by `Fn2+CAPS` from base layer
+
+![Default ANSI Layer](https://imgur.com/M7T9PNT.png)
+
+- Layer 2 is Function layer:
+ - F keys
+ - Arrows
+ - Volume and Media controls
+ - AutoHotkey shortcuts based on [Speaker Control](https://github.com/stanrc85/Speaker-Control) script
+ - AHK Mic is used to mute/unmute microphone
+ - AHK Speaker switches audio output between headphones and speakers
+
+![Function Layer](https://imgur.com/YPl0JrU.png)
+
+- Layer 3 is RGB Underglow control and RESET
+ - `Fn2+CAPS` used to toggle Default QWERTY layer on and off
+
+![RGB and RESET Layer](https://imgur.com/PyB8z7k.png)
+
+### Build
+To build the firmware file associated with this keymap, simply run `make your_keyboard:stanrc85-ansi`.
diff --git a/users/stanrc85/rules.mk b/users/stanrc85/rules.mk
new file mode 100644
index 0000000000..4b66f9692d
--- /dev/null
+++ b/users/stanrc85/rules.mk
@@ -0,0 +1,16 @@
+TAP_DANCE_ENABLE = yes
+EXTRAKEY_ENABLE = yes
+BACKLIGHT_ENABLE = no
+COMMAND_ENABLE = no
+BOOTMAGIC_ENABLE = no
+MOUSEKEY_ENABLE = no
+AUDIO_ENABLE = no
+CONSOLE_ENABLE = no
+NKRO_ENABLE = no
+
+SRC += stanrc85.c
+
+ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
+ # Include my fancy rgb functions source here
+ SRC += layer_rgb.c
+endif
diff --git a/users/stanrc85/stanrc85.c b/users/stanrc85/stanrc85.c
new file mode 100644
index 0000000000..3838f33efd
--- /dev/null
+++ b/users/stanrc85/stanrc85.c
@@ -0,0 +1,84 @@
+#include "stanrc85.h"
+
+static td_state_t td_state;
+
+__attribute__ ((weak))
+bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
+ return true;
+}
+
+// determine the tapdance state to return
+int cur_dance (qk_tap_dance_state_t *state) {
+ if (state->count == 1) {
+ if (state->interrupted || !state->pressed) { return SINGLE_TAP; }
+ else { return SINGLE_HOLD; }
+ }
+ if (state->count == 2) { return DOUBLE_TAP; }
+ else { return 3; } // any number higher than the maximum state value you return above
+}
+
+// handle the possible states for each tapdance keycode you define:
+void ctl_copy_finished (qk_tap_dance_state_t *state, void *user_data) {
+ td_state = cur_dance(state);
+ switch (td_state) {
+ case SINGLE_TAP:
+ SEND_STRING(SS_LCTRL("c"));
+ break;
+ case SINGLE_HOLD:
+ register_mods(MOD_BIT(KC_RCTL));
+ break;
+ case DOUBLE_TAP:
+ SEND_STRING(SS_LCTRL("v"));
+ }
+}
+
+void ctl_copy_reset (qk_tap_dance_state_t *state, void *user_data) {
+ switch (td_state) {
+ case SINGLE_TAP:
+ break;
+ case SINGLE_HOLD:
+ unregister_mods(MOD_BIT(KC_RCTL));
+ break;
+ case DOUBLE_TAP:
+ break;
+ }
+}
+
+qk_tap_dance_action_t tap_dance_actions[] = {
+ [TD_WIN] = ACTION_TAP_DANCE_DOUBLE(KC_CAD, KC_LOCK),
+ [TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRV),
+ [TD_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctl_copy_finished, ctl_copy_reset)
+};
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case KC_MAKE:
+ if (!record->event.pressed) {
+ uint8_t mods = get_mods();
+ clear_mods();
+ send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10);
+ if (mods & MOD_MASK_SHIFT) {
+ //RESET board for flashing if SHIFT held or tapped with KC_MAKE
+ #if defined(__arm__)
+ send_string_with_delay_P(PSTR(":dfu-util"), 10);
+ #elif defined(BOOTLOADER_DFU)
+ send_string_with_delay_P(PSTR(":dfu"), 10);
+ #elif defined(BOOTLOADER_HALFKAY)
+ send_string_with_delay_P(PSTR(":teensy"), 10);
+ #elif defined(BOOTLOADER_CATERINA)
+ send_string_with_delay_P(PSTR(":avrdude"), 10);
+ #endif // bootloader options
+ send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10);
+ reset_keyboard();
+ }
+ if (mods & MOD_MASK_CTRL) {
+ send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10);
+ }
+ send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10);
+ set_mods(mods);
+ }
+ return false;
+ break;
+ }
+ return process_record_keymap(keycode, record);
+}
diff --git a/users/stanrc85/stanrc85.h b/users/stanrc85/stanrc85.h
new file mode 100644
index 0000000000..2f999ff502
--- /dev/null
+++ b/users/stanrc85/stanrc85.h
@@ -0,0 +1,44 @@
+#pragma once
+
+#include "quantum.h"
+#include "version.h"
+
+#define DEFAULT 0 //Custom ANSI
+#define LAYER1 1 //Default ANSI (enable with Fn2+CAPS)
+#define LAYER2 2 //Function keys, arrows, custom shortcuts, volume control
+#define LAYER3 3 //RGB Underglow controls and RESET
+
+//Aliases for longer keycodes
+#define KC_CAD LALT(LCTL(KC_DEL))
+#define KC_LOCK LGUI(KC_L)
+#define CA_QUOT LCA(KC_QUOT)
+#define CA_SCLN LCA(KC_SCLN)
+#define KC_CTLE LCTL_T(KC_ESC)
+#define LT_SPCF LT(2, KC_SPC)
+#define TD_TESC TD(TD_ESC)
+#define TD_TWIN TD(TD_WIN)
+#define TD_TCTL TD(TD_RCTL)
+
+enum cust_keys {
+ KC_MAKE = SAFE_RANGE
+};
+
+enum tap_dance {
+ TD_WIN,
+ TD_ESC,
+ TD_RCTL
+};
+
+// define a type containing as many tapdance states as you need
+typedef enum {
+ SINGLE_TAP,
+ SINGLE_HOLD,
+ DOUBLE_TAP
+} td_state_t;
+
+// function to determine the current tapdance state
+int cur_dance (qk_tap_dance_state_t *state);
+
+// `finished` and `reset` functions for each tapdance keycode
+void ctl_copy_finished (qk_tap_dance_state_t *state, void *user_data);
+void ctl_copy_reset (qk_tap_dance_state_t *state, void *user_data);