1
0
Fork 0

Basic keycode overhaul (#14726)

This commit is contained in:
Ryan 2021-11-04 16:22:17 +11:00 committed by GitHub
parent b06d9d822c
commit f529580860
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 1135 additions and 1081 deletions

View file

@ -46,7 +46,7 @@ static bool is_uni_seq(char *seq) {
return false;
}
}
return qk_ucis_state.codes[i] == KC_ENT || qk_ucis_state.codes[i] == KC_SPC;
return qk_ucis_state.codes[i] == KC_ENTER || qk_ucis_state.codes[i] == KC_SPACE;
}
__attribute__((weak)) void qk_ucis_symbol_fallback(void) {
@ -72,7 +72,7 @@ bool process_ucis(uint16_t keycode, keyrecord_t *record) {
return true;
}
bool special = keycode == KC_SPC || keycode == KC_ENT || keycode == KC_ESC || keycode == KC_BSPC;
bool special = keycode == KC_SPACE || keycode == KC_ENTER || keycode == KC_ESCAPE || keycode == KC_BACKSPACE;
if (qk_ucis_state.count >= UCIS_MAX_SYMBOL_LENGTH && !special) {
return false;
}
@ -81,7 +81,7 @@ bool process_ucis(uint16_t keycode, keyrecord_t *record) {
qk_ucis_state.count++;
switch (keycode) {
case KC_BSPC:
case KC_BACKSPACE:
if (qk_ucis_state.count >= 2) {
qk_ucis_state.count -= 2;
return true;
@ -90,16 +90,16 @@ bool process_ucis(uint16_t keycode, keyrecord_t *record) {
return false;
}
case KC_SPC:
case KC_ENT:
case KC_ESC:
case KC_SPACE:
case KC_ENTER:
case KC_ESCAPE:
for (uint8_t i = 0; i < qk_ucis_state.count; i++) {
register_code(KC_BSPC);
unregister_code(KC_BSPC);
register_code(KC_BACKSPACE);
unregister_code(KC_BACKSPACE);
wait_ms(UNICODE_TYPE_DELAY);
}
if (keycode == KC_ESC) {
if (keycode == KC_ESCAPE) {
qk_ucis_state.in_progress = false;
qk_ucis_cancel();
return false;