mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-12-27 03:49:54 +00:00
75 lines
3.9 KiB
C
75 lines
3.9 KiB
C
// Copyright 2021 Jasper Chan (@Gigahawk)
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
#include QMK_KEYBOARD_H
|
|
|
|
enum layers {
|
|
_BASE,
|
|
_GAME,
|
|
_TRAN,
|
|
};
|
|
|
|
#define _BASE_COLOR_RGB 156, 123, 85
|
|
#define _GAME_COLOR_RGB 147, 21, 21
|
|
#define _TRAN_COLOR_RGB 45, 89, 24
|
|
#define _CAPS_COLOR_RGB 146, 140, 16
|
|
|
|
// clang-format off
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
|
|
[_BASE] = 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,
|
|
KC_ESC, 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(2), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
|
),
|
|
|
|
[_GAME] = LAYOUT(
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
|
),
|
|
|
|
[_TRAN] = LAYOUT(
|
|
KC_CAPS, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, _______,
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
TG(1), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
_______, _______, _______, KC_MPLY, _______, _______, _______, KC_MPRV, _______, KC_MNXT
|
|
),
|
|
|
|
};
|
|
// clang-format on
|
|
|
|
bool encoder_update_user(uint8_t index, bool clockwise) {
|
|
if (clockwise) {
|
|
tap_code(KC_VOLU);
|
|
} else {
|
|
tap_code(KC_VOLD);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
void rgb_matrix_indicators_user(void) {
|
|
if (IS_LAYER_ON(_TRAN)) {
|
|
rgb_matrix_set_color_all(_TRAN_COLOR_RGB);
|
|
} else if (IS_LAYER_ON(_GAME)) {
|
|
rgb_matrix_set_color_all(_GAME_COLOR_RGB);
|
|
} else if (IS_LAYER_ON(_BASE)) {
|
|
rgb_matrix_set_color_all(_BASE_COLOR_RGB);
|
|
}
|
|
|
|
if (host_keyboard_led_state().caps_lock) {
|
|
for (uint8_t i = 0; i < DRIVER_LED_TOTAL; ++i) {
|
|
if (HAS_ANY_FLAGS(g_led_config.flags[i], LED_FLAG_UNDERGLOW)) {
|
|
rgb_matrix_set_color(i, _CAPS_COLOR_RGB);
|
|
}
|
|
}
|
|
}
|
|
}
|