aboutsummaryrefslogtreecommitdiff
path: root/quantum/quantum.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/quantum.c')
-rw-r--r--quantum/quantum.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 3ac0ed871..8db801f19 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -391,6 +391,29 @@ __attribute__((weak)) const uint8_t ascii_to_altgr_lut[16] PROGMEM = {
391 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), 391 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
392}; 392};
393 393
394/* Bit-Packed look-up table to convert an ASCII character to whether
395 * [Space] needs to be sent after the keycode
396 */
397__attribute__((weak)) const uint8_t ascii_to_dead_lut[16] PROGMEM = {
398 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
399 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
400 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
401 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
402
403 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
404 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
405 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
406 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
407 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
408 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
409 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
410 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
411 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
412 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
413 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
414 KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
415};
416
394/* Look-up table to convert an ASCII character to a keycode. 417/* Look-up table to convert an ASCII character to a keycode.
395 */ 418 */
396__attribute__((weak)) const uint8_t ascii_to_keycode_lut[128] PROGMEM = { 419__attribute__((weak)) const uint8_t ascii_to_keycode_lut[128] PROGMEM = {
@@ -531,6 +554,7 @@ void send_char(char ascii_code) {
531 uint8_t keycode = pgm_read_byte(&ascii_to_keycode_lut[(uint8_t)ascii_code]); 554 uint8_t keycode = pgm_read_byte(&ascii_to_keycode_lut[(uint8_t)ascii_code]);
532 bool is_shifted = PGM_LOADBIT(ascii_to_shift_lut, (uint8_t)ascii_code); 555 bool is_shifted = PGM_LOADBIT(ascii_to_shift_lut, (uint8_t)ascii_code);
533 bool is_altgred = PGM_LOADBIT(ascii_to_altgr_lut, (uint8_t)ascii_code); 556 bool is_altgred = PGM_LOADBIT(ascii_to_altgr_lut, (uint8_t)ascii_code);
557 bool is_dead = PGM_LOADBIT(ascii_to_dead_lut, (uint8_t)ascii_code);
534 558
535 if (is_shifted) { 559 if (is_shifted) {
536 register_code(KC_LSFT); 560 register_code(KC_LSFT);
@@ -545,6 +569,9 @@ void send_char(char ascii_code) {
545 if (is_shifted) { 569 if (is_shifted) {
546 unregister_code(KC_LSFT); 570 unregister_code(KC_LSFT);
547 } 571 }
572 if (is_dead) {
573 tap_code(KC_SPACE);
574 }
548} 575}
549 576
550void set_single_persistent_default_layer(uint8_t default_layer) { 577void set_single_persistent_default_layer(uint8_t default_layer) {