Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Keymap] Add optional colemak layout #13217

Merged
merged 1 commit into from
Aug 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 45 additions & 2 deletions keyboards/keyprez/corgi/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@
// Defines names for use in layer keycodes and the keymap
enum layer_names {
_QWERTY,
_COLEMAK,
_BASE,
_FN,
_LOWER,
_RAISE,
_CMD,
};

enum corgi_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK
};

#define LOWER MO(_LOWER)
#define RAISE MO(_RAISE)
#define CMD MO(_CMD)
Expand All @@ -49,6 +55,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_MUTE
),

/* Colemak
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = LAYOUT(
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
KC_LCTL, KC_LGUI, KC_LALT, CMD, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT,
KC_MUTE
),

/* Lower
* ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
Expand Down Expand Up @@ -99,9 +124,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------'
*/
[_CMD] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS,
_______, QWERTY, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS,
_______, _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_PPLS,
_______, _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______,
_______, _______, _______, COLEMAK, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, _______,
_______
),
Expand All @@ -111,3 +136,21 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
tap_code(clockwise ? KC_VOLU : KC_VOLD);
return true;
}

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 COLEMAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
}
return true;
}