Skip to content

Instantly share code, notes, and snippets.

@taiyoh
Created January 2, 2019 11:07
Show Gist options
  • Save taiyoh/0e71e6534cf787fbce67584f8d3b4cde to your computer and use it in GitHub Desktop.
Save taiyoh/0e71e6534cf787fbce67584f8d3b4cde to your computer and use it in GitHub Desktop.
keymap for fortitude60
#include QMK_KEYBOARD_H
#include "eeconfig.h"
extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _DVORAK 0
#define _QWERTY 1
#define _LOWER 2
#define _RAISE 3
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
#define LOWER MO(_LOWER)
#define RAISE MO(_RAISE)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Dvorak
* ,-----------------------------------------. ,-----------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | = |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Tab | ' | , | . | P | Y | | F | G | C | R | L | / |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Esc | A | O | E | U | I | | D | H | T | N | S | - |
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
* | Shift| ; | Q | J | K | X | Ctrl | Bksp | B | M | W | V | Z | \ |
* `-------------+------+------+------+------+------+------+------+------+------+------+-------------'
* | GUI | Alt | | Lower| Space| Enter| Raise| | Alt | GUI |
* `---------------------------------------------------------------------'
*/
[_DVORAK] = LAYOUT( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, \
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, \
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LCTL, KC_BSPC, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_BSLS, \
KC_LGUI, KC_LALT, XXXXXXX, LOWER, KC_SPC, KC_ENT, RAISE, XXXXXXX, KC_RALT, KC_RGUI\
),
/* Qwerty
* ,-----------------------------------------. ,-----------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | = |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Tab | Q | W | E | R | T | | Y | U | I | O | P | - |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Esc | A | S | D | F | G | | H | J | K | L | ; | ' |
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | Ctrl | Bksp | N | M | , | . | / | \ |
* `-------------+------+------+------+------+------+------+------+------+------+------+-------------'
* | GUI | Alt | | Lower| Space| Enter| Raise| | Alt | GUI |
* `---------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCTL, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, \
KC_LGUI, KC_LALT, XXXXXXX, LOWER, KC_SPC, KC_ENT, RAISE, XXXXXXX, KC_RALT, KC_RGUI\
),
/* Lower
* ,-----------------------------------------. ,-----------------------------------------.
* | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | TAB | | | | | | | | | | | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | ESC | | | | | | | | | | | | |
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
* | LSft | MUTE | VolDn| VolUP| | | Ctrl | Bksp | | | HOME | PGDN | PGUP | END |
* `-------------+------+------+------+------+------+------+------+------+------+------+-------------'
* | GUI | Alt | | | Space| Enter| | | Alt | GUI |
* `---------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT( \
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
_______, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END,\
_______, _______, _______, XXXXXXX, _______, _______, XXXXXXX, _______, _______, _______\
),
/* Raise
* ,-----------------------------------------. ,-----------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | = |
* |------+------+------+------+------+------. ,------+------+------+------+------+------|
* | TAB | Reset| | | | | | | | | [ | ] | |
* |------+------+------+------+------+------. ,------+------+------+------+------+------|
* | ESC | | | | | | | | | | { | } | |
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
* | LSft |Qwerty|Dvorak| | | | Ctrl | Del | | | LEFT | DOWN | UP | RIGHT|
* `-------------+------+------+------+------+------+------+------+------+------+------+-------------'
* | GUI | Alt | | | Space| Enter| | | Alt | GUI |
* `---------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT( \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LBRC, KC_RBRC, XXXXXXX, \
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, S(KC_LBRC), S(KC_RBRC), XXXXXXX, \
_______, _QWERTY, _DVORAK, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_DEL, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, \
_______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______, _______\
)
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case _QWERTY:
if (record->event.pressed) {
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
case _DVORAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment