Skip to content

Commit

Permalink
Fix layout macros
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed Jul 23, 2021
1 parent 37bdfd6 commit 7b2dbe8
Show file tree
Hide file tree
Showing 8 changed files with 299 additions and 107 deletions.
40 changes: 34 additions & 6 deletions keyboards/gmmk/pro/ansi/keymaps/willwm/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#include QMK_KEYBOARD_H

// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Del Rotary(Mute)
Expand All @@ -24,16 +25,43 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// Caps A S D F G H J K L ; " Enter PgDn
// Sh_L Z X C V B N M , . ? Sh_R Up End
// Ct_L Win_L Alt_L SPACE Alt_R FN Ct_R Left Down Right
[0] = LAYOUT(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_MUTE,
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,
MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),

[0] = LAYOUT(KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_MUTE, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
[1] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR,
KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______,
_______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END
),

[1] = LAYOUT(_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END),

[2] = LAYOUT(_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),

[3] = LAYOUT(_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
[2] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),

[3] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
};
// clang-format on

bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
Expand Down
23 changes: 21 additions & 2 deletions keyboards/hub20/keymaps/left_hand_numpad/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,28 @@
// #define LED_MERGE_NUMPAD_LEFT_HANDED_ENTER TRUE
// #define LED_MERGE_NUMPAD_LEFT_HANDED_ZERO TRUE

#define MO_NLCK LT(1, KC_NLCK) // Numlock on tap, layer change on hold
#define MO_NLCK LT(1, KC_NLCK) // Numlock on tap, layer change on hold

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {[0] = LAYOUT_left_handed(KC_MUTE, KC_MPLY, KC_PMNS, KC_PAST, KC_PSLS, MO_NLCK, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_P4, KC_P5, KC_P6, KC_P1, KC_P2, KC_P3, KC_PENT, KC_PDOT, KC_P0), [1] = LAYOUT_left_handed(RESET, _______, RGB_TOG, RGB_RMOD, RGB_MOD, _______, _______, RGB_VAD, RGB_VAI, _______, RGB_HUD, RGB_HUI, _______, _______, RGB_SAD, RGB_SAI, _______, _______, _______)};
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_left_handed(
KC_MUTE, KC_MPLY,
KC_PMNS, KC_PAST, KC_PSLS, MO_NLCK,
KC_P7, KC_P8, KC_P9,
KC_PPLS, KC_P4, KC_P5, KC_P6,
KC_P1, KC_P2, KC_P3,
KC_PENT, KC_PDOT, KC_P0
),
[1] = LAYOUT_left_handed(
RESET, _______,
RGB_TOG, RGB_RMOD, RGB_MOD, _______,
_______, RGB_VAD, RGB_VAI, _______,
RGB_HUD, RGB_HUI, _______,
_______, RGB_SAD, RGB_SAI, _______,
_______, _______
)
};
// clang-format of

bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* Left Encoder */
Expand Down
25 changes: 21 additions & 4 deletions keyboards/hub20/keymaps/right_hand_numpad/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,30 @@
// #define LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER TRUE
// #define LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO TRUE

#define MO_NLCK LT(1, KC_NLCK) // Numlock on tap, layer change on hold
#define MO_NLCK LT(1, KC_NLCK) // Numlock on tap, layer change on hold

// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

// NOT TESTED, WAITING ENDORSEMENT FROM MANUFACTURER
[0] = LAYOUT_right_handed(KC_MUTE, KC_MPLY, MO_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_P7, KC_P8, KC_P9, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_P1, KC_P2, KC_P3, KC_P0, KC_PDOT, KC_PENT),
[1] = LAYOUT_right_handed(RESET, _______, RGB_TOG, RGB_RMOD, RGB_MOD, _______, _______, RGB_VAD, RGB_VAI, _______, RGB_HUD, RGB_HUI, _______, _______, RGB_SAD, RGB_SAI, _______, _______, _______)};
//NOT TESTED, WAITING ENDORSEMENT FROM MANUFACTURER
[0] = LAYOUT_right_handed(
KC_MUTE, KC_MPLY,
MO_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, KC_P8, KC_P9,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3,
KC_P0, KC_PDOT, KC_PENT
),
[1] = LAYOUT_right_handed(
RESET, _______,
RGB_TOG, RGB_RMOD, RGB_MOD, _______,
_______, RGB_VAD, RGB_VAI,
_______, RGB_HUD, RGB_HUI, _______,
_______, RGB_SAD, RGB_SAI,
_______, _______, _______
)
};
// clang-format on

bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* Left Encoder */
Expand Down
23 changes: 20 additions & 3 deletions keyboards/manyboard/macro/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,28 @@
*/
#include QMK_KEYBOARD_H

// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_4x4(KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, TO(1)),
[1] = LAYOUT_ortho_4x4(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, TO(2)),
[2] = LAYOUT_ortho_4x4(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, TO(0)),
[0] = LAYOUT_ortho_4x4(
KC_F1, KC_F2, KC_F3, KC_F4,
KC_F5, KC_F6, KC_F7, KC_F8,
KC_F9, KC_F10, KC_F11, KC_F12,
KC_F13, KC_F14, KC_F15, TO(1)
),
[1] = LAYOUT_ortho_4x4(
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, TO(2)
),
[2] = LAYOUT_ortho_4x4(
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, TO(0)
),
};
// clang-format on

layer_state_t layer_state_set_user(layer_state_t state) {
switch (get_highest_layer(state)) {
Expand Down
24 changes: 21 additions & 3 deletions keyboards/manyboard/macro/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,29 @@
*/
#include QMK_KEYBOARD_H

// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_4x4(KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, TO(1)),
[1] = LAYOUT_ortho_4x4(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, TO(2)),
[2] = LAYOUT_ortho_4x4(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, TO(0)),
[0] = LAYOUT_ortho_4x4(
KC_F1, KC_F2, KC_F3, KC_F4,
KC_F5, KC_F6, KC_F7, KC_F8,
KC_F9, KC_F10, KC_F11, KC_F12,
KC_F13, KC_F14, KC_F15, TO(1)
),
[1] = LAYOUT_ortho_4x4(
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, TO(2)
),
[2] = LAYOUT_ortho_4x4(
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, TO(0)
),
};
// clang-format on

layer_state_t layer_state_set_user(layer_state_t state) {
switch (get_highest_layer(state)) {
case 0:
Expand Down
27 changes: 22 additions & 5 deletions keyboards/nullbitsco/nibble/keymaps/oled_status/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,24 @@ enum custom_keycodes {
KC_CUST = SAFE_RANGE,
};

// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_MA] = LAYOUT_ansi(KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, KC_F13, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_F14, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, KC_F15, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, KC_F16, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
[_FN] = LAYOUT_ansi(RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_END, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
[_MA] = LAYOUT_ansi(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME,
KC_F13, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL,
KC_F14, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,
KC_F15, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
KC_F16, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
[_FN] = LAYOUT_ansi(
RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_END,
RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
};
// clang-format on

#ifdef OLED_DRIVER_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
Expand All @@ -38,7 +52,9 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
}

void oled_task_user(void) {
if (timer_elapsed(oled_timer) >= 3000) { set_oled_mode(OLED_MODE_IDLE); }
if (timer_elapsed(oled_timer) >= 3000) {
set_oled_mode(OLED_MODE_IDLE);
}
render_frame();
}
#endif
Expand All @@ -55,8 +71,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#endif
}
break;
case KC_CUST: // custom macro
if (record->event.pressed) {}
case KC_CUST: // custom macro
if (record->event.pressed) {
}
break;
}
return true;
Expand Down
Loading

0 comments on commit 7b2dbe8

Please sign in to comment.