2022-12-27 00:08:36 -08:00
|
|
|
// Copyright 2022 Framework Computer
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#include QMK_KEYBOARD_H
|
2023-08-08 05:32:22 -07:00
|
|
|
#include "factory.h"
|
2022-12-27 00:08:36 -08:00
|
|
|
|
2022-12-29 06:35:36 -08:00
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
2022-12-27 00:08:36 -08:00
|
|
|
/*
|
|
|
|
* ┌────┬────┬────┬────┐
|
2023-07-10 11:58:28 -07:00
|
|
|
* 4 keys │Esc │Calc│ = │ <- │
|
2022-12-27 00:08:36 -08:00
|
|
|
* ├────┼────┼────┼────┤
|
2023-11-16 22:50:51 -08:00
|
|
|
* 4 keys │ Num│ / │ * │ - │
|
2022-12-27 00:08:36 -08:00
|
|
|
* ├────┼────┼────┼────┤
|
2023-11-16 22:50:51 -08:00
|
|
|
* 3 keys │ 7 │ 8 │ 9 │ + │
|
2022-12-27 00:08:36 -08:00
|
|
|
* ├────┼────┼────┼────┤
|
2023-07-10 11:58:28 -07:00
|
|
|
* 4 keys │ 4 │ 5 │ 6 │ + │
|
2022-12-27 00:08:36 -08:00
|
|
|
* ├────┼────┼────┼────┤
|
2023-11-16 22:50:51 -08:00
|
|
|
* 3 keys │ 1 │ 2 │ 3 │Entr│
|
2022-12-27 00:08:36 -08:00
|
|
|
* ├────┼────┼────┼────┤
|
2023-11-16 22:50:51 -08:00
|
|
|
* 3 keys │ 0 │ 0 │ . │Entr│
|
|
|
|
* └────┴────┴────┴────┴
|
|
|
|
* 21 total
|
2022-12-27 00:08:36 -08:00
|
|
|
*/
|
2023-11-16 22:50:51 -08:00
|
|
|
[_NUMLOCK] = LAYOUT(
|
2023-07-10 11:58:28 -07:00
|
|
|
KC_ESC, KC_CALC, KC_EQL, KC_BSPC,
|
2023-11-16 22:50:51 -08:00
|
|
|
KC_NUM, KC_PSLS, KC_PAST, KC_PMNS,
|
2023-07-10 11:58:28 -07:00
|
|
|
KC_P7, KC_P8, KC_P9, KC_PPLS,
|
|
|
|
KC_P4, KC_P5, KC_P6, KC_PPLS,
|
|
|
|
KC_P1, KC_P2, KC_P3, KC_PENT,
|
|
|
|
KC_P0, KC_P0, KC_PDOT, KC_PENT
|
2023-11-16 22:50:51 -08:00
|
|
|
),
|
|
|
|
/*
|
|
|
|
* ┌───────┬───────┬───────┬───────┐
|
|
|
|
* 4 keys │ RGB │ RGB + │ RGB + │ RGB + │
|
|
|
|
* │Toggle │ Speed │ Hue │ Sat │
|
|
|
|
* ├───────┼───────┼───────┼───────┤
|
|
|
|
* 4 keys │Numlock│ RGB - │ RGB - │ RGB - │
|
|
|
|
* │ │ Speed │ Hue │ Sat │
|
|
|
|
* ├───────┼───────┼───────┼───────┤
|
|
|
|
* 4 keys │ Home │ ↑ │ Page │RGB Nxt│
|
|
|
|
* │ │ │ Up │Effect │
|
|
|
|
* ├───────┼───────┼───────┼───────┤
|
|
|
|
* 4 keys │ ← │ │ → │RGB Prv│
|
|
|
|
* │ │ │ │Effect │
|
|
|
|
* ├───────┼───────┼───────┼───────┤
|
|
|
|
* 4 keys │ End │ ↓ │ Page │ BL │
|
|
|
|
* │ │ │ Down │ Step │
|
|
|
|
* ├───────┼───────┼───────┼───────┤
|
|
|
|
* 4 keys │ Insert│ Insert│ Delete│ BL │
|
|
|
|
* │ │ │ │ Step │
|
|
|
|
* └───────┴───────┴───────┴───────┘
|
|
|
|
* 24 total
|
|
|
|
*/
|
|
|
|
[_FN] = LAYOUT(
|
|
|
|
RGB_TOG, RGB_SPI, RGB_HUI, RGB_SAI,
|
|
|
|
_______, RGB_SPD, RGB_HUD, RGB_SAD,
|
|
|
|
_______, _______, _______, RGB_MOD,
|
|
|
|
_______, _______, _______, RGB_RMOD,
|
|
|
|
_______, _______, _______, BL_STEP,
|
|
|
|
_______, _______, _______, BL_STEP
|
2023-08-08 05:21:32 -07:00
|
|
|
),
|
|
|
|
/* Alphabet
|
|
|
|
* ┌────┬────┬────┬────┐
|
|
|
|
* 4 keys │ A │ B │ C │ D │
|
|
|
|
* ├────┼────┼────┼────┤
|
|
|
|
* 4 keys │ E │ F │ G │ H │
|
|
|
|
* ├────┼────┼────┼────┤
|
|
|
|
* 4 keys │ I │ J │ K │ L │
|
|
|
|
* ├────┼────┼────┼────┤
|
|
|
|
* 4 keys │ M │ N │ O │ P │
|
|
|
|
* ├────┼────┼────┼────┤
|
|
|
|
* 4 keys │ Q │ R │ S │ T │
|
|
|
|
* ├────┼────┼────┼────┤
|
|
|
|
* 4 keys │ U │ V │ W │ X │
|
|
|
|
* └────┴────┴────┴────┘
|
|
|
|
* 24 total
|
|
|
|
*/
|
2023-11-16 22:50:51 -08:00
|
|
|
[_FACTORY] = LAYOUT(
|
2023-08-08 05:21:32 -07:00
|
|
|
KC_A, KC_B, KC_C, KC_D,
|
|
|
|
KC_E, KC_F, KC_G, KC_H,
|
|
|
|
KC_I, KC_J, KC_K, KC_L,
|
|
|
|
KC_M, KC_N, KC_O, KC_P,
|
|
|
|
KC_Q, KC_R, KC_S, KC_T,
|
|
|
|
KC_U, KC_V, KC_W, KC_X
|
2023-11-16 22:50:51 -08:00
|
|
|
),
|
2022-12-27 00:08:36 -08:00
|
|
|
};
|
2023-08-08 05:32:22 -07:00
|
|
|
|
2023-11-16 22:50:51 -08:00
|
|
|
bool led_update_user(led_t led_state) {
|
|
|
|
// Change layer if numlock state changes, either triggered by OS or
|
|
|
|
// by numlock key on this keyboard
|
|
|
|
if (led_state.num_lock) {
|
|
|
|
layer_off(_FN);
|
|
|
|
} else {
|
|
|
|
layer_on(_FN);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2023-08-08 05:32:22 -07:00
|
|
|
void enable_factory_mode(bool enable) {
|
|
|
|
if (enable)
|
2023-11-16 22:50:51 -08:00
|
|
|
layer_on(_FACTORY);
|
2023-08-08 05:32:22 -07:00
|
|
|
else
|
2023-11-16 22:50:51 -08:00
|
|
|
layer_off(_FACTORY);
|
2023-08-08 05:32:22 -07:00
|
|
|
}
|