[Keymap] update to Danielo515 keymaps (#8004)

* feat(build): added script for compiling with docker easily

* chore: bring my own build with docker to master

* feat: merge ergodox ez into latest maste

* chore: remove my build with docker file

* chore: remove my changes to process_leader

* feat: more modular user danielo515

* Apply suggestions from @ridingqwerty

Co-Authored-By: ridingqwerty <george.g.koenig@gmail.com>

* chore: more suggestions implemented

* chore: add my basic details

* Apply suggestions from @drashna

Co-Authored-By: Drashna Jaelre <drashna@live.com>

* fix: more @drashna fixes

* feat: @fauxpark optimization

* fix: some more @drashna improvements

Co-Authored-By: Drashna Jaelre <drashna@live.com>

* chore: small improvement on layout

* fix: some more @drashna improvements

* chore: remove some F dance

Co-authored-by: ridingqwerty <george.g.koenig@gmail.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
master
Daniel Rodríguez Rivero 2020-01-27 23:42:38 +01:00 committed by Drashna Jaelre
parent 0804f0a5dd
commit 1b7a003d84
12 changed files with 1113 additions and 0 deletions

View File

@ -0,0 +1,37 @@
/*
Set any config.h overrides for your specific keymap here.
See config.h options at https://docs.qmk.fm/#/config_options?id=the-configh-file
*/
#pragma once
#define IGNORE_MOD_TAP_INTERRUPT
#define TAPPING_TERM 200
#define ONESHOT_TAP_TOGGLE 3
#define RGBLIGHT_SLEEP
#undef MOUSEKEY_TIME_TO_MAX
#define MOUSEKEY_TIME_TO_MAX 50
#undef MOUSEKEY_WHEEL_TIME_TO_MAX
#define MOUSEKEY_WHEEL_TIME_TO_MAX 60
// Timeout settings for leader key
#undef LEADER_TIMEOUT
#define LEADER_TIMEOUT 350
#define LEADER_PER_KEY_TIMING
#undef DEBOUNCE
#define DEBOUNCE 45
// Memory saving
#ifdef CONSOLE_ENABLE
# define NO_DEBUG
# define NO_PRINT
#endif
#ifndef LINK_TIME_OPTIMIZATION_ENABLE
# define NO_ACTION_MACRO
# define NO_ACTION_FUNCTION
#endif
#undef RGBLIGHT_ANIMATIONS

View File

@ -0,0 +1,318 @@
#include QMK_KEYBOARD_H
#include "version.h"
#include "danielo515.h"
/* STUPID JS code to split by ergodox rows. Call the format function with the unformatted array
sliceBy = groups => items => groups.reduce(({start, acc},size) => ({
acc: (acc.push(items.slice(start,start+size)),acc ),
start: start + size
}), {acc:[],start:0}).acc
findMaxLen = items => items.reduce((max,curr) => max < curr.length ? curr.length : max,0)
setLen = len => strings => strings.map(str => str.padEnd(len, " "));
const format = string => {
const items = string.split(/,\s*(?![^()]*\))/)
const group = sliceBy([7,7,6,7,5,2,1,3])
const resize = setLen(findMaxLen(items));
const joinstr = ',\n'
const leftItems = group(items.slice(0,items.length/2))
const rightItems = group(items.slice(items.length/2))
const [left,right] = [leftItems.map(resize).join(joinstr),rightItems.map(resize).join(joinstr)]
return `\n${left},\n\n${right}\n`
}
*/
#define OSM_SF_CMD OSM(MOD_LGUI | MOD_LSFT)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ergodox(
KC_EQL ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,OSM(MOD_HYPR) ,
KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,TD(PASTE_DANCE) ,
KC_DELETE ,KC_A ,LT(3,KC_S) ,LT(2,KC_D) ,LT(4,KC_F) ,KC_G ,
KC_GRAVE ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,TD(COPY_CUT) ,
KC_BSLASH ,OSM(MOD_LCTL) ,OSM(MOD_LALT) ,KC_LEFT ,KC_RIGHT ,
OSM_SF_CMD ,KC_PLUS ,
KC_INSERT ,
OSM(MOD_LSFT) ,LT(2,KC_BSPACE) ,OSM(MOD_LGUI) ,
TO(1) ,KC_6 ,KC_7 ,KC_8 ,TD_F9 ,LT(3,KC_0) ,KC_DQUO ,
KC_UNDS ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,RSFT_T(KC_MINUS) ,
HYPR_T(KC_H) ,ALT_T(KC_J) ,RCTL_T(KC_K) ,LT(6,KC_L) ,TD_CLN ,GUI_T(KC_QUOTE) ,
ALT_TAB ,KC_N ,MEH_T(KC_M) ,KC_COMMA ,KC_DOT ,KC_SLASH ,LT(4,KC_KP_ASTERISK),
LT(4,KC_ENTER) ,KC_DOWN ,KC_LBRACKET ,KC_RBRACKET ,OSL(2) ,
KC_AUDIO_MUTE ,KC_ESCAPE ,
KC_END ,
KC_COLN ,KC_LEAD ,LT(4,KC_SPACE)
),
[1] = LAYOUT_ergodox(
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,AC_E ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
LT(5, KC_DELETE),AC_A ,KC_TRANSPARENT ,KC_TRANSPARENT ,FIND ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,
OSM(MOD_LSFT) ,KC_TRANSPARENT ,KC_TRANSPARENT ,
TO(8) ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_ENTER ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT),
[2] = LAYOUT_ergodox(
KC_TRANSPARENT,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_TRANSPARENT,
KC_TRANSPARENT,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_PIPE ,KC_CALCULATOR ,
KC_TRANSPARENT,KC_HASH ,KC_DLR ,KC_TRANSPARENT,KC_RPRN ,KC_GRAVE ,
KC_TRANSPARENT,KC_PERC ,KC_CIRC ,KC_LBRACKET ,KC_RBRACKET ,KC_TILD ,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,
RGB_HUI ,
KC_TRANSPARENT,KC_TRANSPARENT,RGB_HUD ,
KC_DELETE ,KC_A ,KC_B ,KC_C ,KC_D ,KC_E ,KC_BSPACE ,
KC_ENTER ,KC_F ,KC_7 ,KC_8 ,KC_9 ,KC_PERC ,KC_TRANSPARENT,
KC_HASH ,KC_4 ,KC_5 ,KC_6 ,KC_PLUS ,KC_KP_ASTERISK,
KC_KP_ENTER ,KC_COLON ,KC_1 ,KC_2 ,KC_3 ,KC_SLASH ,KC_BSLASH ,
KC_0 ,KC_COMMA ,KC_DOT ,KC_EQUAL ,KC_TRANSPARENT,
RGB_TOG ,RGB_SLD ,
RGB_VAI ,
RGB_VAD ,KC_BSPACE ,KC_SPACE
),
[3] = LAYOUT_ergodox(
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_LABK ,KC_RABK ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_AT ,KC_TRANSPARENT ,KC_EQL ,F_ARROW ,KC_GRAVE ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_LBRACKET ,KC_RBRACKET ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,
// Right hand
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
LALT(LSFT(KC_UP)) ,KC_HASH ,KC_LCBR ,KC_RCBR ,KC_KP_ASTERISK ,KC_PERC ,KC_DLR ,
KC_AMPR ,KC_LPRN ,KC_RPRN ,KC_CIRC ,KC_KP_PLUS ,KC_PIPE ,
LALT(LSFT(KC_DOWN)),KC_EXLM ,KC_TILD ,KC_CIRC ,ARROW ,KC_BSLASH ,KC_BSLASH ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
RESET ,KC_TRANSPARENT ,
KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_SPACE
),
[4] = LAYOUT_ergodox(
KC_TRANSPARENT ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_TRANSPARENT ,
KC_TRANSPARENT ,LCTL(KC_Q) ,LCTL(KC_DOWN) ,LGUI(KC_DOWN) ,WIN_LEFT_HALF ,WIN_RIGHT_HALF ,LALT(LSFT(KC_UP)) ,
LCTL(LSFT(KC_P)) ,LCTL(KC_A) ,SAVE ,LCTL(KC_D) ,KC_TRANSPARENT ,RGUI(KC_R) ,
LCTL(LSFT(KC_F)) ,UNDO ,CUT ,KC_PSCREEN ,KC_TRANSPARENT ,LGUI(KC_RIGHT) ,LALT(LSFT(KC_DOWN)),
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
LALT(KC_F4) ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,
LALT(KC_UP) ,LSFT(KC_HOME) ,LSFT(KC_LEFT) ,KC_UP ,LSFT(KC_RIGHT) ,LSFT(KC_END) ,KC_F13 ,
KC_HOME ,KC_LEFT ,KC_DOWN ,KC_RIGHT ,KC_END ,KC_F12 ,
LALT(KC_DOWN) ,LSFT(KC_INSERT) ,LCTL(LSFT(KC_J)) ,LSFT(KC_UP) ,KC_PGUP ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,LSFT(KC_DOWN) ,KC_PGDOWN ,WIN_TO_LEFT ,WIN_TO_RIGHT ,
KC_TRANSPARENT ,KC_SYSTEM_SLEEP ,
KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_BSPACE ,KC_TRANSPARENT
),
[5] = LAYOUT_ergodox(
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,LCTL(KC_TAB) ,LCTL(LSFT(KC_TAB)) ,LGUI(KC_D) ,LCTL(KC_F) ,KC_TRANSPARENT ,
LGUI(KC_L) ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,LSFT(KC_F9) ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,LCTL(LGUI(KC_LEFT)) ,LCTL(LGUI(KC_RIGHT)),KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,LCTL(KC_T) ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT
),
[6] = LAYOUT_ergodox(
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_MS_ACCEL2 ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_MS_WH_DOWN ,KC_MS_UP ,KC_MS_WH_UP ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_MS_LEFT ,KC_MS_DOWN ,KC_MS_RIGHT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_MS_BTN3 ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,
KC_MS_BTN1 ,KC_MS_BTN2 ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_PGUP ,LCTL(LGUI(KC_RIGHT)),KC_MS_WH_UP ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT ,
LGUI(RCTL(KC_LEFT)) ,KC_MS_WH_DOWN ,LCTL(KC_C) ,KC_TRANSPARENT ,KC_MEDIA_STOP ,KC_MEDIA_PLAY_PAUSE ,
KC_PGDOWN ,LCTL(LSFT(KC_N)) ,LCTL(LSFT(KC_J)) ,KC_MEDIA_PREV_TRACK ,KC_MEDIA_NEXT_TRACK ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_AUDIO_VOL_UP ,KC_AUDIO_VOL_DOWN ,KC_AUDIO_MUTE ,KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,
KC_TRANSPARENT ,
KC_TRANSPARENT ,KC_TRANSPARENT ,KC_TRANSPARENT
),
[7] = LAYOUT_ergodox(
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_UP ,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_LEFT ,KC_DOWN ,KC_RIGHT ,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT
),
[8] = LAYOUT_ergodox(
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_Q ,KC_W ,KC_E ,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_ENTER ,KC_A ,KC_S ,KC_D ,KC_F ,KC_TRANSPARENT,
KC_TRANSPARENT,KC_Z ,KC_X ,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,
KC_SPACE ,KC_LSHIFT ,KC_TRANSPARENT,
TO(0) ,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_PGDOWN ,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_ENTER ,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,
KC_TRANSPARENT,
KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT
),
};
// Used for blinking leds on layers higher than 7
uint16_t blink_timer = 0;
uint16_t blink_elapsed = 0;
bool blink_led_1 = false;
bool blink_led_2 = false;
bool blink_led_3 = false;
void matrix_scan_kb(void){
// first 7 layers do not need to blink
if(blink_led_1 || blink_led_2 || blink_led_3){
ergodox_board_led_off();
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
blink_elapsed = timer_elapsed(blink_timer);
if(blink_elapsed > 2000) { blink_timer = timer_read();}
if(blink_elapsed < 1000) {
if(blink_led_1) ergodox_right_led_1_on();
if(blink_led_2) ergodox_right_led_2_on();
if(blink_led_3) ergodox_right_led_3_on();
}
}
matrix_scan_user();
};
layer_state_t layer_state_set_user(layer_state_t state)
{
uint8_t layer = get_highest_layer(state);
ergodox_board_led_off();
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
blink_led_1=false;
blink_led_2=false;
blink_led_3=false;
switch (layer)
{
case 0:
rgblight_setrgb(0, 200, 200);
break;
case 1:
ergodox_right_led_1_on();
rgblight_setrgb(0, 200, 0); // green
break;
case 2:
ergodox_right_led_2_on();
rgblight_setrgb(0, 0, 255);
break;
case 3:
ergodox_right_led_3_on();
rgblight_setrgb(255, 0, 0);
break;
case 4:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
rgblight_setrgb(200, 65, 0);
break;
case 5:
ergodox_right_led_1_on();
ergodox_right_led_3_on();
rgblight_setrgb(0, 80, 33);
break;
case 6:
ergodox_right_led_2_on();
ergodox_right_led_3_on();
rgblight_setrgb(0, 10, 200);
break;
case 7:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
ergodox_right_led_3_on();
rgblight_setrgb(90, 150, 90);
break;
case 8:
blink_led_1=true;
rgblight_setrgb(100, 0, 100);
break;
case 9:
rgblight_setrgb(200, 150, 90);
break;
// default:
// rgblight_setrgb(0, 200, 200);
// break;
}
return state;
};
// use leds to indicate when a one shot mod is on
void oneshot_mods_changed_user(uint8_t mods) {
ergodox_board_led_off();
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
// One shot checks
if (mods & MOD_MASK_SHIFT) {
ergodox_right_led_1_on();
}
if (mods & MOD_MASK_CTRL) {
ergodox_right_led_2_on();
}
if (mods & MOD_MASK_ALT) {
ergodox_right_led_3_on();
}
// if (mods & MOD_MASK_GUI) {
// println("Oneshot mods GUI");
// }
}
void oneshot_locked_mods_changed_user(uint8_t mods) {
oneshot_mods_changed_user(mods);
}

View File

@ -0,0 +1,9 @@
# Set any rules.mk overrides for your specific keymap here.
# See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file
LTO_ENABLE = yes
AUTO_SHIFT_ENABLE = no
TAP_DANCE_ENABLE = yes # Enable the tap dance feature.
LEADER_ENABLE = yes
CONSOLE_ENABLE = no
RGBLIGHT_ENABLE = yes
COMBO_ENABLE = yes

View File

@ -0,0 +1,21 @@
#include "combo.h"
enum combos {
JK_ESC,
YU_COM,
UI_COM,
IO_COM,
OP_COM,
QW_COM
};
const uint16_t PROGMEM ui_combo[] = {KC_U, KC_I, COMBO_END};
const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END};
const uint16_t PROGMEM yu_combo[] = {KC_Y, KC_U, COMBO_END};
const uint16_t PROGMEM io_combo[] = {KC_I, KC_O, COMBO_END};
combo_t key_combos[COMBO_COUNT] = {
[JK_ESC] = COMBO(jk_combo, KC_ESC),
[YU_COM] = COMBO(yu_combo, KC_CIRC),
[UI_COM] = COMBO(ui_combo, KC_ESC),
[IO_COM] = COMBO(io_combo, KC_TILD)
};

View File

@ -0,0 +1,2 @@
#pragma once
#include "quantum.h"

View File

@ -0,0 +1,6 @@
#pragma once
#if defined(COMBO_ENABLE)
#define COMBO_COUNT 4
#define COMBO_TERM 50
#endif // !COMBO_ENABLE

View File

@ -0,0 +1,373 @@
#include "danielo515.h"
bool onMac = true;
// Send control or GUI depending if we are on windows or mac
bool CMD(uint16_t kc) {
if(onMac){ tap_code16(LGUI(kc)); } else { tap_code16(LCTL(kc)); }
return false;
}
//**************** Handle keys function *********************//
bool altPressed = false;
bool process_record_user(uint16_t keycode, keyrecord_t *record)
{
bool pressed = record->event.pressed;
if(pressed){
refresh_incremental_macros(keycode);
if(process_incremental_macro(keycode)){
return false;
}
if(is_macro(keycode)){
return handle_macro(keycode);
}
switch (keycode) {
case MAC_TGL:
onMac = !onMac;
onMac ? SEND_STRING("On mac") : SEND_STRING("Not on MAC");
return false;
}
}
switch (keycode)
{
case QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
layer_on(_QWERTY);
}
return false;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
case ADJUST:
if (record->event.pressed) {
layer_on(_ADJUST);
} else {
layer_off(_ADJUST);
}
return false;
// == Macros START ===
case ARROW:
if (record->event.pressed) SEND_STRING("->");
return false;
case F_ARROW:
if (record->event.pressed) SEND_STRING("=>");
return false;
case GREP:
if (record->event.pressed) SEND_STRING(" | grep "); return false;
// == Macros END ===
// == Multi Os START ===
case KC_HOME:// make the home behave the same on OSX
if (record->event.pressed && onMac) {
SEND_STRING(SS_LCTRL("a"));
return false;
}
case KC_END:// make the end behave the same on OSX
if (record->event.pressed && onMac) {
tap_code16(C(KC_E));
return false;
}
case AC_A:// Accent á
if (record->event.pressed) SEND_STRING(SS_LALT("e") "a"); return false;
case AC_E:// Accent é
if (record->event.pressed) SEND_STRING(SS_LALT("e") "e"); return false;
case AC_I:// Accent í
if (record->event.pressed) SEND_STRING(SS_LALT("e") "i"); return false;
case AC_O:// Accent ó
if (record->event.pressed) SEND_STRING(SS_LALT("e") "o"); return false;
case CUT: if (record->event.pressed) return CMD(KC_X);
case COPY:
if (record->event.pressed) {
onMac ? SEND_STRING(SS_LGUI("c")) : SEND_STRING(SS_LCTRL("c"));
}
return false;
case PASTE:
if (record->event.pressed) {
onMac ? SEND_STRING(SS_LGUI("v")) : SEND_STRING(SS_LCTRL("v"));
}
return false;
case SAVE:
if (record->event.pressed) {
onMac ? SEND_STRING(SS_LGUI("s")) : SEND_STRING(SS_LCTRL("s"));
}
return false;
case UNDO:
if (record->event.pressed) {
onMac ? SEND_STRING(SS_LGUI("z")) : SEND_STRING(SS_LCTRL("z"));
}
return false;
case FIND:
if (record->event.pressed) {
onMac ? SEND_STRING(SS_LGUI("f")) : SEND_STRING(SS_LCTRL("f"));
}
return false;
case CHG_LAYOUT:
if (record->event.pressed) {
onMac ? SEND_STRING(SS_LCTRL(" ")) : SEND_STRING(SS_LCTRL("f"));
}
return false;
// == Multi Os END ===
#ifdef RGBLIGHT_ENABLE
case RGB_SLD:
if (record->event.pressed) { rgblight_mode(1); }
return false;
break;
//First time alt + tab, and alt stays sticky. Next press we just send tab. Any other key releases the alt
#endif
case ALT_TAB:
if (record->event.pressed)
{
if (altPressed)
{
tap_code(KC_TAB);
}
else
{
altPressed = true;
layer_on(7); // go to movement layer
onMac ? register_code(KC_LGUI) : register_code(KC_LALT);
tap_code(KC_TAB);
}
}
return false;
// avoid alt releasing if the key is of movement
case KC_RIGHT ... KC_UP:
if (altPressed)
{
return true; // yes QMK, do your stuff
}
}
// Reset sticky alt tab
if (altPressed)
{
onMac ? unregister_code(KC_LGUI) : unregister_code(KC_LALT);
altPressed = false;
layer_off(7);
return false;
}
return true;
};
//**************** LEADER *********************//
#ifdef LEADER_ENABLE
LEADER_EXTERNS();
#ifdef RGBLIGHT_ENABLE
void leader_start() {
rgblight_setrgb_range(5, 100, 199, 10,15);
};
void leader_end(){
rgblight_setrgb_range(200, 200, 255, 10,15);
};
#endif
void matrix_scan_user(void)
{
if (leading && leader_sequence_size > 0 && timer_elapsed(leader_time) > LEADER_TIMEOUT)
{
leading = false;
SEQ_ONE_KEY(KC_T) {
SEND_STRING("``" SS_TAP(X_LEFT));
}
// Triple ticks
SEQ_TWO_KEYS(KC_T, KC_T) {
SEND_STRING("```" SS_TAP(X_ENTER) SS_TAP(X_ENTER) "```" SS_TAP(X_UP));
}
// ==== International spanish accent vowels ====
SEQ_ONE_KEY(KC_A) {
SEND_STRING(SS_LALT("e") "a");
}
SEQ_ONE_KEY(KC_E) {
SEND_STRING(SS_LALT("e") "e");
}
SEQ_ONE_KEY(KC_I) {
SEND_STRING(SS_LALT("e") "i");
}
SEQ_ONE_KEY(KC_O) {
SEND_STRING(SS_LALT("e") "o");
}
SEQ_ONE_KEY(KC_U) {
SEND_STRING(SS_LALT("e") "u");
}
SEQ_ONE_KEY(KC_N) { // ñ
SEND_STRING(SS_LALT("n") "n");
}
// ==== MACROS ===
SEQ_ONE_KEY(KC_G) { // grep
SEND_STRING(" | grep ");
}
SEQ_ONE_KEY(KC_K) {
onMac ? SEND_STRING(SS_LCTRL(" ")) : SEND_STRING(SS_LCTRL("f"));
}
SEQ_TWO_KEYS(KC_D, KC_G) { // vim delete all
if(onMac){
SEND_STRING(SS_LGUI("a") SS_TAP(X_D));
} else {
SEND_STRING(SS_LCTRL("a") SS_TAP(X_D));
}
}
SEQ_ONE_KEY(KC_BSPACE) { // tripe delete!
SEND_STRING(SS_TAP(X_BSPACE) SS_TAP(X_BSPACE) SS_TAP(X_BSPACE));
}
SEQ_TWO_KEYS(KC_P, KC_G) {
SEND_STRING("ps -ef | grep ");
}
SEQ_TWO_KEYS(KC_J, KC_A) {
SEND_STRING("() => {}"SS_TAP(X_LEFT) SS_TAP(X_LEFT)SS_TAP(X_LEFT) SS_TAP(X_LEFT)SS_TAP(X_LEFT) SS_TAP(X_LEFT)SS_TAP(X_LEFT));
}
SEQ_TWO_KEYS(KC_S, KC_S) {
SEND_STRING("~/.ssh/ "); // this is a pain to type
}
SEQ_TWO_KEYS(KC_F, KC_T) {
SEND_STRING("feat():" SS_TAP(X_LEFT) SS_TAP(X_LEFT));
}
// ### LAYER CHANGE
SEQ_ONE_KEY(KC_1) {
layer_on(1);
}
SEQ_ONE_KEY(KC_H) { // control enter, because yes
SEND_STRING(SS_DOWN(X_LCTRL) SS_TAP(X_ENTER) SS_UP(X_LCTRL));
}
// paste all
SEQ_ONE_KEY(KC_P) {
if(onMac){
SEND_STRING(SS_LGUI("a") SS_LGUI("v"));
} else {
SEND_STRING(SS_LCTRL("a") SS_LCTRL("v"));
}
}
SEQ_THREE_KEYS(KC_M, KC_A, KC_C) {
onMac = true;
#ifdef RGBLIGHT_ENABLE
rgblight_setrgb(255, 255, 255);
#endif
}
SEQ_THREE_KEYS(KC_W, KC_I, KC_N) {
onMac = false;
#ifdef RGBLIGHT_ENABLE
rgblight_setrgb(255, 255, 0);
#endif
}
/* Copy all */
SEQ_ONE_KEY(KC_Y) {
if(onMac){
SEND_STRING(SS_LGUI("a") SS_LGUI("c"));
} else {
SEND_STRING(SS_LCTRL("a") SS_LCTRL("c"));
}
}
//emoji bar
SEQ_TWO_KEYS(KC_E, KC_E) {
SEND_STRING(SS_DOWN(X_LGUI) SS_LCTRL(" ") SS_UP(X_LGUI));
}
SEQ_TWO_KEYS(KC_F, KC_F) {
SEND_STRING("ps -ef | grep ");
}
SEQ_TWO_KEYS(KC_H, KC_T) {
SEND_STRING("https://");
}
leader_end();
}
}
#endif // LEADER
// ======== INCREMENTAL MACROS STUFF =============
#define MAX_INCREMENTAL_MACRO 20
#define TAP_ROTATION_TIMEOUT 400
uint16_t latest_kc = 0;
uint16_t latest_rotation = 0;
int key_count = 0;
const char incremental_macros[][MAX_INCREMENTAL_MACRO] = { "String1"SS_TAP(X_HOME)"X-", "String2"SS_TAP(X_HOME) };
bool process_incremental_macro (uint16_t kc) {
if( kc < INC_MACROS_START || kc > INC_MACROS_END ){
return false;
}
int macro_idx = (int) (kc - INC_MACROS_START) - 1;
char tempstring[3] = {0};
tempstring[0] = incremental_macros[macro_idx][key_count];
// Special cases of SS_TAP SS_UP and SS_DOWN, they require two characters so get both once and skip on next iteration
if( tempstring[0] == '\1' || tempstring[0] == '\2' || tempstring[0] == '\3'){
tempstring[1] = incremental_macros[macro_idx][++key_count];
}
if( tempstring[0] == '\0'){
key_count = 0;
}
send_string(tempstring);
return true;
};
void refresh_incremental_macros (uint16_t kc) {
if (kc == latest_kc)
{
if ( (timer_elapsed(latest_rotation) > TAP_ROTATION_TIMEOUT) || (key_count >= MAX_INCREMENTAL_MACRO) ) key_count = 0;
else key_count++;
} else {
key_count = 0;
latest_kc = kc;
}
latest_rotation = timer_read();
}
// ======== VISUAL STUDIO CODE SHORTCUTS STUFF
bool is_macro (uint16_t kc){
return kc > MACRO_START && kc < MACRO_END;
};
bool command_shift_p (bool isMac) {
isMac
? SEND_STRING(SS_DOWN(X_LSHIFT)SS_LGUI("p")SS_UP(X_LSHIFT))
: SEND_STRING(SS_DOWN(X_LSHIFT)SS_LCTRL("p")SS_UP(X_LSHIFT));
return false;
};
bool VSCommand(bool isMac, char *cmd)
{
command_shift_p (isMac);
send_string(cmd);
SEND_STRING(SS_TAP(X_ENTER));
return false;
};
bool handle_macro(uint16_t kc)
{
switch (kc)
{
case T_TERM: return VSCommand(onMac, "toit");
case FIX_ALL: return VSCommand(onMac, "faap");
case BLK_CMNT: return VSCommand(onMac, "tbc");
case LN_CMNT: return VSCommand(onMac, "tlic");
case CMD_S_P: return command_shift_p(onMac);
case TRI_TICKS: SEND_STRING("[[[ "); break;
}
return false;
};

View File

@ -0,0 +1,105 @@
#pragma once
#include "quantum.h"
bool handle_macro(uint16_t kc);
bool is_macro (uint16_t kc);
bool process_incremental_macro (uint16_t);
void refresh_incremental_macros (uint16_t);
//**************** KEYCODES *********************//
enum custom_keycodes
{
PLACEHOLDER = SAFE_RANGE, // can always be here
EPRM,
RGB_SLD,
ALT_TAB,
// Macros
ARROW,
F_ARROW,
QWERTY,
GREP,
// Accented characters
AC_A,
AC_E,
AC_I,
AC_O,
// Custom multi-os key-codes
CUT,
COPY,
PASTE,
SAVE,
UNDO,
CHG_LAYOUT,
FIND,
// OTHER OLD STUFF
LOWER,
RAISE,
ADJUST,
MAC_TGL,
MACRO_START, // START OF VSC DECLARATIONS
T_TERM,
FIX_ALL,
BLK_CMNT,
LN_CMNT,
CMD_S_P,
TRI_TICKS,
MACRO_END, // END OF VSC DECLARATIONS
INC_MACROS_START,
INC_MACROS_END,
};
enum layers {
_QWERTY,
_LOWER,
_RAISE,
_F,
_D,
_A,
_S,
_J,
_K,
_MACROS,
_ADJUST,
_SAFE_LAYER
};
// Function letters
#define FN_F LT(_F,KC_F)
#define FN_D LT(_D,KC_D)
#define FN_S LT(_S,KC_S)
#define FN_A LT(_A,KC_A)
#define FN_K LT(_K,KC_K)
#define FN_J LT(_J,KC_J)
#define KC_FN_D FN_D
#define KC_FN_S FN_S
#define KC_FN_F FN_F
#define KC_MACROS OSL(_MACROS)
#define KC_E_COLN LSFT(KC_DOT)
#define KC_E_EQL ES_EQL
#define KC_GUI OSM(MOD_RGUI)
#define KC_R_NUB S(KC_NUBS)
#define KC_E_LT KC_NUBS
#define KC_E_GT S(KC_NUBS)
#define KC_E_TILD ES_TILD
#define KC_E_MINS ES_MINS
#define KC_S_SPC SFT_T(KC_SPC) // Tap for Space, hold for Shift
#define KC_E_OVRR ES_OVRR
#define KC_E_APOS ES_APOS
#define KC_E_IEXL ES_IEXL
// Short hand for complex key combinations
# define WIN_LEFT_HALF LALT(LGUI(KC_LEFT))
# define WIN_RIGHT_HALF LALT(LGUI(KC_RIGHT))
# define WIN_TO_LEFT LALT(LSFT( LGUI(KC_LEFT) ))
# define WIN_TO_RIGHT LALT(LSFT( LGUI(KC_RIGHT) ))
// Ready to use Tap dance definitions, just put them on your layout
#ifdef TAP_DANCE_ENABLE
#include "tap_dance.h"
#endif

View File

@ -0,0 +1,14 @@
Copyright 2017 Daniel Rodriguez @ danielo515
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/>.

View File

@ -0,0 +1,9 @@
SRC += danielo515.c
ifeq ($(strip $(COMBO_ENABLE)), yes)
SRC += combo.c
endif
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
SRC += tap_dance.c
endif

View File

@ -0,0 +1,139 @@
#include "tap_dance.h"
//**************** Definitions needed for quad function to work *********************//
#ifdef QUAD_DANCE
int cur_dance(qk_tap_dance_state_t *state)
{
if (state->count == 1)
{
//If count = 1, and it has been interrupted - it doesn't matter if it is pressed or not: Send SINGLE_TAP
if (state->interrupted || state->pressed == 0)
return SINGLE_TAP;
else
return SINGLE_HOLD;
}
//If count = 2, and it has been interrupted - assume that user is trying to type the letter associated
//with single tap. In example below, that means to send `xx` instead of `Escape`.
else if (state->count == 2)
{
if (state->interrupted)
return DOUBLE_SINGLE_TAP;
else if (state->pressed)
return DOUBLE_HOLD;
else
return DOUBLE_TAP;
}
else
return 6; //magic number. At some point this method will expand to work for more presses
};
//**************** Definitions needed for quad function to work *********************//
# endif
// Slightly better tap dance double: interruption sends double single and any number over double sends the single that number of times
void qk_tap_dance_pair_finished_safe(qk_tap_dance_state_t *state, void *user_data) {
qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data;
int count = state->count;
if (state->count == 2) {
if (state->interrupted){
tap_code16(pair->kc1);register_code16 (pair->kc1);
state->count = 1; // Reset the counter as we are using the first key
} else register_code16 (pair->kc2);
return;
}
register_code16 (pair->kc1);
while(--count){
unregister_code16(pair->kc1);
register_code16 (pair->kc1);
}
}
void qk_tap_dance_pair_reset_safe(qk_tap_dance_state_t *state, void *user_data) {
qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data;
if (state->count == 2) {
unregister_code16 (pair->kc2);
return;
}
unregister_code16(pair->kc1);
}
//**************** Tap dance functions *********************//
qk_tap_dance_action_t tap_dance_actions[] = {
[COPY_CUT] = ACTION_TAP_DANCE_FN(td_copy_cut),
[PASTE_DANCE] = ACTION_TAP_DANCE_FN(td_paste),
[_TD_F1] = ACTION_TAP_DANCE_DOUBLE(KC_1, KC_F1),
[_TD_F2] = ACTION_TAP_DANCE_DOUBLE(KC_2, KC_F2),
[_TD_F3] = ACTION_TAP_DANCE_DOUBLE(KC_3, KC_F3),
[_TD_F4] = ACTION_TAP_DANCE_DOUBLE(KC_4, KC_F4),
[_TD_F5] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_F5),
[_TD_F6] = ACTION_TAP_DANCE_DOUBLE(KC_6, KC_F6),
[_TD_F7] = ACTION_TAP_DANCE_DOUBLE(KC_7, KC_F7),
[_TD_F8] = ACTION_TAP_DANCE_DOUBLE(KC_8, KC_F8),
[_TD_F9] = ACTION_TAP_DANCE_DOUBLE(KC_9, KC_F9),
[_TD_F10] = ACTION_TAP_DANCE_DOUBLE(KC_0, KC_F10),
[_TD_F11] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_F11),
[_TD_F12] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_F12),
[_TD_H_ENTER] = ACTION_TAP_DANCE_DOUBLE(KC_H, KC_ENT),
[_TD_CLN] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_COLON),
[_TD_SLASH] = ACTION_TAP_DANCE_DOUBLE(KC_SLASH, KC_BSLASH),
// OLD ONES
[LEFT_HOME] = ACTION_TAP_DANCE_DOUBLE(KC_LEFT, KC_HOME),
[RGT_HOME] = ACTION_TAP_DANCE_DOUBLE_SAFE(KC_RGHT, KC_END),
[J_ENT] = ACTION_TAP_DANCE_DOUBLE_SAFE(KC_J,KC_ENT),
[H_MINS] = ACTION_TAP_DANCE_DOUBLE_SAFE(KC_H,KC_SLASH),
[_TD_COPY] = ACTION_TAP_DANCE_FN(dance_copy),
[_TD_CUT] = ACTION_TAP_DANCE_FN(dance_cut),
[_TD_PASTE] = ACTION_TAP_DANCE_FN(dance_paste)
};
void td_copy_cut(qk_tap_dance_state_t *state, void *user_data)
{
if (state->count == 2)
{
onMac ? SEND_STRING(SS_LGUI("x")) : SEND_STRING(SS_LCTRL("x"));
}
else
{
onMac ? SEND_STRING(SS_LGUI("c")) : SEND_STRING(SS_LCTRL("c"));
}
reset_tap_dance(state);
};
void td_paste(qk_tap_dance_state_t *state, void *user_data)
{
if (state->count == 2)
{
onMac ? SEND_STRING(SS_DOWN(X_RSHIFT) SS_LGUI("v") SS_UP(X_RSHIFT)) : SEND_STRING(SS_DOWN(X_RSHIFT) SS_LCTRL("v") SS_UP(X_RSHIFT));
}
else
{
onMac ? SEND_STRING(SS_LGUI("v")) : SEND_STRING(SS_LCTRL("v"));
}
reset_tap_dance(state);
};
//===== The awesome tap dance for CUT, COPY and PASTE letters
void dance_copy (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) { tap_code16(KC_C); }
else
if (state->interrupted) { tap_code16(KC_C);tap_code16(KC_C);}
else CMD(KC_C);
reset_tap_dance (state);
}
void dance_cut (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) { tap_code16(KC_X); }
else { CMD(KC_X); }
reset_tap_dance (state);
}
void dance_paste (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
tap_code16(KC_V);
}
else {
CMD(KC_V);
}
reset_tap_dance (state);
}

View File

@ -0,0 +1,80 @@
#include "quantum.h"
extern bool CMD(uint16_t kc);
extern bool onMac;
#define ACTION_TAP_DANCE_DOUBLE_SAFE(kc1, kc2) { \
.fn = { NULL, qk_tap_dance_pair_finished_safe, qk_tap_dance_pair_reset_safe }, \
.user_data = (void *)&((qk_tap_dance_pair_t) { kc1, kc2 }), \
}
#ifdef QUAD_DANCE
//Enums used to clearly convey the state of the tap dance
enum {
SINGLE_TAP = 1,
SINGLE_HOLD = 2,
DOUBLE_TAP = 3,
DOUBLE_HOLD = 4,
DOUBLE_SINGLE_TAP = 5 //send SINGLE_TAP twice - NOT DOUBLE_TAP
// Add more enums here if you want for triple, quadruple, etc.
};
int cur_dance (qk_tap_dance_state_t *state);
# endif
enum tap_dance {
COPY_CUT,
PASTE_DANCE,
_TD_F1,
_TD_F2,
_TD_F3,
_TD_F4,
_TD_F5,
_TD_F6,
_TD_F7,
_TD_F8,
_TD_F9,
_TD_F10,
_TD_F11,
_TD_F12,
_TD_H_ENTER,
_TD_CLN,
_TD_SLASH,
// old ones
LEFT_HOME,
J_ENT,
H_MINS,
RGT_HOME,
_TD_COPY,
_TD_CUT,
_TD_PASTE,
};
void qk_tap_dance_pair_finished_safe(qk_tap_dance_state_t *state, void *user_data);
void qk_tap_dance_pair_reset_safe(qk_tap_dance_state_t *state, void *user_data);
void td_copy_cut (qk_tap_dance_state_t *state, void *user_data);
void td_paste(qk_tap_dance_state_t *state, void *user_data);
int cur_dance (qk_tap_dance_state_t *state);
void dance_cut (qk_tap_dance_state_t *state, void *user_data);
void dance_copy (qk_tap_dance_state_t *state, void *user_data);
void dance_paste (qk_tap_dance_state_t *state, void *user_data);
#define TD_COPY TD(_TD_COPY)
#define TD_CUT TD(_TD_CUT)
#define KC_TD_COPY TD(_TD_COPY) // Declarations for macros that add KC_
#define KC_TD_CUT TD(_TD_CUT)
#define KC_TD_PASTE TD(_TD_PASTE)
#define KC_E_GRV ES_GRV
#define TD_F1 TD(_TD_F1)
#define TD_F2 TD(_TD_F2)
#define TD_F3 TD(_TD_F3)
#define TD_F4 TD(_TD_F4)
#define TD_F5 TD(_TD_F5)
#define TD_F6 TD(_TD_F6)
#define TD_F7 TD(_TD_F7)
#define TD_F8 TD(_TD_F8)
#define TD_F9 TD(_TD_F9)
#define TD_F10 TD(_TD_F10)
#define TD_F11 TD(_TD_F11)
#define TD_F12 TD(_TD_F12)
#define H_ENTER TD(_TD_H_ENTER)
#define TD_CLN TD(_TD_CLN)
#define TD_SLASH TD(_TD_SLASH)