Skip to content

Instantly share code, notes, and snippets.

@wazazaby
Last active April 24, 2022 15:33
Show Gist options
  • Save wazazaby/b47e1f068a1f1d78943e0a19fac30f1e to your computer and use it in GitHub Desktop.
Save wazazaby/b47e1f068a1f1d78943e0a19fac30f1e to your computer and use it in GitHub Desktop.
/* Copyright 2019 Naoto Takai
*
* 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/>.
*/
#include QMK_KEYBOARD_H
#include "quantum.h"
enum layers {
_BASE = 0,
_NUMS,
_SYMS,
_FUNC
};
enum {
TD_QG,
TD_OUT,
TD_12,
TD_OLB,
TD_PRB,
TD_KS,
TD_LQ,
TD_BC,
TD_ND,
TD_MS,
TD_ZGUI
};
void egg(qk_tap_dance_state_t *state, void *user_data) {
switch (state->count) {
case 1:
register_code(KC_LSFT);
break;
case 2:
register_code(KC_LGUI);
tap_code(KC_D);
unregister_code(KC_LGUI);
break;
default:
SEND_STRING("Hello, my friend. Have you considered our lord and savior, Soit Le Un ?");
}
}
void unegg(qk_tap_dance_state_t *state, void *user_data) {
unregister_code(KC_LSFT);
}
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_QG] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_GRV),
[TD_OUT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, egg, unegg),
[TD_12] = ACTION_TAP_DANCE_DOUBLE(KC_F11, KC_F12),
[TD_OLB] = ACTION_TAP_DANCE_DOUBLE(KC_O, KC_LBRC),
[TD_PRB] = ACTION_TAP_DANCE_DOUBLE(KC_P, KC_RBRC),
[TD_KS] = ACTION_TAP_DANCE_DOUBLE(KC_K, KC_SCLN),
[TD_LQ] = ACTION_TAP_DANCE_DOUBLE(KC_L, KC_QUOT),
[TD_BC] = ACTION_TAP_DANCE_DOUBLE(KC_B, KC_COMMA),
[TD_ND] = ACTION_TAP_DANCE_DOUBLE(KC_N, KC_DOT),
[TD_MS] = ACTION_TAP_DANCE_DOUBLE(KC_M, KC_SLSH),
[TD_ZGUI] = ACTION_TAP_DANCE_DOUBLE(KC_Z, KC_LGUI)
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = LAYOUT(
TD(TD_QG), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, TD(TD_OLB), TD(TD_PRB), KC_BSPC,
LCTL_T(KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, TD(TD_KS), TD(TD_LQ), LT(_NUMS, KC_ENT),
TD(TD_OUT), TD(TD_ZGUI), LALT_T(KC_X), LT(_SYMS, KC_C), LT(_FUNC, KC_V), TD(TD_BC), TD(TD_ND), TD(TD_MS), KC_SPC
),
[_NUMS] = LAYOUT(
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
KC_CAPS, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_BSLS, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______
),
[_SYMS] = LAYOUT(
KC_ESC, KC_PGUP, KC_UP, KC_HOME, _______, _______, _______, _______, _______, _______, _______,
_______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______, _______, _______,
_______, _______, KC_PGDOWN, KC_END, _______, _______, _______, _______, _______
),
[_FUNC] = LAYOUT(
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, TD(TD_12),
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET,
_______, _______, _______, _______, _______, _______, _______, _______, _______
)
};
LTO_ENABLE = yes
TAP_DANCE_ENABLE = yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment