Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Keymap] crkbd toinux update #19673

Merged
merged 12 commits into from
Mar 18, 2023
2 changes: 2 additions & 0 deletions keyboards/crkbd/keymaps/toinux/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// #define SPLIT_LED_STATE_ENABLE

#define LAYER_STATE_16BIT

#define IGNORE_MOD_TAP_INTERRUPT_PER_KEY
toinux marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions keyboards/crkbd/keymaps/toinux/keycodes.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2022 toinux
/* Copyright 2022 @toinux
*
* 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
Expand Down Expand Up @@ -41,7 +41,7 @@ enum crkbd_layers {
#define TABLGUI LGUI_T(KC_TAB)
#define BASE DF(_BASE)
#define GAMING DF(_GAMING)
#define GAMING2 MO(_GAMING2)
#define GAMING2 LT(_GAMING2,KC_ESC)

#define SC_F1 LSFT(LCTL(KC_F1))
#define SC_F2 LSFT(LCTL(KC_F2))
Expand Down
21 changes: 17 additions & 4 deletions keyboards/crkbd/keymaps/toinux/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

// Gaming
// ,-----------------------------------------------------. ,-----------------------------------------------------.
// | Esc | Q | W | E | R | T | | Y | U | I | O | P | Bksp |
// | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp |
// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
// | Ctrl | A | S | D | F | G | | H | J | K | L | ;/Mous | ' |
// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
// | Shift | Z | X | C | V | B | | N | M | , | . | / | SftEnT |
// `--------+--------+--------+--------+--------+--------+--------. .--------+--------+--------+--------+--------+--------+--------'
// | LALT |GAMING2 | Space | | Spc/NAV| RAISE |ACCENTS |
// | LALT |GM2/Esc | Space | | Spc/NAV| RAISE |ACCENTS |
// `--------------------------' `--------------------------'
[_GAMING] = LAYOUT_split_3x6_3(
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, MOSCLN, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFTENT,
KC_LALT, GAMING2, KC_SPC, SPCNAV, RAISE, ACCENTS
Expand Down Expand Up @@ -212,7 +212,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// | | | | | | | |
// `--------------------------' `--------------------------'
[_ADJUST] = LAYOUT_split_3x6_3(
QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, KC_NUM, KC_CAPS, KC_SCRL, XXXXXXX, XXXXXXX, XXXXXXX,
QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, KC_NUM, KC_CAPS, KC_SCRL, XXXXXXX, XXXXXXX, XXXXXXX,
RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, _______, _______, _______, _______, _______
Expand All @@ -223,6 +223,19 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
}

bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QUORCTL:
// Do not force the mod-tap key press to be handled as a modifier
// if any other key was pressed while the mod-tap key is held down.
return true;
default:
// Force the mod-tap key press to be handled as a modifier if any
// other key was pressed while the mod-tap key is held down.
return false;
}
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {

#ifdef OLED_ENABLE
Expand Down
7 changes: 5 additions & 2 deletions keyboards/crkbd/keymaps/toinux/rgb.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ static const char gaming2_leds[] = {23, 18, 17, 10, 9, 22, 19, 16, 11, 8};
static const char nav_leds[] = {38, 43, 44, 46};
static const char fun_leds[] = {45, 44, 37, 46, 43, 38, 47, 42, 39, 40};
static const char mouse_leds[] = {11, 16, 17, 19};
static const char adjust_leds[] = {6, 33};

bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
if (host_keyboard_led_state().caps_lock) {
Expand All @@ -32,7 +33,7 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
case _GAMING:
if (is_keyboard_master()) {
for (uint8_t i = 0; i < 4; i++) {
rgb_matrix_set_color(gaming_leds[i], RGB_RED);
rgb_matrix_set_color(gaming_leds[i], 0x88, 0x00, 0x00);
}
}
break;
Expand All @@ -54,7 +55,9 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
}
break;
case _ADJUST:
rgb_matrix_set_color(6, RGB_RED);
for (uint8_t i = 0; i < 2; i++) {
rgb_matrix_set_color(adjust_leds[i], RGB_RED);
}
break;
case _MOUSE:
if (is_keyboard_master()) {
Expand Down