2023-12-31 10:28:51 -08:00
|
|
|
|
#include QMK_KEYBOARD_H
|
|
|
|
|
#include "version.h"
|
|
|
|
|
#include "keymap_russian.h"
|
|
|
|
|
#include "keymap_us_international.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Values that should not be saved to git.
|
|
|
|
|
// There should be a`secrets.h` in this directory
|
|
|
|
|
// with the following contents:
|
|
|
|
|
//
|
|
|
|
|
// #define SECRET_EMAIL "value"
|
|
|
|
|
// #define SECRET_GMAIL "value"
|
|
|
|
|
// #define SECRET_SCHOOL_EMAIL "value"
|
|
|
|
|
#include "secrets.h"
|
|
|
|
|
|
|
|
|
|
// Macro keycodes
|
|
|
|
|
enum custom_keycodes {
|
|
|
|
|
M_SHUTDOWN = BETA_SAFE_RANGE,
|
|
|
|
|
|
|
|
|
|
// Macros
|
|
|
|
|
M_RESETWM,
|
|
|
|
|
M_RU_CTRL,
|
|
|
|
|
M_RU_ALT,
|
|
|
|
|
M_GUI,
|
|
|
|
|
|
|
|
|
|
// Special characters.
|
|
|
|
|
// M_SPECIAL_TOP and M_SPECIAL_BOTTOM are
|
|
|
|
|
// bounds used to parse these. Only special
|
|
|
|
|
// characters should be between them.
|
|
|
|
|
//
|
|
|
|
|
// Сharacters here should be in the same
|
|
|
|
|
// order as they are in the host inteface.
|
|
|
|
|
M_SPECIAL_TOP,
|
|
|
|
|
M_SC_GRAVE,
|
|
|
|
|
M_SC_TILD,
|
|
|
|
|
M_SC_QUOT,
|
|
|
|
|
M_SC_LBR,
|
|
|
|
|
M_SC_RBR,
|
|
|
|
|
M_SC_LCBR,
|
|
|
|
|
M_SC_RCBR,
|
|
|
|
|
M_SC_LKVCH,
|
|
|
|
|
M_SC_RKVCH,
|
|
|
|
|
M_SPECIAL_BOTTOM
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// LED colors
|
|
|
|
|
#define LC_OFF { 0, 0, 0}
|
|
|
|
|
#define LC_GRN { 85, 203, 158}
|
|
|
|
|
#define LC_YLW { 32, 176, 255}
|
|
|
|
|
#define LC_PNK {243, 222, 234}
|
|
|
|
|
#define LC_CYN {134, 255, 213}
|
|
|
|
|
#define LC_ORN { 14, 255, 255}
|
|
|
|
|
#define LC_WHT { 0, 0, 150}
|
|
|
|
|
#define LC_RED { 0, 255, 145}
|
|
|
|
|
#define LC_BLU {153, 255, 153}
|
|
|
|
|
|
2024-01-29 11:34:03 -08:00
|
|
|
|
#define LC_RUB { 0, 0, 165}
|
|
|
|
|
#define LC_RUG {153, 255, 153}
|
|
|
|
|
#define LC_RUK { 0, 255, 145}
|
|
|
|
|
|
|
|
|
|
|
2023-12-31 10:28:51 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_HID_SPELLCHECK
|
|
|
|
|
#include "features/hid_spellcheck.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_AUTOCORRECT
|
|
|
|
|
#include "features/autocorrect/autocorrect.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_BETA_LEADER
|
|
|
|
|
#include "features/leader/beta_leader.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
//#include "features/beta_rawhid.h"
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
// Send a special character.
|
|
|
|
|
// Returns false if character was caught, true otherwise.
|
|
|
|
|
bool send_special_character(uint16_t keycode) {
|
|
|
|
|
if ( (keycode > M_SPECIAL_TOP) && (keycode < M_SPECIAL_BOTTOM) ) {
|
|
|
|
|
hid_send_special_char(keycode - M_SPECIAL_TOP - 1);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
const uint16_t PROGMEM test_combo2[] = {KC_D, KC_F, COMBO_END};
|
|
|
|
|
const uint16_t PROGMEM test_combo3[] = {KC_M, KC_P, COMBO_END};
|
2024-01-29 11:34:03 -08:00
|
|
|
|
const uint16_t PROGMEM test_combo4[] = {RU_ER, RU_TE, COMBO_END};
|
|
|
|
|
const uint16_t PROGMEM test_combo5[] = {RU_EF, RU_GHE, COMBO_END};
|
2023-12-31 10:28:51 -08:00
|
|
|
|
combo_t key_combos[] = {
|
|
|
|
|
COMBO(test_combo2, KC_TAB),
|
|
|
|
|
COMBO(test_combo3, KC_RIGHT),
|
2024-01-29 11:34:03 -08:00
|
|
|
|
COMBO(test_combo4, RU_YO),
|
|
|
|
|
COMBO(test_combo5, RU_E),
|
2023-12-31 10:28:51 -08:00
|
|
|
|
};
|
|
|
|
|
|
2024-01-29 11:34:03 -08:00
|
|
|
|
|
2023-12-31 10:28:51 -08:00
|
|
|
|
void matrix_scan_user(void) {
|
|
|
|
|
#ifdef ENABLE_BETA_LEADER
|
|
|
|
|
beta_qk_leader_check();
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-15 10:40:12 -08:00
|
|
|
|
// Must be done early, layers need this enum
|
|
|
|
|
enum tap_dance_codes {
|
|
|
|
|
TD_WMLAYOUT,
|
|
|
|
|
TD_SCREENSHOT,
|
|
|
|
|
TD_ESCAPE,
|
|
|
|
|
};
|
2023-12-31 10:28:51 -08:00
|
|
|
|
|
|
|
|
|
// Include all other parts of configuration
|
|
|
|
|
#include "layers/layers.c"
|
|
|
|
|
#include "parts/leader.c"
|
2024-01-15 10:40:12 -08:00
|
|
|
|
#include "parts/tapdance.c"
|
2023-12-31 10:28:51 -08:00
|
|
|
|
|
2024-01-29 11:34:03 -08:00
|
|
|
|
bool combo_should_trigger(uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record) {
|
|
|
|
|
/* Disable combo `SOME_COMBO` on layer `_LAYER_A` */
|
|
|
|
|
if (
|
|
|
|
|
combo_index == 0 ||
|
|
|
|
|
combo_index == 1
|
|
|
|
|
) {
|
|
|
|
|
if (layer_state_is(LAYER_RUSSIAN)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
} else if (
|
|
|
|
|
combo_index == 2 ||
|
|
|
|
|
combo_index == 3
|
|
|
|
|
) {
|
|
|
|
|
if (!layer_state_is(LAYER_RUSSIAN)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-31 10:28:51 -08:00
|
|
|
|
// Process macros.
|
|
|
|
|
// Return FALSE to halt key processing,
|
|
|
|
|
// Return TRUE to allow QMK to handle keypress.
|
|
|
|
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_BETA_LEADER
|
|
|
|
|
if (!beta_process_leader(keycode, record)) { return false; }
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_HID_SPELLCHECK
|
|
|
|
|
if (!process_spellcheck(keycode, record)) { return false; }
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_AUTOCORRECT
|
|
|
|
|
if (!process_autocorrection(keycode, record)) { return false; }
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// Handle special chars
|
|
|
|
|
//if (record->event.pressed) {
|
|
|
|
|
// if (!send_special_character(keycode)) { return false; }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
// Handle macros
|
|
|
|
|
switch (keycode) {
|
|
|
|
|
case M_RESETWM:
|
|
|
|
|
if (record->event.pressed) {
|
|
|
|
|
SEND_STRING(SS_LCTL(SS_LGUI(SS_LSFT(SS_TAP(X_R)))));
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
// Workaround for one-shot LGUI key.
|
|
|
|
|
// Using just LGUI with LAYER_DESKTOP as OSL
|
|
|
|
|
// does not allow you to hold lgui. This does.
|
|
|
|
|
case M_GUI:
|
|
|
|
|
if (record->event.pressed) {
|
|
|
|
|
register_code16(KC_LGUI);
|
|
|
|
|
} else {
|
|
|
|
|
unregister_code16(KC_LGUI);
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
case M_SHUTDOWN:
|
|
|
|
|
if (record->event.pressed) {
|
|
|
|
|
SEND_STRING(SS_LGUI(SS_TAP(X_P)) SS_DELAY(100) SS_TAP(X_Y) SS_DELAY(100) SS_TAP(X_ENTER));
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
/*
|
|
|
|
|
case M_RU_CTRL:
|
|
|
|
|
if (record->event.pressed) {
|
|
|
|
|
layer_move(LAYER_MAIN);
|
|
|
|
|
register_code16(KC_LCTL);
|
|
|
|
|
} else {
|
|
|
|
|
unregister_code16(KC_LCTL);
|
|
|
|
|
layer_move(LAYER_RUSSIAN);
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
case M_RU_ALT:
|
|
|
|
|
if (record->event.pressed) {
|
|
|
|
|
layer_move(LAYER_MAIN);
|
|
|
|
|
register_code16(KC_LALT);
|
|
|
|
|
} else {
|
|
|
|
|
unregister_code16(KC_LALT);
|
|
|
|
|
layer_move(LAYER_RUSSIAN);
|
|
|
|
|
}
|
|
|
|
|
return false;*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|