mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-23 08:02:03 +00:00
Compare commits
16 Commits
0a1aff14b3
...
09f5469cec
Author | SHA1 | Date | |
---|---|---|---|
|
09f5469cec | ||
|
01593501e3 | ||
|
1504e9ca4c | ||
|
633ee50cd1 | ||
|
3137883956 | ||
|
327aaae1ba | ||
|
1d0b4c8d38 | ||
|
90ce570be6 | ||
|
2ffdec5dc2 | ||
|
618442516d | ||
|
79b364d289 | ||
|
d0702b519d | ||
|
8c3e09b950 | ||
|
9d30b42073 | ||
|
61009c506b | ||
|
b444e82985 |
@ -1 +1,10 @@
|
|||||||
{}
|
{
|
||||||
|
"ranges": {
|
||||||
|
"0x8000/0X3FFF": {
|
||||||
|
"define": "QK_UNICODEMAP"
|
||||||
|
},
|
||||||
|
"0xC000/0X3FFF": {
|
||||||
|
"define": "QK_UNICODEMAP_PAIR"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -189,7 +189,7 @@ extern "C" {
|
|||||||
bool matrix_is_on(uint8_t row, uint8_t col) {
|
bool matrix_is_on(uint8_t row, uint8_t col) {
|
||||||
uint8_t code = CODE(row, col);
|
uint8_t code = CODE(row, col);
|
||||||
|
|
||||||
if (IS_MOD(code)) {
|
if (IS_MODIFIER_KEYCODE(code)) {
|
||||||
if (local_keyboard_report.mods & ROW_BITS(code)) {
|
if (local_keyboard_report.mods & ROW_BITS(code)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -205,7 +205,7 @@ extern "C" {
|
|||||||
matrix_row_t matrix_get_row(uint8_t row) {
|
matrix_row_t matrix_get_row(uint8_t row) {
|
||||||
uint16_t row_bits = 0;
|
uint16_t row_bits = 0;
|
||||||
|
|
||||||
if (IS_MOD(CODE(row, 0)) && local_keyboard_report.mods) {
|
if (IS_MODIFIER_KEYCODE(CODE(row, 0)) && local_keyboard_report.mods) {
|
||||||
row_bits |= local_keyboard_report.mods;
|
row_bits |= local_keyboard_report.mods;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
98
keyboards/handwired/dactyl_manuform/5x6_68/info.json
Normal file
98
keyboards/handwired/dactyl_manuform/5x6_68/info.json
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "Dactyl-Manuform (5x6) 68 Keys",
|
||||||
|
"manufacturer": "kpagratis",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "kpagratis",
|
||||||
|
"bootloader": "caterina",
|
||||||
|
"processor": "atmega32u4",
|
||||||
|
"usb": {
|
||||||
|
"vid": "0xFEED",
|
||||||
|
"pid": "0x0016",
|
||||||
|
"device_version": "0.0.1"
|
||||||
|
},
|
||||||
|
"matrix_pins": {
|
||||||
|
"cols": ["D4", "C6", "D7", "E6", "B4", "B5"],
|
||||||
|
"rows": ["F6", "F7", "B1", "B3", "B2", "B6"]
|
||||||
|
},
|
||||||
|
"diode_direction": "ROW2COL",
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT": {
|
||||||
|
"layout": [
|
||||||
|
{"x": 0, "y": 0, "matrix": [0,0]},
|
||||||
|
{"x": 1, "y": 0, "matrix": [0,1]},
|
||||||
|
{"x": 2, "y": 0, "matrix": [0,2]},
|
||||||
|
{"x": 3, "y": 0, "matrix": [0,3]},
|
||||||
|
{"x": 4, "y": 0, "matrix": [0,4]},
|
||||||
|
{"x": 5, "y": 0, "matrix": [0,5]},
|
||||||
|
{"x": 14, "y": 0, "matrix": [6,0]},
|
||||||
|
{"x": 15, "y": 0, "matrix": [6,1]},
|
||||||
|
{"x": 16, "y": 0, "matrix": [6,2]},
|
||||||
|
{"x": 17, "y": 0, "matrix": [6,3]},
|
||||||
|
{"x": 18, "y": 0, "matrix": [6,4]},
|
||||||
|
{"x": 19, "y": 0, "matrix": [6,5]},
|
||||||
|
|
||||||
|
{"x": 0, "y": 1, "matrix": [1,0]},
|
||||||
|
{"x": 1, "y": 1, "matrix": [1,1]},
|
||||||
|
{"x": 2, "y": 1, "matrix": [1,2]},
|
||||||
|
{"x": 3, "y": 1, "matrix": [1,3]},
|
||||||
|
{"x": 4, "y": 1, "matrix": [1,4]},
|
||||||
|
{"x": 5, "y": 1, "matrix": [1,5]},
|
||||||
|
{"x": 14, "y": 1, "matrix": [7,0]},
|
||||||
|
{"x": 15, "y": 1, "matrix": [7,1]},
|
||||||
|
{"x": 16, "y": 1, "matrix": [7,2]},
|
||||||
|
{"x": 17, "y": 1, "matrix": [7,3]},
|
||||||
|
{"x": 18, "y": 1, "matrix": [7,4]},
|
||||||
|
{"x": 19, "y": 1, "matrix": [7,5]},
|
||||||
|
|
||||||
|
{"x": 0, "y": 2, "matrix": [2,0]},
|
||||||
|
{"x": 1, "y": 2, "matrix": [2,1]},
|
||||||
|
{"x": 2, "y": 2, "matrix": [2,2]},
|
||||||
|
{"x": 3, "y": 2, "matrix": [2,3]},
|
||||||
|
{"x": 4, "y": 2, "matrix": [2,4]},
|
||||||
|
{"x": 5, "y": 2, "matrix": [2,5]},
|
||||||
|
{"x": 14, "y": 2, "matrix": [8,0]},
|
||||||
|
{"x": 15, "y": 2, "matrix": [8,1]},
|
||||||
|
{"x": 16, "y": 2, "matrix": [8,2]},
|
||||||
|
{"x": 17, "y": 2, "matrix": [8,3]},
|
||||||
|
{"x": 18, "y": 2, "matrix": [8,4]},
|
||||||
|
{"x": 19, "y": 2, "matrix": [8,5]},
|
||||||
|
|
||||||
|
{"x": 0, "y": 3, "matrix": [3,0]},
|
||||||
|
{"x": 1, "y": 3, "matrix": [3,1]},
|
||||||
|
{"x": 2, "y": 3, "matrix": [3,2]},
|
||||||
|
{"x": 3, "y": 3, "matrix": [3,3]},
|
||||||
|
{"x": 4, "y": 3, "matrix": [3,4]},
|
||||||
|
{"x": 5, "y": 3, "matrix": [3,5]},
|
||||||
|
{"x": 14, "y": 3, "matrix": [9,0]},
|
||||||
|
{"x": 15, "y": 3, "matrix": [9,1]},
|
||||||
|
{"x": 16, "y": 3, "matrix": [9,2]},
|
||||||
|
{"x": 17, "y": 3, "matrix": [9,3]},
|
||||||
|
{"x": 18, "y": 3, "matrix": [9,4]},
|
||||||
|
{"x": 19, "y": 3, "matrix": [9,5]},
|
||||||
|
|
||||||
|
{"x": 0, "y": 4, "matrix": [4,0]},
|
||||||
|
{"x": 1, "y": 4, "matrix": [4,1]},
|
||||||
|
{"x": 2, "y": 4, "matrix": [4,2]},
|
||||||
|
{"x": 3, "y": 4, "matrix": [4,3]},
|
||||||
|
{"x": 16, "y": 4, "matrix": [10,2]},
|
||||||
|
{"x": 17, "y": 4, "matrix": [10,3]},
|
||||||
|
{"x": 18, "y": 4, "matrix": [10,4]},
|
||||||
|
{"x": 19, "y": 4, "matrix": [10,5]},
|
||||||
|
|
||||||
|
{"x": 5, "y": 5, "matrix": [5,0]},
|
||||||
|
{"x": 6, "y": 5, "matrix": [5,1]},
|
||||||
|
{"x": 7, "y": 5, "matrix": [5,2]},
|
||||||
|
{"x": 13, "y": 5, "matrix": [11,0]},
|
||||||
|
{"x": 14, "y": 5, "matrix": [11,1]},
|
||||||
|
{"x": 15, "y": 5, "matrix": [11,2]},
|
||||||
|
|
||||||
|
{"x": 5, "y": 6, "matrix": [5,3]},
|
||||||
|
{"x": 6, "y": 6, "matrix": [5,4]},
|
||||||
|
{"x": 7, "y": 6, "matrix": [5,5]},
|
||||||
|
{"x": 13, "y": 6, "matrix": [11,3]},
|
||||||
|
{"x": 14, "y": 6, "matrix": [11,4]},
|
||||||
|
{"x": 15, "y": 6, "matrix": [11,5]}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
// Copyright 2023 Kostas Pagratis (@kpagratis)
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
|
#define SPLIT_USB_DETECT
|
||||||
|
#define IGNORE_MOD_TAP_INTERRUPT
|
||||||
|
#define TAPPING_TERM 250
|
@ -0,0 +1,43 @@
|
|||||||
|
// Copyright 2023 Kostas Pagratis (@kpagratis)
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
enum custom_layers {
|
||||||
|
_QWERTY,
|
||||||
|
_LAYER2,
|
||||||
|
};
|
||||||
|
|
||||||
|
#define GUI_J RGUI_T(KC_J)
|
||||||
|
#define GUI_F LGUI_T(KC_F)
|
||||||
|
#define SFT_A LSFT_T(KC_A)
|
||||||
|
#define CTL_S LCTL_T(KC_S)
|
||||||
|
#define ALT_D LALT_T(KC_D)
|
||||||
|
#define ALT_K RALT_T(KC_K)
|
||||||
|
#define CTL_L RCTL_T(KC_L)
|
||||||
|
#define SFT_SC RSFT_T(KC_SCLN)
|
||||||
|
#define IMPORTS LALT(LCTL(KC_O)) //Intellij Organize Imports
|
||||||
|
#define LINES LALT(LGUI(KC_L)) //Intellij Reformat Code
|
||||||
|
#define USAGES LALT(KC_F7) //Intelllj Find Usages
|
||||||
|
#define RENAME LSFT(KC_F6) //Intellij Refactor Rename
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[_QWERTY] = LAYOUT(
|
||||||
|
KC_EQL , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS,
|
||||||
|
KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSLS,
|
||||||
|
KC_ESC , SFT_A , CTL_S , ALT_D , GUI_F , KC_G , KC_H , GUI_J , ALT_K , CTL_L , SFT_SC , KC_QUOT,
|
||||||
|
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_GRV , KC_INS , KC_LEFT, KC_RGHT, KC_DOWN, KC_UP , KC_LBRC, KC_RBRC,
|
||||||
|
KC_LCTL, KC_LALT, KC_HOME, KC_DEL , KC_PGUP, KC_BSPC,
|
||||||
|
KC_SPC , KC_DEL , KC_END , MO(_LAYER2), KC_PGDN, KC_ENT
|
||||||
|
),
|
||||||
|
[_LAYER2] = LAYOUT(
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, QK_BOOT,
|
||||||
|
XXXXXXX, IMPORTS, XXXXXXX, USAGES , RENAME , XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, XXXXXXX, XXXXXXX,
|
||||||
|
XXXXXXX, LINES , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX,
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, XXXXXXX,
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, _______,XXXXXXX, XXXXXXX
|
||||||
|
)
|
||||||
|
};
|
5
keyboards/handwired/dactyl_manuform/5x6_68/readme.md
Normal file
5
keyboards/handwired/dactyl_manuform/5x6_68/readme.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Dactyl Manuform
|
||||||
|
|
||||||
|
This is a 5x6 manuform with a 4 key bottom row and 6 key thumb clusters.
|
||||||
|
|
||||||
|
This results in a 68 key 5x6
|
13
keyboards/handwired/dactyl_manuform/5x6_68/rules.mk
Normal file
13
keyboards/handwired/dactyl_manuform/5x6_68/rules.mk
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
|
||||||
|
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||||
|
CONSOLE_ENABLE = no # Console for debug
|
||||||
|
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||||
|
NKRO_ENABLE = yes # Enable N-Key Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||||
|
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||||
|
AUDIO_ENABLE = no # Audio output
|
||||||
|
SPLIT_KEYBOARD = yes
|
@ -47,7 +47,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IS_MOD(keycode) && record->event.pressed) {
|
if (!IS_MODIFIER_KEYCODE(keycode) && record->event.pressed) {
|
||||||
if(keycode == KC_E || keycode == KC_A || keycode == KC_O || keycode == KC_I || keycode == KC_U) {
|
if(keycode == KC_E || keycode == KC_A || keycode == KC_O || keycode == KC_I || keycode == KC_U) {
|
||||||
predecessor_key = KC_O;
|
predecessor_key = KC_O;
|
||||||
vowel_proximity = timer_read();
|
vowel_proximity = timer_read();
|
||||||
|
@ -175,7 +175,7 @@ extern "C"
|
|||||||
bool matrix_is_on(uint8_t row, uint8_t col) {
|
bool matrix_is_on(uint8_t row, uint8_t col) {
|
||||||
uint8_t code = CODE(row, col);
|
uint8_t code = CODE(row, col);
|
||||||
|
|
||||||
if (IS_MOD(code)) {
|
if (IS_MODIFIER_KEYCODE(code)) {
|
||||||
if (local_keyboard_report.mods & ROW_BITS(code)) {
|
if (local_keyboard_report.mods & ROW_BITS(code)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -191,7 +191,7 @@ extern "C"
|
|||||||
matrix_row_t matrix_get_row(uint8_t row) {
|
matrix_row_t matrix_get_row(uint8_t row) {
|
||||||
uint16_t row_bits = 0;
|
uint16_t row_bits = 0;
|
||||||
|
|
||||||
if (IS_MOD(CODE(row, 0)) && local_keyboard_report.mods) {
|
if (IS_MODIFIER_KEYCODE(CODE(row, 0)) && local_keyboard_report.mods) {
|
||||||
row_bits |= local_keyboard_report.mods;
|
row_bits |= local_keyboard_report.mods;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
123
keyboards/wolf/twilight/info.json
Normal file
123
keyboards/wolf/twilight/info.json
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
{
|
||||||
|
"manufacturer": "MD",
|
||||||
|
"keyboard_name": "Twilight",
|
||||||
|
"maintainer": "ToastyStoemp",
|
||||||
|
"bootloader": "custom",
|
||||||
|
"diode_direction": "COL2ROW",
|
||||||
|
"features": {
|
||||||
|
"bootmagic": true,
|
||||||
|
"command": false,
|
||||||
|
"console": false,
|
||||||
|
"extrakey": true,
|
||||||
|
"mousekey": true,
|
||||||
|
"nkro": true
|
||||||
|
},
|
||||||
|
"matrix_pins": {
|
||||||
|
"cols": ["GP24", "GP23", "GP22", "GP21", "GP20", "GP19", "GP18", "GP11", "GP17", "GP16", "GP7", "GP6", "GP5", "GP4", "GP2", "GP1", "GP0"],
|
||||||
|
"rows": ["GP28", "GP27", "GP26", "GP25", "GP13", "GP3"]
|
||||||
|
},
|
||||||
|
"processor": "RP2040",
|
||||||
|
"url": "",
|
||||||
|
"usb": {
|
||||||
|
"device_version": "1.0.0",
|
||||||
|
"pid": "0x0077",
|
||||||
|
"vid": "0x5453"
|
||||||
|
},
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT": {
|
||||||
|
"layout": [
|
||||||
|
{ "matrix": [0, 0], "x": 0, "y": 0 },
|
||||||
|
{ "matrix": [0, 1], "x": 1.25, "y": 0 },
|
||||||
|
{ "matrix": [0, 2], "x": 2.25, "y": 0 },
|
||||||
|
{ "matrix": [0, 3], "x": 3.25, "y": 0 },
|
||||||
|
{ "matrix": [0, 4], "x": 4.25, "y": 0 },
|
||||||
|
{ "matrix": [0, 5], "x": 5.5, "y": 0 },
|
||||||
|
{ "matrix": [0, 6], "x": 6.5, "y": 0 },
|
||||||
|
{ "matrix": [0, 7], "x": 7.5, "y": 0 },
|
||||||
|
{ "matrix": [0, 8], "x": 8.5, "y": 0 },
|
||||||
|
{ "matrix": [0, 9], "x": 9.75, "y": 0 },
|
||||||
|
{ "matrix": [0, 10], "x": 10.75, "y": 0 },
|
||||||
|
{ "matrix": [0, 11], "x": 11.75, "y": 0 },
|
||||||
|
{ "matrix": [0, 12], "x": 12.75, "y": 0 },
|
||||||
|
{ "matrix": [0, 13], "x": 14, "y": 0 },
|
||||||
|
{ "matrix": [0, 14], "x": 15.25, "y": 0 },
|
||||||
|
{ "matrix": [0, 15], "x": 16.25, "y": 0 },
|
||||||
|
{ "matrix": [0, 16], "x": 17.25, "y": 0 },
|
||||||
|
{ "matrix": [1, 0], "x": 0, "y": 1.25 },
|
||||||
|
{ "matrix": [1, 1], "x": 1, "y": 1.25 },
|
||||||
|
{ "matrix": [1, 2], "x": 2, "y": 1.25 },
|
||||||
|
{ "matrix": [1, 3], "x": 3, "y": 1.25 },
|
||||||
|
{ "matrix": [1, 4], "x": 4, "y": 1.25 },
|
||||||
|
{ "matrix": [1, 5], "x": 5, "y": 1.25 },
|
||||||
|
{ "matrix": [1, 6], "x": 6, "y": 1.25 },
|
||||||
|
{ "matrix": [1, 7], "x": 7, "y": 1.25 },
|
||||||
|
{ "matrix": [1, 8], "x": 8, "y": 1.25 },
|
||||||
|
{ "matrix": [1, 9], "x": 9, "y": 1.25 },
|
||||||
|
{ "matrix": [1, 10], "x": 10, "y": 1.25 },
|
||||||
|
{ "matrix": [1, 11], "x": 11, "y": 1.25 },
|
||||||
|
{ "matrix": [1, 12], "x": 12, "y": 1.25 },
|
||||||
|
{ "matrix": [1, 13], "x": 13, "y": 1.25 },
|
||||||
|
{ "matrix": [3, 14], "x": 14, "y": 1.25 },
|
||||||
|
{ "matrix": [1, 14], "x": 15.25, "y": 1.25 },
|
||||||
|
{ "matrix": [1, 15], "x": 16.25, "y": 1.25 },
|
||||||
|
{ "matrix": [1, 16], "x": 17.25, "y": 1.25 },
|
||||||
|
{ "matrix": [2, 0], "w": 1.5, "x": 0, "y": 2.25 },
|
||||||
|
{ "matrix": [2, 1], "x": 1.5, "y": 2.25 },
|
||||||
|
{ "matrix": [2, 2], "x": 2.5, "y": 2.25 },
|
||||||
|
{ "matrix": [2, 3], "x": 3.5, "y": 2.25 },
|
||||||
|
{ "matrix": [2, 4], "x": 4.5, "y": 2.25 },
|
||||||
|
{ "matrix": [2, 5], "x": 5.5, "y": 2.25 },
|
||||||
|
{ "matrix": [2, 6], "x": 6.5, "y": 2.25 },
|
||||||
|
{ "matrix": [2, 7], "x": 7.5, "y": 2.25 },
|
||||||
|
{ "matrix": [2, 8], "x": 8.5, "y": 2.25 },
|
||||||
|
{ "matrix": [2, 9], "x": 9.5, "y": 2.25 },
|
||||||
|
{ "matrix": [2, 10], "x": 10.5, "y": 2.25 },
|
||||||
|
{ "matrix": [2, 11], "x": 11.5, "y": 2.25 },
|
||||||
|
{ "matrix": [2, 12], "x": 12.5, "y": 2.25 },
|
||||||
|
{ "matrix": [2, 13], "w": 1.5, "x": 13.5, "y": 2.25 },
|
||||||
|
{ "matrix": [2, 14], "x": 15.25, "y": 2.25 },
|
||||||
|
{ "matrix": [2, 15], "x": 16.25, "y": 2.25 },
|
||||||
|
{ "matrix": [2, 16], "x": 17.25, "y": 2.25 },
|
||||||
|
{ "matrix": [3, 0], "w": 1.75, "x": 0, "y": 3.25 },
|
||||||
|
{ "matrix": [3, 1], "x": 1.75, "y": 3.25 },
|
||||||
|
{ "matrix": [3, 2], "x": 2.75, "y": 3.25 },
|
||||||
|
{ "matrix": [3, 3], "x": 3.75, "y": 3.25 },
|
||||||
|
{ "matrix": [3, 4], "x": 4.75, "y": 3.25 },
|
||||||
|
{ "matrix": [3, 5], "x": 5.75, "y": 3.25 },
|
||||||
|
{ "matrix": [3, 6], "x": 6.75, "y": 3.25 },
|
||||||
|
{ "matrix": [3, 7], "x": 7.75, "y": 3.25 },
|
||||||
|
{ "matrix": [3, 8], "x": 8.75, "y": 3.25 },
|
||||||
|
{ "matrix": [3, 9], "x": 9.75, "y": 3.25 },
|
||||||
|
{ "matrix": [3, 10], "x": 10.75, "y": 3.25 },
|
||||||
|
{ "matrix": [3, 11], "x": 11.75, "y": 3.25 },
|
||||||
|
{ "matrix": [3, 13], "w": 2.25, "x": 12.75, "y": 3.25 },
|
||||||
|
{ "matrix": [4, 0], "w": 1.25, "x": 0, "y": 4.25 },
|
||||||
|
{ "matrix": [4, 1], "x": 1.25, "y": 4.25 },
|
||||||
|
{ "matrix": [4, 2], "x": 2.25, "y": 4.25 },
|
||||||
|
{ "matrix": [4, 3], "x": 3.25, "y": 4.25 },
|
||||||
|
{ "matrix": [4, 4], "x": 4.25, "y": 4.25 },
|
||||||
|
{ "matrix": [4, 5], "x": 5.25, "y": 4.25 },
|
||||||
|
{ "matrix": [4, 6], "x": 6.25, "y": 4.25 },
|
||||||
|
{ "matrix": [4, 7], "x": 7.25, "y": 4.25 },
|
||||||
|
{ "matrix": [4, 8], "x": 8.25, "y": 4.25 },
|
||||||
|
{ "matrix": [4, 9], "x": 9.25, "y": 4.25 },
|
||||||
|
{ "matrix": [4, 10], "x": 10.25, "y": 4.25 },
|
||||||
|
{ "matrix": [4, 11], "x": 11.25, "y": 4.25 },
|
||||||
|
{ "matrix": [4, 12], "w": 1.75, "x": 12.25, "y": 4.25 },
|
||||||
|
{ "matrix": [4, 13], "x": 14, "y": 4.25 },
|
||||||
|
{ "matrix": [4, 15], "x": 16.25, "y": 4.25 },
|
||||||
|
{ "matrix": [5, 0], "w": 1.25, "x": 0, "y": 5.25 },
|
||||||
|
{ "matrix": [5, 1], "w": 1.25, "x": 1.25, "y": 5.25 },
|
||||||
|
{ "matrix": [5, 2], "w": 1.25, "x": 2.5, "y": 5.25 },
|
||||||
|
{ "matrix": [5, 7], "w": 6.25, "x": 3.75, "y": 5.25 },
|
||||||
|
{ "matrix": [5, 10], "w": 1.25, "x": 10, "y": 5.25 },
|
||||||
|
{ "matrix": [5, 11], "w": 1.25, "x": 11.25, "y": 5.25 },
|
||||||
|
{ "matrix": [5, 12], "w": 1.25, "x": 12.5, "y": 5.25 },
|
||||||
|
{ "matrix": [5, 13], "w": 1.25, "x": 13.75, "y": 5.25 },
|
||||||
|
{ "matrix": [5, 14], "x": 15.25, "y": 5.25 },
|
||||||
|
{ "matrix": [5, 15], "x": 16.25, "y": 5.25 },
|
||||||
|
{ "matrix": [5, 16], "x": 17.25, "y": 5.25 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
27
keyboards/wolf/twilight/keymaps/default/keymap.c
Normal file
27
keyboards/wolf/twilight/keymaps/default/keymap.c
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 <contact@vwolf.be>
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
[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_F13, KC_PSCR, KC_SCRL, KC_PAUS,
|
||||||
|
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_BSPC, KC_INS, KC_HOME, KC_PGUP,
|
||||||
|
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_END, KC_PGDN,
|
||||||
|
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_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_UP,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_MENU, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||||
|
)
|
||||||
|
};
|
27
keyboards/wolf/twilight/keymaps/via/keymap.c
Normal file
27
keyboards/wolf/twilight/keymaps/via/keymap.c
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 <contact@vwolf.be>
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
[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_F13, KC_PSCR, KC_SCRL, KC_PAUS,
|
||||||
|
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_BSPC, KC_INS, KC_HOME, KC_PGUP,
|
||||||
|
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_END, KC_PGDN,
|
||||||
|
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_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_UP,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_MENU, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||||
|
)
|
||||||
|
};
|
1
keyboards/wolf/twilight/keymaps/via/rules.mk
Normal file
1
keyboards/wolf/twilight/keymaps/via/rules.mk
Normal file
@ -0,0 +1 @@
|
|||||||
|
VIA_ENABLE = yes
|
20
keyboards/wolf/twilight/readme.md
Normal file
20
keyboards/wolf/twilight/readme.md
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Twilight
|
||||||
|
|
||||||
|
The following is the QMK Firmware for the Twilight Hotswap PCB.
|
||||||
|
|
||||||
|
The PCB features:
|
||||||
|
* QMK & VIA compatibility
|
||||||
|
* Hotswap
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
* Keyboard Maintainer: [ToastyStoemp](https://github.com/ToastyStoemp)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make wolf/twilight:default
|
||||||
|
|
||||||
|
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||||
|
|
||||||
|
## Bootloader Enter the bootloader in 3 ways:
|
||||||
|
* **Bootmagic reset**: Hold down the key ESC key and plug in the keyboard (Top Left most switch)
|
1
keyboards/wolf/twilight/rules.mk
Normal file
1
keyboards/wolf/twilight/rules.mk
Normal file
@ -0,0 +1 @@
|
|||||||
|
# This file intentionally left blank
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright 2021 Harrison Chan (Xelus)
|
/* Copyright 2023 Harrison Chan (Xelus)
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -87,8 +87,9 @@
|
|||||||
#define ENABLE_RGB_MATRIX_HUE_BREATHING
|
#define ENABLE_RGB_MATRIX_HUE_BREATHING
|
||||||
#define ENABLE_RGB_MATRIX_HUE_PENDULUM
|
#define ENABLE_RGB_MATRIX_HUE_PENDULUM
|
||||||
#define ENABLE_RGB_MATRIX_HUE_WAVE
|
#define ENABLE_RGB_MATRIX_HUE_WAVE
|
||||||
// #define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
|
|
||||||
// #define ENABLE_RGB_MATRIX_PIXEL_RAIN
|
// #define ENABLE_RGB_MATRIX_PIXEL_RAIN
|
||||||
|
// #define ENABLE_RGB_MATRIX_PIXEL_FLOW
|
||||||
|
// #define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
|
||||||
|
|
||||||
#define ENABLE_RGB_MATRIX_TYPING_HEATMAP
|
#define ENABLE_RGB_MATRIX_TYPING_HEATMAP
|
||||||
#define ENABLE_RGB_MATRIX_DIGITAL_RAIN
|
#define ENABLE_RGB_MATRIX_DIGITAL_RAIN
|
||||||
@ -106,5 +107,6 @@
|
|||||||
#define ENABLE_RGB_MATRIX_SOLID_SPLASH
|
#define ENABLE_RGB_MATRIX_SOLID_SPLASH
|
||||||
#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
|
#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
|
||||||
|
|
||||||
|
// VIA KB level
|
||||||
#define FORCE_NKRO
|
#define VIA_FIRMWARE_VERSION 1
|
||||||
|
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 17
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright 2021 Harrison Chan (Xelus)
|
/* Copyright 2023 Harrison Chan (Xelus)
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -242,4 +242,312 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
|
|||||||
.set_color = IS31FL3741_set_color,
|
.set_color = IS31FL3741_set_color,
|
||||||
.set_color_all = IS31FL3741_set_color_all
|
.set_color_all = IS31FL3741_set_color_all
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef VIA_ENABLE
|
||||||
|
#include "quantum.h"
|
||||||
|
#include "eeprom.h"
|
||||||
|
|
||||||
|
indicator_settings_config g_config = {
|
||||||
|
.caps_lock_indicator = {0, 0, 128},
|
||||||
|
.num_lock_indicator = {60, 0, 128},
|
||||||
|
.scroll_lock_indicator = {120, 0, 128},
|
||||||
|
.layer_indicator = {180, 0, 128},
|
||||||
|
.caps_lock_key = 7,
|
||||||
|
.num_lock_key = 0,
|
||||||
|
.scroll_lock_key = 78,
|
||||||
|
.layer_indicator_key = 0,
|
||||||
|
.enable_caps_lock = true,
|
||||||
|
.enable_num_lock = false,
|
||||||
|
.enable_scroll_lock = true,
|
||||||
|
.enable_layer_indicator = false,
|
||||||
|
.caps_override_bl = true,
|
||||||
|
.num_override_bl = true,
|
||||||
|
.scroll_override_bl = true,
|
||||||
|
.layer_override_bl = true
|
||||||
|
};
|
||||||
|
|
||||||
|
void values_load(void)
|
||||||
|
{
|
||||||
|
eeprom_read_block( &g_config, ((void*)VIA_EEPROM_CUSTOM_CONFIG_ADDR), sizeof(g_config) );
|
||||||
|
}
|
||||||
|
|
||||||
|
void values_save(void)
|
||||||
|
{
|
||||||
|
eeprom_update_block( &g_config, ((void*)VIA_EEPROM_CUSTOM_CONFIG_ADDR), sizeof(g_config) );
|
||||||
|
}
|
||||||
|
|
||||||
|
void via_init_kb(void)
|
||||||
|
{
|
||||||
|
// If the EEPROM has the magic, the data is good.
|
||||||
|
// OK to load from EEPROM
|
||||||
|
if (via_eeprom_is_valid()) {
|
||||||
|
values_load();
|
||||||
|
} else {
|
||||||
|
values_save();
|
||||||
|
// DO NOT set EEPROM valid here, let caller do this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void via_custom_value_command_kb(uint8_t *data, uint8_t length) {
|
||||||
|
// data = [ command_id, channel_id, value_id, value_data ]
|
||||||
|
uint8_t *command_id = &(data[0]);
|
||||||
|
uint8_t *channel_id = &(data[1]);
|
||||||
|
uint8_t *value_id_and_data = &(data[2]);
|
||||||
|
|
||||||
|
if ( *channel_id == id_custom_channel ) {
|
||||||
|
switch ( *command_id )
|
||||||
|
{
|
||||||
|
case id_custom_set_value:
|
||||||
|
{
|
||||||
|
indicator_config_set_value(value_id_and_data);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case id_custom_get_value:
|
||||||
|
{
|
||||||
|
indicator_config_get_value(value_id_and_data);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case id_custom_save:
|
||||||
|
{
|
||||||
|
values_save();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
// Unhandled message.
|
||||||
|
*command_id = id_unhandled;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return the unhandled state
|
||||||
|
*command_id = id_unhandled;
|
||||||
|
|
||||||
|
// DO NOT call raw_hid_send(data,length) here, let caller do this
|
||||||
|
}
|
||||||
|
|
||||||
|
void indicator_config_set_value( uint8_t *data )
|
||||||
|
{
|
||||||
|
// data = [ value_id, value_data ]
|
||||||
|
uint8_t *value_id = &(data[0]);
|
||||||
|
uint8_t *value_data = &(data[1]);
|
||||||
|
|
||||||
|
switch ( *value_id )
|
||||||
|
{
|
||||||
|
case id_caps_lock_enable:
|
||||||
|
g_config.enable_caps_lock = *value_data;
|
||||||
|
break;
|
||||||
|
case id_num_lock_enable:
|
||||||
|
g_config.enable_num_lock = *value_data;
|
||||||
|
break;
|
||||||
|
case id_scroll_lock_enable:
|
||||||
|
g_config.enable_scroll_lock = *value_data;
|
||||||
|
break;
|
||||||
|
case id_layer_indicator_enable:
|
||||||
|
g_config.enable_layer_indicator = *value_data;
|
||||||
|
break;
|
||||||
|
case id_caps_lock_brightness:
|
||||||
|
g_config.caps_lock_indicator.v = *value_data;
|
||||||
|
break;
|
||||||
|
case id_num_lock_brightness:
|
||||||
|
g_config.num_lock_indicator.v = *value_data;
|
||||||
|
break;
|
||||||
|
case id_scroll_lock_brightness:
|
||||||
|
g_config.scroll_lock_indicator.v = *value_data;
|
||||||
|
break;
|
||||||
|
case id_layer_indicator_brightness:
|
||||||
|
g_config.layer_indicator.v = *value_data;
|
||||||
|
break;
|
||||||
|
case id_caps_lock_color:
|
||||||
|
_set_color( &(g_config.caps_lock_indicator), value_data );
|
||||||
|
break;
|
||||||
|
case id_num_lock_color:
|
||||||
|
_set_color( &(g_config.num_lock_indicator), value_data );
|
||||||
|
break;
|
||||||
|
case id_scroll_lock_color:
|
||||||
|
_set_color( &(g_config.scroll_lock_indicator), value_data );
|
||||||
|
break;
|
||||||
|
case id_layer_indicator_color:
|
||||||
|
_set_color( &(g_config.layer_indicator), value_data );
|
||||||
|
break;
|
||||||
|
case id_caps_lock_key:
|
||||||
|
g_config.caps_lock_key = *value_data;
|
||||||
|
break;
|
||||||
|
case id_num_lock_key:
|
||||||
|
g_config.num_lock_key = *value_data;
|
||||||
|
break;
|
||||||
|
case id_scroll_lock_key:
|
||||||
|
g_config.scroll_lock_key = *value_data;
|
||||||
|
break;
|
||||||
|
case id_layer_indicator_key:
|
||||||
|
g_config.layer_indicator_key = *value_data;
|
||||||
|
break;
|
||||||
|
case id_caps_lock_override:
|
||||||
|
g_config.caps_override_bl = *value_data;
|
||||||
|
break;
|
||||||
|
case id_num_lock_override:
|
||||||
|
g_config.num_override_bl = *value_data;
|
||||||
|
break;
|
||||||
|
case id_scroll_lock_override:
|
||||||
|
g_config.scroll_override_bl = *value_data;
|
||||||
|
break;
|
||||||
|
case id_layer_indicator_override:
|
||||||
|
g_config.layer_override_bl = *value_data;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void indicator_config_get_value( uint8_t *data )
|
||||||
|
{
|
||||||
|
uint8_t *value_id = &(data[0]);
|
||||||
|
uint8_t *value_data = &(data[1]);
|
||||||
|
|
||||||
|
switch ( *value_id )
|
||||||
|
{
|
||||||
|
case id_caps_lock_enable:
|
||||||
|
*value_data = g_config.enable_caps_lock;
|
||||||
|
break;
|
||||||
|
case id_num_lock_enable:
|
||||||
|
*value_data = g_config.enable_num_lock;
|
||||||
|
break;
|
||||||
|
case id_scroll_lock_enable:
|
||||||
|
*value_data = g_config.enable_scroll_lock;
|
||||||
|
break;
|
||||||
|
case id_layer_indicator_enable:
|
||||||
|
*value_data = g_config.enable_layer_indicator;
|
||||||
|
break;
|
||||||
|
case id_caps_lock_brightness:
|
||||||
|
*value_data = g_config.caps_lock_indicator.v;
|
||||||
|
break;
|
||||||
|
case id_num_lock_brightness:
|
||||||
|
*value_data = g_config.num_lock_indicator.v;
|
||||||
|
break;
|
||||||
|
case id_layer_indicator_brightness:
|
||||||
|
*value_data = g_config.scroll_lock_indicator.v;
|
||||||
|
break;
|
||||||
|
case id_scroll_lock_brightness:
|
||||||
|
*value_data = g_config.layer_indicator.v;
|
||||||
|
break;
|
||||||
|
case id_caps_lock_color:
|
||||||
|
_get_color( &(g_config.caps_lock_indicator), value_data );
|
||||||
|
break;
|
||||||
|
case id_num_lock_color:
|
||||||
|
_get_color( &(g_config.num_lock_indicator), value_data );
|
||||||
|
break;
|
||||||
|
case id_scroll_lock_color:
|
||||||
|
_get_color( &(g_config.scroll_lock_indicator), value_data );
|
||||||
|
break;
|
||||||
|
case id_layer_indicator_color:
|
||||||
|
_get_color( &(g_config.layer_indicator), value_data );
|
||||||
|
break;
|
||||||
|
case id_caps_lock_key:
|
||||||
|
*value_data = g_config.caps_lock_key;
|
||||||
|
break;
|
||||||
|
case id_num_lock_key:
|
||||||
|
*value_data = g_config.num_lock_key;
|
||||||
|
break;
|
||||||
|
case id_scroll_lock_key:
|
||||||
|
*value_data = g_config.scroll_lock_key;
|
||||||
|
break;
|
||||||
|
case id_layer_indicator_key:
|
||||||
|
*value_data = g_config.layer_indicator_key;
|
||||||
|
break;
|
||||||
|
case id_caps_lock_override:
|
||||||
|
*value_data = g_config.caps_override_bl;
|
||||||
|
break;
|
||||||
|
case id_num_lock_override:
|
||||||
|
*value_data = g_config.num_override_bl;
|
||||||
|
break;
|
||||||
|
case id_scroll_lock_override:
|
||||||
|
*value_data = g_config.scroll_override_bl;
|
||||||
|
break;
|
||||||
|
case id_layer_indicator_override:
|
||||||
|
*value_data = g_config.layer_override_bl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Some helpers for setting/getting HSV
|
||||||
|
void _set_color( HSV *color, uint8_t *data )
|
||||||
|
{
|
||||||
|
color->h = data[0];
|
||||||
|
color->s = data[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
void _get_color( HSV *color, uint8_t *data )
|
||||||
|
{
|
||||||
|
data[0] = color->h;
|
||||||
|
data[1] = color->s;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the indicators with RGB Matrix subsystem
|
||||||
|
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
|
||||||
|
// caps lock cyan
|
||||||
|
if (g_config.enable_caps_lock) {
|
||||||
|
RGB rgb_caps = hsv_to_rgb( (HSV){ .h = g_config.caps_lock_indicator.h,
|
||||||
|
.s = g_config.caps_lock_indicator.s,
|
||||||
|
.v = g_config.caps_lock_indicator.v } );
|
||||||
|
if (host_keyboard_led_state().caps_lock) {
|
||||||
|
RGB_MATRIX_INDICATOR_SET_COLOR(g_config.caps_lock_key, rgb_caps.r, rgb_caps.g, rgb_caps.b);
|
||||||
|
} else {
|
||||||
|
if (g_config.caps_override_bl) {
|
||||||
|
RGB_MATRIX_INDICATOR_SET_COLOR(g_config.caps_lock_key, 0, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// num lock cyan
|
||||||
|
if (g_config.enable_num_lock) {
|
||||||
|
RGB rgb_num = hsv_to_rgb( (HSV){ .h = g_config.num_lock_indicator.h,
|
||||||
|
.s = g_config.num_lock_indicator.s,
|
||||||
|
.v = g_config.num_lock_indicator.v } );
|
||||||
|
if (host_keyboard_led_state().num_lock) {
|
||||||
|
RGB_MATRIX_INDICATOR_SET_COLOR(g_config.num_lock_key, rgb_num.r, rgb_num.g, rgb_num.b);
|
||||||
|
} else {
|
||||||
|
if (g_config.num_override_bl) {
|
||||||
|
RGB_MATRIX_INDICATOR_SET_COLOR(g_config.num_lock_key, 0, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// scroll lock cyan
|
||||||
|
if (g_config.enable_scroll_lock) {
|
||||||
|
RGB rgb_scroll = hsv_to_rgb( (HSV){ .h = g_config.scroll_lock_indicator.h,
|
||||||
|
.s = g_config.scroll_lock_indicator.s,
|
||||||
|
.v = g_config.scroll_lock_indicator.v } );
|
||||||
|
if (host_keyboard_led_state().scroll_lock) {
|
||||||
|
RGB_MATRIX_INDICATOR_SET_COLOR(g_config.scroll_lock_key, rgb_scroll.r, rgb_scroll.g, rgb_scroll.b);
|
||||||
|
} else {
|
||||||
|
if (g_config.scroll_override_bl) {
|
||||||
|
RGB_MATRIX_INDICATOR_SET_COLOR(g_config.scroll_lock_key, 0, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// layer state
|
||||||
|
if (g_config.enable_layer_indicator) {
|
||||||
|
RGB rgb_layer = hsv_to_rgb( (HSV){ .h = g_config.layer_indicator.h,
|
||||||
|
.s = g_config.layer_indicator.s,
|
||||||
|
.v = g_config.layer_indicator.v } );
|
||||||
|
switch (get_highest_layer(layer_state)) {
|
||||||
|
case 0:
|
||||||
|
if (g_config.layer_override_bl) {
|
||||||
|
RGB_MATRIX_INDICATOR_SET_COLOR(g_config.layer_indicator_key, 0, 0, 0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
RGB_MATRIX_INDICATOR_SET_COLOR(g_config.layer_indicator_key, rgb_layer.r, rgb_layer.g, rgb_layer.b);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// white
|
||||||
|
RGB_MATRIX_INDICATOR_SET_COLOR(24, 128, 128, 128);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright 2021 Harrison Chan (Xelus)
|
/* Copyright 2023 Harrison Chan (Xelus)
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -17,6 +17,60 @@
|
|||||||
|
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#ifdef VIA_ENABLE
|
||||||
|
// custom ID codes
|
||||||
|
enum via_indicator_value {
|
||||||
|
id_caps_lock_enable = 1,
|
||||||
|
id_caps_lock_brightness,
|
||||||
|
id_caps_lock_color,
|
||||||
|
id_caps_lock_key,
|
||||||
|
id_caps_lock_override,
|
||||||
|
id_num_lock_enable,
|
||||||
|
id_num_lock_brightness,
|
||||||
|
id_num_lock_color,
|
||||||
|
id_num_lock_key,
|
||||||
|
id_num_lock_override,
|
||||||
|
id_scroll_lock_enable,
|
||||||
|
id_scroll_lock_brightness,
|
||||||
|
id_scroll_lock_color,
|
||||||
|
id_scroll_lock_key,
|
||||||
|
id_scroll_lock_override,
|
||||||
|
id_layer_indicator_enable,
|
||||||
|
id_layer_indicator_brightness,
|
||||||
|
id_layer_indicator_color,
|
||||||
|
id_layer_indicator_key,
|
||||||
|
id_layer_indicator_override
|
||||||
|
};
|
||||||
|
|
||||||
|
// struct to save things
|
||||||
|
typedef struct {
|
||||||
|
bool enable_caps_lock:1; // |
|
||||||
|
bool enable_num_lock:1; // |
|
||||||
|
bool enable_scroll_lock:1; // |
|
||||||
|
bool enable_layer_indicator:1; // |
|
||||||
|
bool caps_override_bl:1; // |
|
||||||
|
bool num_override_bl:1; // |
|
||||||
|
bool scroll_override_bl:1; // |
|
||||||
|
bool layer_override_bl:1; // 1 byte
|
||||||
|
HSV caps_lock_indicator; // 3 bytes
|
||||||
|
HSV num_lock_indicator; // 3 bytes
|
||||||
|
HSV scroll_lock_indicator; // 3 bytes
|
||||||
|
HSV layer_indicator; // 3 bytes
|
||||||
|
uint8_t caps_lock_key; // 1 byte
|
||||||
|
uint8_t num_lock_key; // 1 byte
|
||||||
|
uint8_t scroll_lock_key; // 1 byte
|
||||||
|
uint8_t layer_indicator_key;// 1 byte
|
||||||
|
} indicator_settings_config;
|
||||||
|
// total 17 bytes
|
||||||
|
|
||||||
|
// function declaration
|
||||||
|
void indicator_config_set_value( uint8_t *data );
|
||||||
|
void indicator_config_get_value( uint8_t *data );
|
||||||
|
void indicator_config_save ( void );
|
||||||
|
void _set_color(HSV *color, uint8_t *data);
|
||||||
|
void _get_color(HSV *color, uint8_t *data);
|
||||||
|
#endif
|
||||||
|
|
||||||
#define _____ KC_NO
|
#define _____ KC_NO
|
||||||
|
|
||||||
#define LAYOUT_tkl_ansi_tsangan( \
|
#define LAYOUT_tkl_ansi_tsangan( \
|
||||||
|
@ -45,7 +45,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
backlight_level(6);
|
backlight_level(6);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_MOD(keycode)) {
|
if (IS_MODIFIER_KEYCODE(keycode)) {
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
rgblight_setrgb(RGB_RED);
|
rgblight_setrgb(RGB_RED);
|
||||||
} else {
|
} else {
|
||||||
|
@ -25,17 +25,17 @@ def _gen_led_config(info_data):
|
|||||||
if not config_type:
|
if not config_type:
|
||||||
return lines
|
return lines
|
||||||
|
|
||||||
matrix = [['NO_LED'] * cols for i in range(rows)]
|
matrix = [['NO_LED'] * cols for _ in range(rows)]
|
||||||
pos = []
|
pos = []
|
||||||
flags = []
|
flags = []
|
||||||
|
|
||||||
led_config = info_data[config_type]['layout']
|
led_layout = info_data[config_type]['layout']
|
||||||
for index, item in enumerate(led_config, start=0):
|
for index, led_data in enumerate(led_layout):
|
||||||
if 'matrix' in item:
|
if 'matrix' in led_data:
|
||||||
(x, y) = item['matrix']
|
row, col = led_data['matrix']
|
||||||
matrix[x][y] = str(index)
|
matrix[row][col] = str(index)
|
||||||
pos.append(f'{{ {item.get("x", 0)},{item.get("y", 0)} }}')
|
pos.append(f'{{{led_data.get("x", 0)}, {led_data.get("y", 0)}}}')
|
||||||
flags.append(str(item.get('flags', 0)))
|
flags.append(str(led_data.get('flags', 0)))
|
||||||
|
|
||||||
if config_type == 'rgb_matrix':
|
if config_type == 'rgb_matrix':
|
||||||
lines.append('#ifdef RGB_MATRIX_ENABLE')
|
lines.append('#ifdef RGB_MATRIX_ENABLE')
|
||||||
@ -47,10 +47,10 @@ def _gen_led_config(info_data):
|
|||||||
lines.append('__attribute__ ((weak)) led_config_t g_led_config = {')
|
lines.append('__attribute__ ((weak)) led_config_t g_led_config = {')
|
||||||
lines.append(' {')
|
lines.append(' {')
|
||||||
for line in matrix:
|
for line in matrix:
|
||||||
lines.append(f' {{ {",".join(line)} }},')
|
lines.append(f' {{ {", ".join(line)} }},')
|
||||||
lines.append(' },')
|
lines.append(' },')
|
||||||
lines.append(f' {{ {",".join(pos)} }},')
|
lines.append(f' {{ {", ".join(pos)} }},')
|
||||||
lines.append(f' {{ {",".join(flags)} }},')
|
lines.append(f' {{ {", ".join(flags)} }},')
|
||||||
lines.append('};')
|
lines.append('};')
|
||||||
lines.append('#endif')
|
lines.append('#endif')
|
||||||
|
|
||||||
|
@ -25,32 +25,31 @@ def _generate_layouts(keyboard):
|
|||||||
row_num = kb_info_json['matrix_size']['rows']
|
row_num = kb_info_json['matrix_size']['rows']
|
||||||
|
|
||||||
lines = []
|
lines = []
|
||||||
for layout_name in kb_info_json['layouts']:
|
for layout_name, layout_data in kb_info_json['layouts'].items():
|
||||||
if kb_info_json['layouts'][layout_name]['c_macro']:
|
if layout_data['c_macro']:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if 'matrix' not in kb_info_json['layouts'][layout_name]['layout'][0]:
|
if not all('matrix' in key_data for key_data in layout_data['layout']):
|
||||||
cli.log.debug(f'{keyboard}/{layout_name}: No matrix data!')
|
cli.log.debug(f'{keyboard}/{layout_name}: No or incomplete matrix data!')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
layout_keys = []
|
layout_keys = []
|
||||||
layout_matrix = [['KC_NO' for i in range(col_num)] for i in range(row_num)]
|
layout_matrix = [['KC_NO'] * col_num for _ in range(row_num)]
|
||||||
|
|
||||||
for i, key in enumerate(kb_info_json['layouts'][layout_name]['layout']):
|
for index, key_data in enumerate(layout_data['layout']):
|
||||||
row = key['matrix'][0]
|
row, col = key_data['matrix']
|
||||||
col = key['matrix'][1]
|
identifier = f'k{ROW_LETTERS[row]}{COL_LETTERS[col]}'
|
||||||
identifier = 'k%s%s' % (ROW_LETTERS[row], COL_LETTERS[col])
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
layout_matrix[row][col] = identifier
|
layout_matrix[row][col] = identifier
|
||||||
layout_keys.append(identifier)
|
layout_keys.append(identifier)
|
||||||
except IndexError:
|
except IndexError:
|
||||||
key_name = key.get('label', identifier)
|
key_name = key_data.get('label', identifier)
|
||||||
cli.log.error(f'Matrix data out of bounds for layout {layout_name} at index {i} ({key_name}): [{row}, {col}]')
|
cli.log.error(f'{keyboard}/{layout_name}: Matrix data out of bounds at index {index} ({key_name}): [{row}, {col}]')
|
||||||
return []
|
return []
|
||||||
|
|
||||||
lines.append('')
|
lines.append('')
|
||||||
lines.append('#define %s(%s) {\\' % (layout_name, ', '.join(layout_keys)))
|
lines.append(f'#define {layout_name}({", ".join(layout_keys)}) {{ \\')
|
||||||
|
|
||||||
rows = ', \\\n'.join(['\t {' + ', '.join(row) + '}' for row in layout_matrix])
|
rows = ', \\\n'.join(['\t {' + ', '.join(row) + '}' for row in layout_matrix])
|
||||||
rows += ' \\'
|
rows += ' \\'
|
||||||
|
@ -8,6 +8,14 @@ from qmk.path import normpath
|
|||||||
from qmk.keycodes import load_spec
|
from qmk.keycodes import load_spec
|
||||||
|
|
||||||
|
|
||||||
|
def _translate_group(group):
|
||||||
|
"""Fix up any issues with badly chosen values
|
||||||
|
"""
|
||||||
|
if group == 'modifiers':
|
||||||
|
return 'modifier'
|
||||||
|
return group
|
||||||
|
|
||||||
|
|
||||||
def _render_key(key):
|
def _render_key(key):
|
||||||
width = 7
|
width = 7
|
||||||
if 'S(' in key:
|
if 'S(' in key:
|
||||||
@ -82,7 +90,7 @@ def _generate_helpers(lines, keycodes):
|
|||||||
for group, codes in temp.items():
|
for group, codes in temp.items():
|
||||||
lo = keycodes["keycodes"][f'0x{codes[0]:04X}']['key']
|
lo = keycodes["keycodes"][f'0x{codes[0]:04X}']['key']
|
||||||
hi = keycodes["keycodes"][f'0x{codes[1]:04X}']['key']
|
hi = keycodes["keycodes"][f'0x{codes[1]:04X}']['key']
|
||||||
lines.append(f'#define IS_{ group.upper() }_KEYCODE(code) ((code) >= {lo} && (code) <= {hi})')
|
lines.append(f'#define IS_{ _translate_group(group).upper() }_KEYCODE(code) ((code) >= {lo} && (code) <= {hi})')
|
||||||
|
|
||||||
|
|
||||||
def _generate_aliases(lines, keycodes):
|
def _generate_aliases(lines, keycodes):
|
||||||
|
@ -351,7 +351,7 @@ void process_action(keyrecord_t *record, action_t action) {
|
|||||||
bool do_release_oneshot = false;
|
bool do_release_oneshot = false;
|
||||||
// notice we only clear the one shot layer if the pressed key is not a modifier.
|
// notice we only clear the one shot layer if the pressed key is not a modifier.
|
||||||
if (is_oneshot_layer_active() && event.pressed &&
|
if (is_oneshot_layer_active() && event.pressed &&
|
||||||
(action.kind.id == ACT_USAGE || !(IS_MOD(action.key.code)
|
(action.kind.id == ACT_USAGE || !(IS_MODIFIER_KEYCODE(action.key.code)
|
||||||
# ifndef NO_ACTION_TAPPING
|
# ifndef NO_ACTION_TAPPING
|
||||||
|| (tap_count == 0 && (action.kind.id == ACT_LMODS_TAP || action.kind.id == ACT_RMODS_TAP))
|
|| (tap_count == 0 && (action.kind.id == ACT_LMODS_TAP || action.kind.id == ACT_RMODS_TAP))
|
||||||
# endif
|
# endif
|
||||||
@ -372,7 +372,7 @@ void process_action(keyrecord_t *record, action_t action) {
|
|||||||
uint8_t mods = (action.kind.id == ACT_LMODS) ? action.key.mods : action.key.mods << 4;
|
uint8_t mods = (action.kind.id == ACT_LMODS) ? action.key.mods : action.key.mods << 4;
|
||||||
if (event.pressed) {
|
if (event.pressed) {
|
||||||
if (mods) {
|
if (mods) {
|
||||||
if (IS_MOD(action.key.code) || action.key.code == KC_NO) {
|
if (IS_MODIFIER_KEYCODE(action.key.code) || action.key.code == KC_NO) {
|
||||||
// e.g. LSFT(KC_LEFT_GUI): we don't want the LSFT to be weak as it would make it useless.
|
// e.g. LSFT(KC_LEFT_GUI): we don't want the LSFT to be weak as it would make it useless.
|
||||||
// This also makes LSFT(KC_LEFT_GUI) behave exactly the same as LGUI(KC_LEFT_SHIFT).
|
// This also makes LSFT(KC_LEFT_GUI) behave exactly the same as LGUI(KC_LEFT_SHIFT).
|
||||||
// Same applies for some keys like KC_MEH which are declared as MEH(KC_NO).
|
// Same applies for some keys like KC_MEH which are declared as MEH(KC_NO).
|
||||||
@ -386,7 +386,7 @@ void process_action(keyrecord_t *record, action_t action) {
|
|||||||
} else {
|
} else {
|
||||||
unregister_code(action.key.code);
|
unregister_code(action.key.code);
|
||||||
if (mods) {
|
if (mods) {
|
||||||
if (IS_MOD(action.key.code) || action.key.code == KC_NO) {
|
if (IS_MODIFIER_KEYCODE(action.key.code) || action.key.code == KC_NO) {
|
||||||
del_mods(mods);
|
del_mods(mods);
|
||||||
} else {
|
} else {
|
||||||
del_weak_mods(mods);
|
del_weak_mods(mods);
|
||||||
@ -406,7 +406,7 @@ void process_action(keyrecord_t *record, action_t action) {
|
|||||||
if (!keymap_config.oneshot_enable) {
|
if (!keymap_config.oneshot_enable) {
|
||||||
if (event.pressed) {
|
if (event.pressed) {
|
||||||
if (mods) {
|
if (mods) {
|
||||||
if (IS_MOD(action.key.code) || action.key.code == KC_NO) {
|
if (IS_MODIFIER_KEYCODE(action.key.code) || action.key.code == KC_NO) {
|
||||||
// e.g. LSFT(KC_LGUI): we don't want the LSFT to be weak as it would make it useless.
|
// e.g. LSFT(KC_LGUI): we don't want the LSFT to be weak as it would make it useless.
|
||||||
// This also makes LSFT(KC_LGUI) behave exactly the same as LGUI(KC_LSFT).
|
// This also makes LSFT(KC_LGUI) behave exactly the same as LGUI(KC_LSFT).
|
||||||
// Same applies for some keys like KC_MEH which are declared as MEH(KC_NO).
|
// Same applies for some keys like KC_MEH which are declared as MEH(KC_NO).
|
||||||
@ -420,7 +420,7 @@ void process_action(keyrecord_t *record, action_t action) {
|
|||||||
} else {
|
} else {
|
||||||
unregister_code(action.key.code);
|
unregister_code(action.key.code);
|
||||||
if (mods) {
|
if (mods) {
|
||||||
if (IS_MOD(action.key.code) || action.key.code == KC_NO) {
|
if (IS_MODIFIER_KEYCODE(action.key.code) || action.key.code == KC_NO) {
|
||||||
del_mods(mods);
|
del_mods(mods);
|
||||||
} else {
|
} else {
|
||||||
del_weak_mods(mods);
|
del_weak_mods(mods);
|
||||||
@ -877,7 +877,7 @@ __attribute__((weak)) void register_code(uint8_t code) {
|
|||||||
send_keyboard_report();
|
send_keyboard_report();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} else if IS_KEY (code) {
|
} else if IS_BASIC_KEYCODE (code) {
|
||||||
// TODO: should push command_proc out of this block?
|
// TODO: should push command_proc out of this block?
|
||||||
if (command_proc(code)) return;
|
if (command_proc(code)) return;
|
||||||
|
|
||||||
@ -890,7 +890,7 @@ __attribute__((weak)) void register_code(uint8_t code) {
|
|||||||
}
|
}
|
||||||
add_key(code);
|
add_key(code);
|
||||||
send_keyboard_report();
|
send_keyboard_report();
|
||||||
} else if IS_MOD (code) {
|
} else if IS_MODIFIER_KEYCODE (code) {
|
||||||
add_mods(MOD_BIT(code));
|
add_mods(MOD_BIT(code));
|
||||||
send_keyboard_report();
|
send_keyboard_report();
|
||||||
|
|
||||||
@ -944,10 +944,10 @@ __attribute__((weak)) void unregister_code(uint8_t code) {
|
|||||||
send_keyboard_report();
|
send_keyboard_report();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} else if IS_KEY (code) {
|
} else if IS_BASIC_KEYCODE (code) {
|
||||||
del_key(code);
|
del_key(code);
|
||||||
send_keyboard_report();
|
send_keyboard_report();
|
||||||
} else if IS_MOD (code) {
|
} else if IS_MODIFIER_KEYCODE (code) {
|
||||||
del_mods(MOD_BIT(code));
|
del_mods(MOD_BIT(code));
|
||||||
send_keyboard_report();
|
send_keyboard_report();
|
||||||
|
|
||||||
|
@ -247,12 +247,12 @@ bool process_tapping(keyrecord_t *keyp) {
|
|||||||
case ACT_LMODS:
|
case ACT_LMODS:
|
||||||
case ACT_RMODS:
|
case ACT_RMODS:
|
||||||
if (action.key.mods && !action.key.code) return false;
|
if (action.key.mods && !action.key.code) return false;
|
||||||
if (IS_MOD(action.key.code)) return false;
|
if (IS_MODIFIER_KEYCODE(action.key.code)) return false;
|
||||||
break;
|
break;
|
||||||
case ACT_LMODS_TAP:
|
case ACT_LMODS_TAP:
|
||||||
case ACT_RMODS_TAP:
|
case ACT_RMODS_TAP:
|
||||||
if (action.key.mods && keyp->tap.count == 0) return false;
|
if (action.key.mods && keyp->tap.count == 0) return false;
|
||||||
if (IS_MOD(action.key.code)) return false;
|
if (IS_MODIFIER_KEYCODE(action.key.code)) return false;
|
||||||
break;
|
break;
|
||||||
case ACT_LAYER_TAP:
|
case ACT_LAYER_TAP:
|
||||||
case ACT_LAYER_TAP_EXT:
|
case ACT_LAYER_TAP_EXT:
|
||||||
|
@ -27,8 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
/* FIXME: Add doxygen comments here */
|
/* FIXME: Add doxygen comments here */
|
||||||
|
|
||||||
#define IS_ANY(code) (KC_A <= (code) && (code) <= 0xFF)
|
#define IS_ANY(code) (KC_A <= (code) && (code) <= 0xFF)
|
||||||
#define IS_KEY(code) IS_BASIC_KEYCODE(code)
|
|
||||||
#define IS_MOD(code) IS_MODIFIERS_KEYCODE(code)
|
|
||||||
|
|
||||||
#define IS_SYSTEM(code) IS_SYSTEM_KEYCODE(code)
|
#define IS_SYSTEM(code) IS_SYSTEM_KEYCODE(code)
|
||||||
#define IS_CONSUMER(code) IS_MEDIA_KEYCODE(code)
|
#define IS_CONSUMER(code) IS_MEDIA_KEYCODE(code)
|
||||||
|
@ -82,6 +82,10 @@ enum qk_keycode_ranges {
|
|||||||
QK_USER_MAX = 0x7FFF,
|
QK_USER_MAX = 0x7FFF,
|
||||||
QK_UNICODE = 0x8000,
|
QK_UNICODE = 0x8000,
|
||||||
QK_UNICODE_MAX = 0xFFFF,
|
QK_UNICODE_MAX = 0xFFFF,
|
||||||
|
QK_UNICODEMAP = 0x8000,
|
||||||
|
QK_UNICODEMAP_MAX = 0xBFFF,
|
||||||
|
QK_UNICODEMAP_PAIR = 0xC000,
|
||||||
|
QK_UNICODEMAP_PAIR_MAX = 0xFFFF,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum qk_keycode_defines {
|
enum qk_keycode_defines {
|
||||||
@ -1308,6 +1312,8 @@ enum qk_keycode_defines {
|
|||||||
#define IS_QK_KB(code) ((code) >= QK_KB && (code) <= QK_KB_MAX)
|
#define IS_QK_KB(code) ((code) >= QK_KB && (code) <= QK_KB_MAX)
|
||||||
#define IS_QK_USER(code) ((code) >= QK_USER && (code) <= QK_USER_MAX)
|
#define IS_QK_USER(code) ((code) >= QK_USER && (code) <= QK_USER_MAX)
|
||||||
#define IS_QK_UNICODE(code) ((code) >= QK_UNICODE && (code) <= QK_UNICODE_MAX)
|
#define IS_QK_UNICODE(code) ((code) >= QK_UNICODE && (code) <= QK_UNICODE_MAX)
|
||||||
|
#define IS_QK_UNICODEMAP(code) ((code) >= QK_UNICODEMAP && (code) <= QK_UNICODEMAP_MAX)
|
||||||
|
#define IS_QK_UNICODEMAP_PAIR(code) ((code) >= QK_UNICODEMAP_PAIR && (code) <= QK_UNICODEMAP_PAIR_MAX)
|
||||||
|
|
||||||
// Group Helpers
|
// Group Helpers
|
||||||
#define IS_INTERNAL_KEYCODE(code) ((code) >= KC_NO && (code) <= KC_TRANSPARENT)
|
#define IS_INTERNAL_KEYCODE(code) ((code) >= KC_NO && (code) <= KC_TRANSPARENT)
|
||||||
@ -1315,7 +1321,7 @@ enum qk_keycode_defines {
|
|||||||
#define IS_SYSTEM_KEYCODE(code) ((code) >= KC_SYSTEM_POWER && (code) <= KC_SYSTEM_WAKE)
|
#define IS_SYSTEM_KEYCODE(code) ((code) >= KC_SYSTEM_POWER && (code) <= KC_SYSTEM_WAKE)
|
||||||
#define IS_MEDIA_KEYCODE(code) ((code) >= KC_AUDIO_MUTE && (code) <= KC_ASSISTANT)
|
#define IS_MEDIA_KEYCODE(code) ((code) >= KC_AUDIO_MUTE && (code) <= KC_ASSISTANT)
|
||||||
#define IS_MOUSE_KEYCODE(code) ((code) >= KC_MS_UP && (code) <= KC_MS_ACCEL2)
|
#define IS_MOUSE_KEYCODE(code) ((code) >= KC_MS_UP && (code) <= KC_MS_ACCEL2)
|
||||||
#define IS_MODIFIERS_KEYCODE(code) ((code) >= KC_LEFT_CTRL && (code) <= KC_RIGHT_GUI)
|
#define IS_MODIFIER_KEYCODE(code) ((code) >= KC_LEFT_CTRL && (code) <= KC_RIGHT_GUI)
|
||||||
#define IS_SWAP_HANDS_KEYCODE(code) ((code) >= QK_SWAP_HANDS_TOGGLE && (code) <= QK_SWAP_HANDS_ONE_SHOT)
|
#define IS_SWAP_HANDS_KEYCODE(code) ((code) >= QK_SWAP_HANDS_TOGGLE && (code) <= QK_SWAP_HANDS_ONE_SHOT)
|
||||||
#define IS_MAGIC_KEYCODE(code) ((code) >= MAGIC_SWAP_CONTROL_CAPSLOCK && (code) <= MAGIC_TOGGLE_ESCAPE_CAPSLOCK)
|
#define IS_MAGIC_KEYCODE(code) ((code) >= MAGIC_SWAP_CONTROL_CAPSLOCK && (code) <= MAGIC_TOGGLE_ESCAPE_CAPSLOCK)
|
||||||
#define IS_MIDI_KEYCODE(code) ((code) >= QK_MIDI_ON && (code) <= QK_MIDI_PITCH_BEND_UP)
|
#define IS_MIDI_KEYCODE(code) ((code) >= QK_MIDI_ON && (code) <= QK_MIDI_PITCH_BEND_UP)
|
||||||
|
@ -69,7 +69,7 @@ typedef struct {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* check if keycode is only modifiers */
|
/* check if keycode is only modifiers */
|
||||||
#define KEYCODE_IS_MOD(code) (IS_MOD(code) || (code >= QK_MODS && code <= QK_MODS_MAX && !(code & QK_BASIC_MAX)))
|
#define KEYCODE_IS_MOD(code) (IS_MODIFIER_KEYCODE(code) || (IS_QK_MODS(code) && !QK_MODS_GET_BASIC_KEYCODE(code)))
|
||||||
|
|
||||||
bool process_combo(uint16_t keycode, keyrecord_t *record);
|
bool process_combo(uint16_t keycode, keyrecord_t *record);
|
||||||
void combo_task(void);
|
void combo_task(void);
|
||||||
|
@ -402,7 +402,7 @@ bool process_key_override(const uint16_t keycode, const keyrecord_t *const recor
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
const bool key_down = record->event.pressed;
|
const bool key_down = record->event.pressed;
|
||||||
const bool is_mod = IS_MOD(keycode);
|
const bool is_mod = IS_MODIFIER_KEYCODE(keycode);
|
||||||
|
|
||||||
if (key_down) {
|
if (key_down) {
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
|
@ -89,16 +89,16 @@ void perform_space_cadet(keyrecord_t *record, uint16_t sc_keycode, uint8_t holdM
|
|||||||
#ifdef SPACE_CADET_MODIFIER_CARRYOVER
|
#ifdef SPACE_CADET_MODIFIER_CARRYOVER
|
||||||
sc_mods = get_mods();
|
sc_mods = get_mods();
|
||||||
#endif
|
#endif
|
||||||
if (IS_MOD(holdMod)) {
|
if (IS_MODIFIER_KEYCODE(holdMod)) {
|
||||||
register_mods(MOD_BIT(holdMod));
|
register_mods(MOD_BIT(holdMod));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (sc_last == holdMod && timer_elapsed(sc_timer) < GET_TAPPING_TERM(sc_keycode, record)) {
|
if (sc_last == holdMod && timer_elapsed(sc_timer) < GET_TAPPING_TERM(sc_keycode, record)) {
|
||||||
if (holdMod != tapMod) {
|
if (holdMod != tapMod) {
|
||||||
if (IS_MOD(holdMod)) {
|
if (IS_MODIFIER_KEYCODE(holdMod)) {
|
||||||
unregister_mods(MOD_BIT(holdMod));
|
unregister_mods(MOD_BIT(holdMod));
|
||||||
}
|
}
|
||||||
if (IS_MOD(tapMod)) {
|
if (IS_MODIFIER_KEYCODE(tapMod)) {
|
||||||
register_mods(MOD_BIT(tapMod));
|
register_mods(MOD_BIT(tapMod));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -109,11 +109,11 @@ void perform_space_cadet(keyrecord_t *record, uint16_t sc_keycode, uint8_t holdM
|
|||||||
#ifdef SPACE_CADET_MODIFIER_CARRYOVER
|
#ifdef SPACE_CADET_MODIFIER_CARRYOVER
|
||||||
clear_weak_mods();
|
clear_weak_mods();
|
||||||
#endif
|
#endif
|
||||||
if (IS_MOD(tapMod)) {
|
if (IS_MODIFIER_KEYCODE(tapMod)) {
|
||||||
unregister_mods(MOD_BIT(tapMod));
|
unregister_mods(MOD_BIT(tapMod));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (IS_MOD(holdMod)) {
|
if (IS_MODIFIER_KEYCODE(holdMod)) {
|
||||||
unregister_mods(MOD_BIT(holdMod));
|
unregister_mods(MOD_BIT(holdMod));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ void do_code16(uint16_t code, void (*f)(uint8_t)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((weak)) void register_code16(uint16_t code) {
|
__attribute__((weak)) void register_code16(uint16_t code) {
|
||||||
if (IS_MOD(code) || code == KC_NO) {
|
if (IS_MODIFIER_KEYCODE(code) || code == KC_NO) {
|
||||||
do_code16(code, register_mods);
|
do_code16(code, register_mods);
|
||||||
} else {
|
} else {
|
||||||
do_code16(code, register_weak_mods);
|
do_code16(code, register_weak_mods);
|
||||||
@ -86,7 +86,7 @@ __attribute__((weak)) void register_code16(uint16_t code) {
|
|||||||
|
|
||||||
__attribute__((weak)) void unregister_code16(uint16_t code) {
|
__attribute__((weak)) void unregister_code16(uint16_t code) {
|
||||||
unregister_code(code);
|
unregister_code(code);
|
||||||
if (IS_MOD(code) || code == KC_NO) {
|
if (IS_MODIFIER_KEYCODE(code) || code == KC_NO) {
|
||||||
do_code16(code, unregister_mods);
|
do_code16(code, unregister_mods);
|
||||||
} else {
|
} else {
|
||||||
do_code16(code, unregister_weak_mods);
|
do_code16(code, unregister_weak_mods);
|
||||||
|
@ -33,10 +33,6 @@
|
|||||||
#define QK_RSFT 0x1200
|
#define QK_RSFT 0x1200
|
||||||
#define QK_RALT 0x1400
|
#define QK_RALT 0x1400
|
||||||
#define QK_RGUI 0x1800
|
#define QK_RGUI 0x1800
|
||||||
#define QK_UNICODEMAP 0x8000
|
|
||||||
#define QK_UNICODEMAP_MAX 0xBFFF
|
|
||||||
#define QK_UNICODEMAP_PAIR 0xC000
|
|
||||||
#define QK_UNICODEMAP_PAIR_MAX 0xFFFF
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
// Generic decoding for the whole QK_MODS range
|
// Generic decoding for the whole QK_MODS range
|
||||||
|
@ -97,7 +97,7 @@ std::ostream& operator<<(std::ostream& os, const report_keyboard_t& report) {
|
|||||||
KeyboardReportMatcher::KeyboardReportMatcher(const std::vector<uint8_t>& keys) {
|
KeyboardReportMatcher::KeyboardReportMatcher(const std::vector<uint8_t>& keys) {
|
||||||
memset(m_report.raw, 0, sizeof(m_report.raw));
|
memset(m_report.raw, 0, sizeof(m_report.raw));
|
||||||
for (auto k : keys) {
|
for (auto k : keys) {
|
||||||
if (IS_MOD(k)) {
|
if (IS_MODIFIER_KEYCODE(k)) {
|
||||||
m_report.mods |= MOD_BIT(k);
|
m_report.mods |= MOD_BIT(k);
|
||||||
} else {
|
} else {
|
||||||
add_key_to_report(&m_report, k);
|
add_key_to_report(&m_report, k);
|
||||||
|
@ -89,7 +89,7 @@ static void comma_period(uint16_t keycode) {
|
|||||||
bool process_record_vimlayer(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_vimlayer(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
|
||||||
/****** mod passthru *****/
|
/****** mod passthru *****/
|
||||||
if(record->event.pressed && layer_state_is(vim_cmd_layer()) && (IS_MOD(keycode) || keycode == LSFT(KC_LALT))) {
|
if(record->event.pressed && layer_state_is(vim_cmd_layer()) && (IS_MODIFIER_KEYCODE(keycode) || keycode == LSFT(KC_LALT))) {
|
||||||
mod_override_layer_state = layer_state;
|
mod_override_layer_state = layer_state;
|
||||||
mod_override_triggering_key = keycode;
|
mod_override_triggering_key = keycode;
|
||||||
// TODO: change this to track key location instead
|
// TODO: change this to track key location instead
|
||||||
|
@ -139,7 +139,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****** mod passthru *****/
|
/****** mod passthru *****/
|
||||||
if(record->event.pressed && layer_state_is(vim_cmd_layer()) && (IS_MOD(keycode) || keycode == LSFT(KC_LALT))) {
|
if(record->event.pressed && layer_state_is(vim_cmd_layer()) && (IS_MODIFIER_KEYCODE(keycode) || keycode == LSFT(KC_LALT))) {
|
||||||
mod_override_layer_state = layer_state;
|
mod_override_layer_state = layer_state;
|
||||||
mod_override_triggering_key = keycode;
|
mod_override_triggering_key = keycode;
|
||||||
// TODO: change this to track key location instead
|
// TODO: change this to track key location instead
|
||||||
|
Loading…
Reference in New Issue
Block a user