This is the source code for the QMK custom firmware for my Voyager split keyboard.
Below are files that compiles with QMK project to produce the final firmware bin.
#include QMK_KEYBOARD_H
#include "version.h"
#define MOON_LED_LEVEL LED_LEVEL
enum custom_keycodes {
RGB_SLD = ML_SAFE_RANGE,
HSV_87_255_255,
HSV_0_255_246,
HSV_0_0_255,
HSV_44_128_255,
HSV_144_255_255,
ST_MACRO_0,
ST_MACRO_1,
ST_MACRO_2,
ST_MACRO_3,
MAC_SIRI,
};
enum tap_dance_codes {
DANCE_0,
DANCE_1,
DANCE_2,
DANCE_3,
DANCE_4,
DANCE_5,
DANCE_6,
};
const uint16_t PROGMEM keymaps [] [MATRIX_ROWS][MATRIX_COLS] = {
[ 0 ] = LAYOUT_voyager (
KC_ESCAPE, TD (DANCE_0), TD (DANCE_1), TD (DANCE_2), TD (DANCE_3), TD (DANCE_4), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS,
MEH_T (KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, ST_MACRO_0,
KC_LEFT_CTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT ( 5 ,KC_SCLN), MT (MOD_RCTL, KC_QUOTE),
KC_LEFT_SHIFT, MT (MOD_LALT, KC_Z),KC_X, KC_C, KC_V, KC_B, KC_N, LT ( 4 ,KC_M), ALL_T (KC_COMMA), MT (MOD_RGUI, KC_DOT), MT (MOD_RALT, KC_SLASH), MT (MOD_RSFT, KC_EQUAL),
KC_LEFT_GUI, LT ( 1 ,KC_ENTER), LT ( 2 ,KC_SPACE), KC_BSPC
),
[ 1 ] = LAYOUT_voyager (
KC_ESCAPE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_GRAVE, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_7, KC_8, KC_9, KC_MINUS, KC_SLASH, KC_F12,
KC_TILD, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_4, KC_5, KC_6, KC_PLUS, KC_ASTR, KC_BSPC,
CW_TOGG, KC_BSLS, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, KC_1, KC_2, KC_3, KC_DOT, KC_EQUAL, KC_ENTER,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, TD (DANCE_5)
),
[ 2 ] = LAYOUT_voyager (
RGB_TOG, TOGGLE_LAYER_COLOR,RGB_MODE_FORWARD,RGB_SLD, RGB_VAD, RGB_VAI, RGB_HUD, RGB_HUI, KC_BRIGHTNESS_DOWN,KC_BRIGHTNESS_UP, TD (DANCE_6), QK_BOOT,
KC_TRANSPARENT, LALT ( LGUI (KC_Q)),KC_AUDIO_VOL_DOWN,KC_AUDIO_VOL_UP,KC_AUDIO_MUTE, RGB_SPI, KC_PAGE_UP, KC_HOME, KC_UP, KC_END, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_MEDIA_PREV_TRACK,KC_MEDIA_NEXT_TRACK,KC_MEDIA_STOP, KC_MEDIA_PLAY_PAUSE,RGB_SPD, KC_PGDN, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, HSV_87_255_255, HSV_0_255_246, HSV_0_0_255, HSV_44_128_255, HSV_144_255_255, KC_TRANSPARENT, LCTL ( LSFT (KC_TAB)), LCTL (KC_TAB), MAC_SIRI, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
),
[ 3 ] = LAYOUT_voyager (
KC_NO, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, TO ( 0 ), KC_NO,
KC_NO, KC_MS_ACCEL2, KC_MS_WH_UP, KC_MS_UP, KC_MS_WH_DOWN, KC_NO, KC_NO, KC_NO, KC_MS_UP, KC_NO, KC_MS_ACCEL2, KC_NO,
KC_NO, KC_MS_ACCEL1, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_ACCEL1, KC_NO,
KC_NO, KC_MS_ACCEL0, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_ACCEL0, KC_NO,
KC_MS_BTN1, KC_NO, KC_NO, KC_MS_BTN2
),
[ 4 ] = LAYOUT_voyager (
KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, TO ( 0 ), KC_NO,
KC_NO, KC_NO, ST_MACRO_1, KC_NO, ST_MACRO_2, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, ST_MACRO_3, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO
),
[ 5 ] = LAYOUT_voyager (
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_NO, KC_NO, KC_NO, KC_NO, TO ( 0 ), KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO
),
};
extern rgb_config_t rgb_matrix_config;
void keyboard_post_init_user ( void ) {
rgb_matrix_enable ();
}
const uint8_t PROGMEM ledmap [] [RGB_MATRIX_LED_COUNT][ 3 ] = {
[ 1 ] = { { 0 , 0 , 0 }, { 0 , 0 , 255 }, { 0 , 0 , 255 }, { 0 , 0 , 255 }, { 0 , 0 , 255 }, { 0 , 0 , 255 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 220 , 164 , 219 }, { 220 , 164 , 219 }, { 13 , 239 , 242 }, { 0 , 0 , 0 }, { 103 , 217 , 219 }, { 103 , 217 , 219 }, { 193 , 217 , 219 }, { 193 , 217 , 219 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 255 }, { 0 , 0 , 255 }, { 0 , 0 , 255 }, { 0 , 0 , 255 }, { 0 , 0 , 255 }, { 0 , 0 , 255 }, { 139 , 217 , 219 }, { 139 , 217 , 219 }, { 139 , 217 , 219 }, { 45 , 191 , 248 }, { 45 , 191 , 248 }, { 0 , 0 , 255 }, { 139 , 217 , 219 }, { 139 , 217 , 219 }, { 139 , 217 , 219 }, { 45 , 191 , 248 }, { 45 , 191 , 248 }, { 0 , 0 , 0 }, { 139 , 217 , 219 }, { 139 , 217 , 219 }, { 139 , 217 , 219 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 149 , 216 , 219 } },
[ 2 ] = { { 42 , 175 , 208 }, { 42 , 175 , 208 }, { 42 , 175 , 208 }, { 42 , 175 , 208 }, { 42 , 175 , 208 }, { 42 , 175 , 208 }, { 0 , 0 , 0 }, { 19 , 255 , 255 }, { 97 , 175 , 209 }, { 97 , 175 , 209 }, { 98 , 154 , 155 }, { 42 , 175 , 208 }, { 0 , 0 , 0 }, { 240 , 197 , 237 }, { 240 , 197 , 237 }, { 240 , 197 , 237 }, { 240 , 197 , 237 }, { 42 , 175 , 208 }, { 0 , 0 , 0 }, { 87 , 255 , 255 }, { 0 , 255 , 246 }, { 57 , 3 , 237 }, { 44 , 126 , 241 }, { 139 , 218 , 196 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 42 , 175 , 208 }, { 42 , 175 , 208 }, { 42 , 175 , 208 }, { 42 , 175 , 208 }, { 149 , 216 , 219 }, { 255 , 255 , 255 }, { 68 , 160 , 239 }, { 162 , 184 , 174 }, { 145 , 57 , 250 }, { 162 , 184 , 174 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 68 , 160 , 239 }, { 145 , 57 , 250 }, { 145 , 57 , 250 }, { 145 , 57 , 250 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 192 , 145 , 225 }, { 192 , 145 , 225 }, { 240 , 197 , 237 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 } },
[ 3 ] = { { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 42 , 175 , 208 }, { 131 , 139 , 255 }, { 82 , 137 , 213 }, { 131 , 139 , 255 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 20 , 137 , 213 }, { 82 , 137 , 213 }, { 82 , 137 , 213 }, { 82 , 137 , 213 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 137 , 213 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 149 , 216 , 219 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 82 , 137 , 213 }, { 0 , 0 , 0 }, { 42 , 175 , 208 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 82 , 137 , 213 }, { 82 , 137 , 213 }, { 82 , 137 , 213 }, { 20 , 137 , 213 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 137 , 213 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 } },
[ 4 ] = { { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 139 , 191 , 213 }, { 0 , 0 , 0 }, { 99 , 179 , 152 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 99 , 179 , 152 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 149 , 216 , 219 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 } },
[ 5 ] = { { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 149 , 216 , 219 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 }, { 0 , 0 , 0 } },
};
void set_layer_color ( int layer ) {
for ( int i = 0 ; i < RGB_MATRIX_LED_COUNT; i ++ ) {
HSV hsv = {
.h = pgm_read_byte ( & ledmap [layer][i][ 0 ]),
.s = pgm_read_byte ( & ledmap [layer][i][ 1 ]),
.v = pgm_read_byte ( & ledmap [layer][i][ 2 ]),
};
if ( ! hsv.h && ! hsv.s && ! hsv.v) {
rgb_matrix_set_color ( i, 0 , 0 , 0 );
} else {
RGB rgb = hsv_to_rgb ( hsv );
float f = ( float )rgb_matrix_config.hsv.v / UINT8_MAX;
rgb_matrix_set_color ( i, f * rgb.r, f * rgb.g, f * rgb.b );
}
}
}
bool rgb_matrix_indicators_user ( void ) {
if (keyboard_config.disable_layer_led) { return false ; }
switch ( biton32 (layer_state)) {
case 1 :
set_layer_color ( 1 );
break ;
case 2 :
set_layer_color ( 2 );
break ;
case 3 :
set_layer_color ( 3 );
break ;
case 4 :
set_layer_color ( 4 );
break ;
case 5 :
set_layer_color ( 5 );
break ;
default :
if ( rgb_matrix_get_flags () == LED_FLAG_NONE)
rgb_matrix_set_color_all ( 0 , 0 , 0 );
break ;
}
return true ;
}
bool process_record_user ( uint16_t keycode , keyrecord_t * record ) {
switch (keycode) {
case ST_MACRO_0:
if (record -> event.pressed) {
SEND_STRING ( SS_LCTL ( SS_TAP (X_SPACE)));
}
break ;
case ST_MACRO_1:
if (record -> event.pressed) {
SEND_STRING ( SS_LGUI ( SS_LSFT ( SS_TAP (X_BSLS))));
}
break ;
case ST_MACRO_2:
if (record -> event.pressed) {
SEND_STRING ( SS_LGUI ( SS_LSFT ( SS_TAP (X_UP))));
}
break ;
case ST_MACRO_3:
if (record -> event.pressed) {
SEND_STRING ( SS_LGUI ( SS_LSFT ( SS_TAP (X_DOWN))));
}
break ;
case MAC_SIRI:
HCS ( 0x CF );
case RGB_SLD:
if (record -> event.pressed) {
rgblight_mode ( 1 );
}
return false ;
case HSV_87_255_255:
if (record -> event.pressed) {
rgblight_mode ( 1 );
rgblight_sethsv ( 87 , 255 , 255 );
}
return false ;
case HSV_0_255_246:
if (record -> event.pressed) {
rgblight_mode ( 1 );
rgblight_sethsv ( 0 , 255 , 246 );
}
return false ;
case HSV_0_0_255:
if (record -> event.pressed) {
rgblight_mode ( 1 );
rgblight_sethsv ( 0 , 0 , 255 );
}
return false ;
case HSV_44_128_255:
if (record -> event.pressed) {
rgblight_mode ( 1 );
rgblight_sethsv ( 44 , 128 , 255 );
}
return false ;
case HSV_144_255_255:
if (record -> event.pressed) {
rgblight_mode ( 1 );
rgblight_sethsv ( 144 , 255 , 255 );
}
return false ;
}
return true ;
}
typedef struct {
bool is_press_action;
uint8_t step;
} tap;
enum {
SINGLE_TAP = 1 ,
SINGLE_HOLD,
DOUBLE_TAP,
DOUBLE_HOLD,
DOUBLE_SINGLE_TAP,
MORE_TAPS
};
static tap dance_state [ 7 ];
uint8_t dance_step ( tap_dance_state_t * state );
uint8_t dance_step ( tap_dance_state_t * state ) {
if (state->count == 1 ) {
if (state->interrupted || ! state->pressed) return SINGLE_TAP;
else return SINGLE_HOLD;
} else if (state->count == 2 ) {
if (state->interrupted) return DOUBLE_SINGLE_TAP;
else if (state->pressed) return DOUBLE_HOLD;
else return DOUBLE_TAP;
}
return MORE_TAPS;
}
void on_dance_0 ( tap_dance_state_t * state , void * user_data );
void dance_0_finished ( tap_dance_state_t * state , void * user_data );
void dance_0_reset ( tap_dance_state_t * state , void * user_data );
void on_dance_0 ( tap_dance_state_t * state , void * user_data ) {
if (state->count == 3 ) {
tap_code16 (KC_1);
tap_code16 (KC_1);
tap_code16 (KC_1);
}
if (state->count > 3 ) {
tap_code16 (KC_1);
}
}
void dance_0_finished ( tap_dance_state_t * state , void * user_data ) {
dance_state [ 0 ].step = dance_step (state);
switch ( dance_state [ 0 ].step) {
case SINGLE_TAP: register_code16 (KC_1); break ;
case DOUBLE_TAP: register_code16 (KC_1); register_code16 (KC_1); break ;
case DOUBLE_HOLD: layer_move ( 1 ); break ;
case DOUBLE_SINGLE_TAP: tap_code16 (KC_1); register_code16 (KC_1);
}
}
void dance_0_reset ( tap_dance_state_t * state , void * user_data ) {
wait_ms ( 10 );
switch ( dance_state [ 0 ].step) {
case SINGLE_TAP: unregister_code16 (KC_1); break ;
case DOUBLE_TAP: unregister_code16 (KC_1); break ;
case DOUBLE_SINGLE_TAP: unregister_code16 (KC_1); break ;
}
dance_state [ 0 ].step = 0 ;
}
void on_dance_1 ( tap_dance_state_t * state , void * user_data );
void dance_1_finished ( tap_dance_state_t * state , void * user_data );
void dance_1_reset ( tap_dance_state_t * state , void * user_data );
void on_dance_1 ( tap_dance_state_t * state , void * user_data ) {
if (state->count == 3 ) {
tap_code16 (KC_2);
tap_code16 (KC_2);
tap_code16 (KC_2);
}
if (state->count > 3 ) {
tap_code16 (KC_2);
}
}
void dance_1_finished ( tap_dance_state_t * state , void * user_data ) {
dance_state [ 1 ].step = dance_step (state);
switch ( dance_state [ 1 ].step) {
case SINGLE_TAP: register_code16 (KC_2); break ;
case DOUBLE_TAP: register_code16 (KC_2); register_code16 (KC_2); break ;
case DOUBLE_HOLD: layer_move ( 2 ); break ;
case DOUBLE_SINGLE_TAP: tap_code16 (KC_2); register_code16 (KC_2);
}
}
void dance_1_reset ( tap_dance_state_t * state , void * user_data ) {
wait_ms ( 10 );
switch ( dance_state [ 1 ].step) {
case SINGLE_TAP: unregister_code16 (KC_2); break ;
case DOUBLE_TAP: unregister_code16 (KC_2); break ;
case DOUBLE_SINGLE_TAP: unregister_code16 (KC_2); break ;
}
dance_state [ 1 ].step = 0 ;
}
void on_dance_2 ( tap_dance_state_t * state , void * user_data );
void dance_2_finished ( tap_dance_state_t * state , void * user_data );
void dance_2_reset ( tap_dance_state_t * state , void * user_data );
void on_dance_2 ( tap_dance_state_t * state , void * user_data ) {
if (state->count == 3 ) {
tap_code16 (KC_3);
tap_code16 (KC_3);
tap_code16 (KC_3);
}
if (state->count > 3 ) {
tap_code16 (KC_3);
}
}
void dance_2_finished ( tap_dance_state_t * state , void * user_data ) {
dance_state [ 2 ].step = dance_step (state);
switch ( dance_state [ 2 ].step) {
case SINGLE_TAP: register_code16 (KC_3); break ;
case SINGLE_HOLD: layer_on ( 3 ); break ;
case DOUBLE_TAP: register_code16 (KC_3); register_code16 (KC_3); break ;
case DOUBLE_HOLD: layer_move ( 3 ); break ;
case DOUBLE_SINGLE_TAP: tap_code16 (KC_3); register_code16 (KC_3);
}
}
void dance_2_reset ( tap_dance_state_t * state , void * user_data ) {
wait_ms ( 10 );
switch ( dance_state [ 2 ].step) {
case SINGLE_TAP: unregister_code16 (KC_3); break ;
case SINGLE_HOLD: layer_off ( 3 ); break ;
case DOUBLE_TAP: unregister_code16 (KC_3); break ;
case DOUBLE_SINGLE_TAP: unregister_code16 (KC_3); break ;
}
dance_state [ 2 ].step = 0 ;
}
void on_dance_3 ( tap_dance_state_t * state , void * user_data );
void dance_3_finished ( tap_dance_state_t * state , void * user_data );
void dance_3_reset ( tap_dance_state_t * state , void * user_data );
void on_dance_3 ( tap_dance_state_t * state , void * user_data ) {
if (state->count == 3 ) {
tap_code16 (KC_4);
tap_code16 (KC_4);
tap_code16 (KC_4);
}
if (state->count > 3 ) {
tap_code16 (KC_4);
}
}
void dance_3_finished ( tap_dance_state_t * state , void * user_data ) {
dance_state [ 3 ].step = dance_step (state);
switch ( dance_state [ 3 ].step) {
case SINGLE_TAP: register_code16 (KC_4); break ;
case SINGLE_HOLD: layer_on ( 4 ); break ;
case DOUBLE_TAP: register_code16 (KC_4); register_code16 (KC_4); break ;
case DOUBLE_HOLD: layer_move ( 4 ); break ;
case DOUBLE_SINGLE_TAP: tap_code16 (KC_4); register_code16 (KC_4);
}
}
void dance_3_reset ( tap_dance_state_t * state , void * user_data ) {
wait_ms ( 10 );
switch ( dance_state [ 3 ].step) {
case SINGLE_TAP: unregister_code16 (KC_4); break ;
case SINGLE_HOLD: layer_off ( 4 ); break ;
case DOUBLE_TAP: unregister_code16 (KC_4); break ;
case DOUBLE_SINGLE_TAP: unregister_code16 (KC_4); break ;
}
dance_state [ 3 ].step = 0 ;
}
void on_dance_4 ( tap_dance_state_t * state , void * user_data );
void dance_4_finished ( tap_dance_state_t * state , void * user_data );
void dance_4_reset ( tap_dance_state_t * state , void * user_data );
void on_dance_4 ( tap_dance_state_t * state , void * user_data ) {
if (state->count == 3 ) {
tap_code16 (KC_5);
tap_code16 (KC_5);
tap_code16 (KC_5);
}
if (state->count > 3 ) {
tap_code16 (KC_5);
}
}
void dance_4_finished ( tap_dance_state_t * state , void * user_data ) {
dance_state [ 4 ].step = dance_step (state);
switch ( dance_state [ 4 ].step) {
case SINGLE_TAP: register_code16 (KC_5); break ;
case SINGLE_HOLD: layer_on ( 5 ); break ;
case DOUBLE_TAP: register_code16 (KC_5); register_code16 (KC_5); break ;
case DOUBLE_HOLD: layer_move ( 1 ); break ;
case DOUBLE_SINGLE_TAP: tap_code16 (KC_5); register_code16 (KC_5);
}
}
void dance_4_reset ( tap_dance_state_t * state , void * user_data ) {
wait_ms ( 10 );
switch ( dance_state [ 4 ].step) {
case SINGLE_TAP: unregister_code16 (KC_5); break ;
case SINGLE_HOLD: layer_off ( 5 ); break ;
case DOUBLE_TAP: unregister_code16 (KC_5); break ;
case DOUBLE_SINGLE_TAP: unregister_code16 (KC_5); break ;
}
dance_state [ 4 ].step = 0 ;
}
void on_dance_5 ( tap_dance_state_t * state , void * user_data );
void dance_5_finished ( tap_dance_state_t * state , void * user_data );
void dance_5_reset ( tap_dance_state_t * state , void * user_data );
void on_dance_5 ( tap_dance_state_t * state , void * user_data ) {
if (state->count == 3 ) {
tap_code16 (KC_0);
tap_code16 (KC_0);
tap_code16 (KC_0);
}
if (state->count > 3 ) {
tap_code16 (KC_0);
}
}
void dance_5_finished ( tap_dance_state_t * state , void * user_data ) {
dance_state [ 5 ].step = dance_step (state);
switch ( dance_state [ 5 ].step) {
case SINGLE_TAP: register_code16 (KC_0); break ;
case DOUBLE_TAP: register_code16 (KC_0); register_code16 (KC_0); break ;
case DOUBLE_HOLD: layer_move ( 0 ); break ;
case DOUBLE_SINGLE_TAP: tap_code16 (KC_0); register_code16 (KC_0);
}
}
void dance_5_reset ( tap_dance_state_t * state , void * user_data ) {
wait_ms ( 10 );
switch ( dance_state [ 5 ].step) {
case SINGLE_TAP: unregister_code16 (KC_0); break ;
case DOUBLE_TAP: unregister_code16 (KC_0); break ;
case DOUBLE_SINGLE_TAP: unregister_code16 (KC_0); break ;
}
dance_state [ 5 ].step = 0 ;
}
void dance_6_finished ( tap_dance_state_t * state , void * user_data );
void dance_6_reset ( tap_dance_state_t * state , void * user_data );
void dance_6_finished ( tap_dance_state_t * state , void * user_data ) {
dance_state [ 6 ].step = dance_step (state);
switch ( dance_state [ 6 ].step) {
case DOUBLE_HOLD: layer_move ( 0 ); break ;
}
}
void dance_6_reset ( tap_dance_state_t * state , void * user_data ) {
wait_ms ( 10 );
switch ( dance_state [ 6 ].step) {
}
dance_state [ 6 ].step = 0 ;
}
tap_dance_action_t tap_dance_actions [] = {
[DANCE_0] = ACTION_TAP_DANCE_FN_ADVANCED (on_dance_0, dance_0_finished, dance_0_reset),
[DANCE_1] = ACTION_TAP_DANCE_FN_ADVANCED (on_dance_1, dance_1_finished, dance_1_reset),
[DANCE_2] = ACTION_TAP_DANCE_FN_ADVANCED (on_dance_2, dance_2_finished, dance_2_reset),
[DANCE_3] = ACTION_TAP_DANCE_FN_ADVANCED (on_dance_3, dance_3_finished, dance_3_reset),
[DANCE_4] = ACTION_TAP_DANCE_FN_ADVANCED (on_dance_4, dance_4_finished, dance_4_reset),
[DANCE_5] = ACTION_TAP_DANCE_FN_ADVANCED (on_dance_5, dance_5_finished, dance_5_reset),
[DANCE_6] = ACTION_TAP_DANCE_FN_ADVANCED ( NULL , dance_6_finished, dance_6_reset),
};