2022-12-21 06:14:17 -08:00
|
|
|
// Copyright 2022 Framework Computer
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#include QMK_KEYBOARD_H
|
2023-03-22 22:25:02 -07:00
|
|
|
#include "framework.h"
|
2022-12-21 06:14:17 -08:00
|
|
|
|
2023-05-03 02:16:18 -07:00
|
|
|
enum _layers {
|
|
|
|
_BASE,
|
|
|
|
_FN,
|
|
|
|
_FN_LOCK,
|
|
|
|
_FM
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-12-21 06:14:17 -08:00
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
|
|
/*
|
|
|
|
* ┌─────┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬────┐
|
2023-11-17 02:49:22 -08:00
|
|
|
* 14 keys │ESC │Mut│vDn│vUp│Prv│Ply│Nxt│bDn│bUp│Scn│Air│Prt│App│Del │
|
2022-12-21 06:14:17 -08:00
|
|
|
* ├───┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤
|
|
|
|
* 14 keys │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Backsp│
|
|
|
|
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬────┤
|
2022-12-29 06:35:36 -08:00
|
|
|
* 14 keys │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │
|
|
|
|
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴────┤
|
|
|
|
* 13 keys │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │
|
|
|
|
* ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───────┤
|
|
|
|
* 12 keys │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift │
|
|
|
|
* ├────┬───┼───┼───┼───┴───┴───┴───┴───┼───┼───┼───┴┬───┬────┤
|
2022-12-21 06:14:17 -08:00
|
|
|
* │ │ │ │ │ │ │ │ │↑ │ │
|
|
|
|
* 11 keys │Ctrl│FN │GUI│Alt│ │Alt│Ctl│ ← ├───┤ → │
|
|
|
|
* │ │ │ │ │ │ │ │ │ ↓│ │
|
|
|
|
* └────┴───┴───┴───┴───────────────────┴───┴───┴────┴───┴────┘
|
2022-12-29 06:35:36 -08:00
|
|
|
* 78 total
|
2022-12-21 06:14:17 -08:00
|
|
|
*/
|
2023-05-03 02:16:18 -07:00
|
|
|
[_BASE] = LAYOUT(
|
2023-11-17 02:49:22 -08:00
|
|
|
KC_ESC, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_BRID, KC_BRIU, KC_SCRN, KC_AIRP, KC_PSCR, KC_MSEL, KC_DEL,
|
2022-12-21 06:14:17 -08:00
|
|
|
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,
|
2022-12-29 06:35:36 -08:00
|
|
|
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_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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
2023-05-03 02:16:18 -07:00
|
|
|
KC_LCTL, MO(_FN), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT
|
2022-12-21 06:14:17 -08:00
|
|
|
),
|
|
|
|
/*
|
|
|
|
* Function layer
|
|
|
|
* ┌─────┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬────┐
|
2023-11-17 02:49:22 -08:00
|
|
|
* 14 keys │FN lk│F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│Ins │
|
2022-12-21 06:14:17 -08:00
|
|
|
* ├───┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤
|
|
|
|
* 14 keys │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
|
|
|
|
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬────┤
|
2023-02-28 18:58:35 -08:00
|
|
|
* 14 keys │ │ │RGB│Nxt│Hue│Sat│Spd│Brt│ │ │Pau│ │ │ │
|
2022-12-29 06:35:36 -08:00
|
|
|
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴────┤
|
2023-02-28 23:59:21 -08:00
|
|
|
* 13 keys │ │ │SRq│Prv│Hue│Sat│Spd│Brt│ScL│ │ │ │ │
|
2022-12-29 06:35:36 -08:00
|
|
|
* ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───────┤
|
2023-02-28 23:59:21 -08:00
|
|
|
* 12 keys │ │ │ │ │ │ │Brk│ │ │ │ │ │
|
2022-12-29 06:35:36 -08:00
|
|
|
* ├────┬───┼───┼───┼───┴───┴───┴───┴───┼───┼───┼───┴┬───┬────┤
|
2022-12-21 06:14:17 -08:00
|
|
|
* │ │ │ │ │ │ │ │ │PgU│ │
|
|
|
|
* 11 keys │ │ │ │ │ Toggle Backlight │ │ │Home├───┤End │
|
|
|
|
* │ │ │ │ │ │ │ │ │PgD│ │
|
|
|
|
* └────┴───┴───┴───┴───────────────────┴───┴───┴────┴───┴────┘
|
|
|
|
* 78 total
|
|
|
|
*/
|
2023-05-03 02:16:18 -07:00
|
|
|
[_FN] = LAYOUT(
|
2023-11-17 02:49:22 -08:00
|
|
|
FN_LOCK, 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_INS,
|
2023-01-03 17:35:58 -08:00
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
2023-02-28 18:58:35 -08:00
|
|
|
_______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_SPI, RGB_VAI, _______, _______, KC_PAUS, _______, _______, _______,
|
2023-02-28 23:59:21 -08:00
|
|
|
_______, _______, KC_SYRQ, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_SPD, RGB_VAD, KC_SCRL, _______, _______, _______, _______,
|
2023-06-19 00:43:11 -07:00
|
|
|
_______, _______, _______, BL_BRTG, _______, KC_BRK, _______, _______, _______, _______, _______, _______,
|
2023-06-19 00:05:26 -07:00
|
|
|
_______, _______, _______, _______, BL_STEP, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END
|
2023-02-28 18:58:35 -08:00
|
|
|
),
|
|
|
|
// Function lock layer
|
|
|
|
// Everything on F-row locked to function layer, except ESC and DEL
|
2023-05-03 02:16:18 -07:00
|
|
|
[_FN_LOCK] = LAYOUT(
|
2023-11-17 02:49:22 -08:00
|
|
|
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,
|
2023-02-28 18:58:35 -08:00
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
2023-05-03 02:16:18 -07:00
|
|
|
_______, MO(_FM), _______, _______, _______, _______, _______, _______, _______, _______, _______
|
|
|
|
),
|
2023-11-17 02:49:22 -08:00
|
|
|
// Locked+temporary FN (back to base plus extra keys)
|
2023-05-03 02:16:18 -07:00
|
|
|
[_FM] = LAYOUT(
|
2023-11-17 02:49:22 -08:00
|
|
|
FN_LOCK, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_BRID, KC_BRIU, KC_SCRN, KC_AIRP, KC_PSCR, KC_MSEL, KC_INS,
|
2023-05-03 02:16:18 -07:00
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
|
|
_______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_SPI, RGB_VAI, _______, _______, KC_PAUS, _______, _______, _______,
|
|
|
|
_______, _______, KC_SYRQ, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_SPD, RGB_VAD, KC_SCRL, _______, _______, _______, _______,
|
2023-06-19 00:43:11 -07:00
|
|
|
_______, _______, _______, BL_BRTG, _______, KC_BRK, _______, _______, _______, _______, _______, _______,
|
2023-06-19 00:05:26 -07:00
|
|
|
_______, _______, _______, _______, BL_STEP, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END
|
2023-05-03 02:16:18 -07:00
|
|
|
),
|
2022-12-21 06:14:17 -08:00
|
|
|
};
|
2023-05-03 02:16:18 -07:00
|
|
|
|
|
|
|
// Make sure to keep FN Lock even after reset
|
|
|
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|
|
|
switch (keycode) {
|
|
|
|
case FN_LOCK:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
if (layer_state_is(_FN)) {
|
|
|
|
set_single_persistent_default_layer(_FN_LOCK);
|
|
|
|
}
|
|
|
|
if (layer_state_is(_FM)) {
|
|
|
|
set_single_persistent_default_layer(_BASE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|