Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
old evotron (made in 2016)
#include QMK_KEYBOARD_H
#include "debug.h"
#include "action_layer.h"
#include "version.h"
#define Base 0 // Base layer
#define Numbers 1 // numbers layer
#define Keypad 2 // keypad numbers layer
#define Function1 3 // function first dozen layer
#define Function2 4 // function second dozen layer
#define Direction 5 // directional layer
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Base layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | KP* | W | F | P | Z |PrintS| |NumLck| Q | L | U | Y | KP\ | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | KP+ | A | R | S | T | G | Caps | |Scroll| M | N | E | I | O | KP- |
* |--------+------+------+------+------+------| Lock | | Lock |------+------+------+------+------+--------|
* | | ' | V | K | D | J |------| |------| X | H | ; | , | . | |
* |--------+------+------+------+------+------|AltGr/| |AltGr/|------+------+------+------+------+--------|
* | | | | Ro | Pause| LN3 | Tab | | Tab | LN4 |Muhenk| Yen | | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | Power| | | Kana | Dir | | Dir |Henkan| | | Num ,|
* `----------------------------------' `----------------------------------'
* ,---------------. ,---------------.
* |Ent/Alt |Del/Gu| |Del/Gu|Ent/Alt |
* ,------|--------|------| |------+--------+-------.
* | BS | C | B/Num| |KE/Nm2| Space | - |
* | / | / |------| |------| / | / |
* | Ctrl | Shift |Esc/Fn| |EscFn2| Shift | Ctrl |
* `----------------------' `-----------------------'
*/
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
// Otherwise, it needs KC_*
/*
Ro = C1 073 = KC_INT1
Yen = FF 07D = KC_INT3
Kana = FF 070 = KC_INT2
Henkan = FF 079 = KC_INT4
Muhenkan = EB 07B = KC_INT5
LN4 = FF 077 = KC_LANG4
Power = FF 15E = KC_POWER
LN3 = FF 078 = KC_LANG3
Numpad , = C2 07E = KC_KP_COMMA
Pause = 13 045 = KC_PAUSE
KP Enter = 0D 11C = KC_KP_ENTER
Maybe
KC_KP_EQUAL_AS400
KC_APP = 5D 15D
KC_ALT_ERASE
KC_SYSREQ
KC_CANCEL
KC_CLEAR
KC_PRIOR
KC_RETURN
KC_SEPARATOR
KC_OUT
KC_OPER
KC_CLEAR_AGAIN
KC_CRSEL
KC_EXSEL
KC_EXECUTE
KC_HELP
KC_MENU
KC_SELECT
KC_STOP
KC_AGAIN
*/
// Modifier Keys
/*
Tera = Hyper = Left Control, Shift, Alt, GUI KC_HYPR
Giga = Meh = Left Control, Shift, Alt KC_MEH
Mega = LCAG = Left Control, Alt, GUI LCA(KC_LGUI)
Kilo = SGUI = Left Shift, GUI LSFT(KC_LGUI)
Hecto = LCA = Left Control, Alt LCTL(KC_LALT)
Deca = C_S = Left Control, Shift LSFT(KC_LCTL)
*/
[Base] = LAYOUT_ergodox( // layer 0 : Base
// left hand
KC_NO, KC_PAST, KC_W, KC_F, KC_P, KC_Z, KC_PSCREEN,
KC_KP_PLUS, KC_A, KC_R, KC_S, KC_T, KC_G, KC_CAPSLOCK,
KC_NO, ALL_T(KC_QUOT), MEH_T(KC_V), LCAG_T(KC_K), KC_D, KC_J,
KC_NO, KC_NO, KC_NO, KC_INT1, KC_PAUSE, KC_LANG3, ALGR_T(KC_TAB),
KC_POWER, KC_NO, KC_NO, KC_INT2, MO(Direction),
ALT_T(KC_ENTER), GUI_T(KC_DELETE),
LT(Numbers,KC_B),
CTL_T(KC_BSPACE), SFT_T(KC_C), LT(Function1,KC_ESCAPE),
// right hand
KC_NUMLOCK, KC_Q, KC_L, KC_U, KC_Y, KC_PSLS, KC_NO,
KC_SCROLLLOCK, KC_M, KC_N, KC_E, KC_I, KC_O, KC_KP_MINUS,
KC_X, KC_H, LCAG_T(KC_SCLN), MEH_T(KC_COMM),ALL_T(KC_DOT), KC_NO,
ALGR_T(KC_TAB), KC_LANG4, KC_INT5, KC_NO, KC_NO, KC_NO, KC_NO,
MO(Direction), KC_INT4, KC_NO, KC_NO, KC_KP_COMMA,
GUI_T(KC_DELETE), ALT_T(KC_ENTER),
LT(Keypad,KC_KP_ENTER),
LT(Function2,KC_ESCAPE), SFT_T(KC_SPACE), CTL_T(KC_MINUS)
),
/* Keymap 1: Numbers layer
*
* ,---------------------------------------------------. ,--------------------------------------------------.
* | | | | = | \ | | | | | | / | ` | | | |
* |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
* | | 1 | 2 | 3 | 4 | [ | | | | ] | 7 | 8 | 9 | 0 | |
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | 5 | |------| |------| | 6 | | | | |
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | | | | | |
* `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | | | | | |
* `-----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// Numbers
[Numbers] = LAYOUT_ergodox(
// left hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_EQUAL, KC_BSLASH, KC_TRNS, KC_TRNS,
KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_LBRACKET, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_5, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
// right hand
KC_TRNS, KC_TRNS, KC_SLSH, KC_GRAVE, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_RBRACKET, KC_7, KC_8, KC_9, KC_0, KC_TRNS,
KC_TRNS, KC_6, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),
/* Keymap 2: Keypad layer
*
* ,---------------------------------------------------. ,--------------------------------------------------.
* | | | | KP= | KP\ | | | | | | KP. | KP* | | | |
* |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
* | | KP1 | KP2 | KP3 | KP4 | KP+ | | | | KP- | KP7 | KP8 | KP9 | KP0 | |
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | KP5 | |------| |------| | KP6 | | | | |
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | | | | | |
* `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | | | | | |
* `-----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | Num |------| |------| | |
* | | Lock | | | | | |
* `--------------------' `--------------------'
*/
// Numbers
[Keypad] = LAYOUT_ergodox(
// left hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_PEQL, KC_PSLS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_4, KC_KP_PLUS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_5, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_NLCK, KC_TRNS,
// right hand
KC_TRNS, KC_TRNS, KC_PDOT, KC_PAST, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_KP_MINUS, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_0, KC_TRNS,
KC_TRNS, KC_KP_6, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),
/* Keymap 3: Function layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | | | F11 | | | | | | | | F12 | | | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | F1 | F2 | F3 | F4 | | | | | | F7 | F8 | F9 | F10 | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | F5 | |------| |------| | F6 | | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | | | | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// Function
[Function1] = LAYOUT_ergodox(
// left hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F5, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
// right hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS,
KC_TRNS, KC_F6, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),
/* Keymap 4: Function2 layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | | | F23 | | | | | | | | F24 | | | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | F13 | F14 | F15 | F16 | | | | | | F19 | F20 | F21 | F22 | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | F17 | |------| |------| | F18 | | | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | | | | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | Caps |------| |------| | |
* | | Lock | | | | | |
* `--------------------' `--------------------'
*/
// Function
[Function2] = LAYOUT_ergodox(
// left hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_F23, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_F13, KC_F14, KC_F15, KC_F16, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_F17, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_CAPS, KC_TRNS,
// right hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_F24, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_F19, KC_F20, KC_F21, KC_F22, KC_TRNS,
KC_TRNS, KC_F18, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),
/* Keymap 2: Direction layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | | Home | Up | PgUp | | | | | | Home | Up | PgUp | | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | S+C | Left | Down | Right| | | | | | Left | Down | Right| S+C | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | Ctrl | End | Insr | PgDn | |------| |------| | End | Insr | PgDn | Ctrl | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | | | | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// Direction
[Direction] = LAYOUT_ergodox(
// left hand
KC_TRNS, KC_TRNS, KC_HOME, KC_UP, KC_PGUP, KC_TRNS, KC_TRNS,
KC_TRNS, LSFT(KC_LCTL), KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS,
KC_TRNS, KC_LCTRL, KC_END, KC_INSERT, KC_PGDOWN, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
// right hand
KC_TRNS, KC_TRNS, KC_HOME, KC_UP, KC_PGUP, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, LSFT(KC_LCTL), KC_TRNS,
KC_TRNS, KC_END, KC_INSERT, KC_PGDOWN, KC_RCTRL, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),
};
// Runs just one time when the keyboard initializes.
void matrix_init_user(void) {
ergodox_board_led_off();
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
}
// Runs constantly in the background, in a loop.
void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_NUM_LOCK)) {
ergodox_right_led_1_on();
} else {
ergodox_right_led_1_off();
}
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
ergodox_right_led_3_on();
} else {
ergodox_right_led_3_off();
}
if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
ergodox_right_led_2_on();
} else {
ergodox_right_led_2_off();
}
};
/// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state);
switch (layer) {
case Numbers:
ergodox_right_led_1_on();
break;
case Keypad:
ergodox_right_led_1_on();
ergodox_right_led_2_on();
break;
case Function1:
ergodox_right_led_2_on();
break;
case Function2:
ergodox_right_led_2_on();
ergodox_right_led_3_on();
break;
case Direction:
ergodox_right_led_3_on();
break;
default:
// none
break;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment