Skip to content

Instantly share code, notes, and snippets.

@johnmee
Created August 17, 2019 07:04
Show Gist options
  • Save johnmee/efeaf39f4ab5b81494c36842a93eaf20 to your computer and use it in GitHub Desktop.
Save johnmee/efeaf39f4ab5b81494c36842a93eaf20 to your computer and use it in GitHub Desktop.
niumini qmk layout with adjust layer that doesn't work.
#include QMK_KEYBOARD_H
// Defines the keycodes used by our macros in process_record_user
#define _QWERTY 0
#define _LOWER 1
#define _RAISE 2
#define _ADJUST 16
enum custom_keycodes {
QWERTY = SAFE_RANGE,
LOWER,
RAISE,
ADJUST,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Layer 0
* ,-----------------------------------------------------------------------------------.
* | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Tab | A | S | D | F | G | H | J | K | L | ;: | Enter|
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | ,< | .> | /? | Shift|
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Ctrl | GUI | Caps | Alt |Layer1| Space |Layer2| Left | Down | Up | Right|
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT_planck_mit(
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT, KC_QUOT),
KC_LCTL, KC_LGUI, KC_CAPS, KC_LALT, TT(_LOWER), KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),
/* Layer 1
* ,-----------------------------------------------------------------------------------.
* | ` | | Home | Up | PgUp | | F6 | 7 | 8 | 9 | | DEL |
* |------+------+------+------+------+-------------+------+------+------+------|------|
* | | | Left | Down | Right| | | 4 | 5 | 6 | | GPgUp|
* |------+------+------+------+------+------|------+------+------+------+------|------|
* | | | End | | PgDn | | | 1 | 2 | 3 | | GPgDn|
* |------+------+------+------+------+------+------+------+------+------+------|------|
* | Reset| | | | | | 0 | 0 | . | | |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT_planck_mit(
KC_GRV, _______, KC_HOME, KC_UP, KC_PGUP, _______, KC_F6, KC_7, KC_8, KC_9, _______, KC_DEL,
_______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_4, KC_5, KC_6, _______, G(KC_PGUP),
_______, _______, KC_END, _______, KC_PGDN, _______, _______, KC_1, KC_2, KC_3, _______, G(KC_PGDN),
RESET, _______, _______, _______, _______, _______, KC_0, KC_0, KC_DOT, _______, _______
),
/* Layer 2 (r_ Indicates RGB Controls: r_TOG, r_Mode, r_Hue+, r_Hue-)
* ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | ^ | * | | | - | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | \ | [ | = | - | _ | ( | ) | + | | | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | | | * | ] | & | { | } | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT_planck_mit(
S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), _______, _______, KC_MINS, KC_BSPC,
KC_BSLS, KC_LBRC, KC_EQL, KC_MINS, S(KC_MINS), S(KC_9), S(KC_0), KC_PPLS, _______, _______, _______, _______,
_______, S(KC_BSLS), S(KC_8), KC_RBRC, _______, S(KC_LBRC), S(KC_RBRC), _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
/* Layer ADJUST - Doesnt work.
*/
[_ADJUST] = LAYOUT_planck_mit(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_VOLU, KC_VOLD, KC_MUTE, _______,
_______, _______, _______, _______, _______, _______, _______, KC_M, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment