2018-05-08 22:55:50 +00:00
|
|
|
#include QMK_KEYBOARD_H
|
2017-03-07 16:44:58 +00:00
|
|
|
|
|
|
|
// Layers
|
2017-06-18 01:16:06 +00:00
|
|
|
#define DVORAK 0
|
|
|
|
#define QWERTY 1
|
2017-03-16 00:32:58 +00:00
|
|
|
#define RAISE 2
|
2017-05-31 14:34:44 +00:00
|
|
|
#define LOWER 3
|
2017-06-08 21:43:16 +00:00
|
|
|
#define BDO 4
|
2017-06-18 01:14:32 +00:00
|
|
|
#define RESETL 5
|
2017-03-07 16:44:58 +00:00
|
|
|
|
2019-07-09 22:47:35 +00:00
|
|
|
#define KC_RAIS MO(RAISE)
|
|
|
|
#define KC_LOWR MO(LOWER)
|
2020-05-30 20:14:59 +00:00
|
|
|
#define KC_TGBD TG(BDO)
|
|
|
|
#define KC_TGRS TG(RESETL)
|
2019-07-09 22:47:35 +00:00
|
|
|
|
2017-03-07 16:44:58 +00:00
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
2018-05-08 22:55:50 +00:00
|
|
|
[DVORAK] = LAYOUT_kc(
|
2017-03-17 13:11:20 +00:00
|
|
|
NO, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, NO, \
|
|
|
|
NO, QUOT, COMM, DOT, P, Y, F, G, C, R, L, NO, \
|
|
|
|
NO, A, O, E, U, I, D, H, T, N, S, NO, \
|
|
|
|
NO, SCLN, Q, J, K, X, B, M, W, V, Z, NO, \
|
2020-05-30 20:14:59 +00:00
|
|
|
NO, TGBD, LALT, LCTL, LOWR, LSFT, BSPC, ENT, SPC, RAIS, LGUI, LEFT, RGHT, NO
|
2018-05-08 22:55:50 +00:00
|
|
|
),
|
2017-06-18 01:16:06 +00:00
|
|
|
|
2018-05-08 22:55:50 +00:00
|
|
|
[QWERTY] = LAYOUT_kc(
|
2017-06-18 01:16:06 +00:00
|
|
|
NO, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, NO, \
|
|
|
|
NO, Q, W, E, R, T, Y, U, I, O, P, NO, \
|
|
|
|
NO, A, S, D, F, G, H, J, K, L, SCLN, NO, \
|
|
|
|
NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, \
|
2020-05-30 20:14:59 +00:00
|
|
|
NO, TGBD, LALT, LCTL, LOWR, LSFT, BSPC, ENT, SPC, RAIS, LGUI, LEFT, RGHT, NO
|
2018-05-08 22:55:50 +00:00
|
|
|
),
|
2017-03-07 16:44:58 +00:00
|
|
|
|
2018-05-08 22:55:50 +00:00
|
|
|
[RAISE] = LAYOUT_kc(
|
2017-05-08 02:01:35 +00:00
|
|
|
NO, MRWD, MPRV, MPLY, MNXT, MFFD, TRNS, MUTE, VOLD, VOLU, DEL, NO, \
|
2017-06-18 02:51:50 +00:00
|
|
|
NO, TILD, GRV, LCBR, RCBR, DQUO, QUOT, EQL, PLUS, MINS, QUES, NO, \
|
|
|
|
NO, ESC, TAB, LPRN, RPRN, BSLS, SLSH, LEFT, DOWN, UP, RGHT, NO, \
|
|
|
|
NO, TRNS, TRNS, LBRC, RBRC, TRNS, INS, PIPE, UNDS, TRNS, TRNS, NO, \
|
2020-05-30 20:14:59 +00:00
|
|
|
NO, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TGRS, NO
|
2018-05-08 22:55:50 +00:00
|
|
|
),
|
2017-05-31 14:34:44 +00:00
|
|
|
|
2018-05-08 22:55:50 +00:00
|
|
|
[LOWER] = LAYOUT_kc(
|
2017-05-31 14:34:44 +00:00
|
|
|
NO, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, NO, \
|
|
|
|
NO, EXLM, AT, HASH, DLR, PERC, CIRC, AMPR, ASTR, LPRN, RPRN, NO, \
|
|
|
|
NO, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, NO, \
|
|
|
|
NO, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, DOT, TRNS, TRNS, TRNS, NO, \
|
2018-05-08 22:55:50 +00:00
|
|
|
NO, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, NO
|
|
|
|
),
|
2017-06-01 02:16:21 +00:00
|
|
|
|
2018-05-08 22:55:50 +00:00
|
|
|
[BDO] = LAYOUT_kc(
|
2017-06-10 02:00:43 +00:00
|
|
|
NO, ESC, 1, 2, 3, 4, 5, 0, SLSH, U, C, NO, \
|
2017-06-08 21:43:16 +00:00
|
|
|
NO, TAB, Q, W, E, R, 6, Y, I, O, P, NO, \
|
|
|
|
NO, LSFT, A, S, D, F, 7, G, H, J, K, NO, \
|
|
|
|
NO, T, Z, X, C, V, 8, B, N, M, L, NO, \
|
2020-05-30 20:14:59 +00:00
|
|
|
NO, LCTL, SPC, SPC, SPC, SPC, COMM, ENT, 9, NO, NO, NO, TGBD, NO
|
2018-05-08 22:55:50 +00:00
|
|
|
),
|
2017-06-18 01:14:32 +00:00
|
|
|
|
2018-05-08 22:55:50 +00:00
|
|
|
[RESETL] = LAYOUT(
|
2017-06-18 01:14:32 +00:00
|
|
|
KC_NO, RESET, 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_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, \
|
2020-05-30 20:14:59 +00:00
|
|
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, TG(RESETL),KC_NO
|
2018-05-08 22:55:50 +00:00
|
|
|
)
|
2017-03-07 16:44:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static uint8_t qw_dv_swap_state = 0;
|
|
|
|
|
|
|
|
bool process_record_user (uint16_t keycode, keyrecord_t *record) {
|
2018-05-08 22:55:50 +00:00
|
|
|
if (keycode == KC_LGUI) {
|
|
|
|
if (record->event.pressed) {
|
|
|
|
qw_dv_swap_state |= 0b00000001;
|
|
|
|
} else {
|
|
|
|
qw_dv_swap_state &= ~(0b00000001);
|
2017-03-07 16:44:58 +00:00
|
|
|
}
|
2018-05-08 22:55:50 +00:00
|
|
|
}
|
|
|
|
if (keycode == KC_LCTL) {
|
|
|
|
if (record->event.pressed) {
|
|
|
|
qw_dv_swap_state |= 0b00000010;
|
|
|
|
} else {
|
|
|
|
qw_dv_swap_state &= ~(0b00000010);
|
2017-03-07 16:44:58 +00:00
|
|
|
}
|
2018-05-08 22:55:50 +00:00
|
|
|
}
|
2017-03-07 16:44:58 +00:00
|
|
|
|
2018-05-08 22:55:50 +00:00
|
|
|
if (qw_dv_swap_state == 0b00000011) {
|
|
|
|
layer_invert(DVORAK);
|
|
|
|
}
|
|
|
|
return true;
|
2017-03-07 16:44:58 +00:00
|
|
|
}
|