diff options
| -rw-r--r-- | quantum/quantum.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index 7038228f7..3677424bb 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
| @@ -952,20 +952,32 @@ void send_string_with_delay_P(const char *str, uint8_t interval) { | |||
| 952 | 952 | ||
| 953 | void send_char(char ascii_code) { | 953 | void send_char(char ascii_code) { |
| 954 | uint8_t keycode; | 954 | uint8_t keycode; |
| 955 | bool is_shifted; | 955 | bool is_shifted = false; |
| 956 | bool is_alted; | 956 | bool is_alted = false; |
| 957 | 957 | ||
| 958 | keycode = pgm_read_byte(&ascii_to_keycode_lut[(uint8_t)ascii_code]); | 958 | keycode = pgm_read_byte(&ascii_to_keycode_lut[(uint8_t)ascii_code]); |
| 959 | if (pgm_read_byte(&ascii_to_shift_lut[(uint8_t)ascii_code])) { is_shifted = true; } else { is_shifted = false; } | 959 | if (pgm_read_byte(&ascii_to_shift_lut[(uint8_t)ascii_code])) { |
| 960 | if (pgm_read_byte(&ascii_to_alt_lut[(uint8_t)ascii_code])) { is_alted = true; } else { is_alted = false; } | 960 | is_shifted = true; |
| 961 | } | ||
| 962 | if (pgm_read_byte(&ascii_to_alt_lut[(uint8_t)ascii_code])) { | ||
| 963 | is_alted = true; | ||
| 964 | } | ||
| 961 | 965 | ||
| 962 | if (is_shifted) { register_code(KC_LSFT); } | 966 | if (is_shifted) { |
| 963 | if (is_alted) { register_code(KC_RALT); } | 967 | register_code(KC_LSFT); |
| 968 | } | ||
| 969 | if (is_alted) { | ||
| 970 | register_code(KC_RALT); | ||
| 971 | } | ||
| 964 | 972 | ||
| 965 | tap_code(keycode); | 973 | tap_code(keycode); |
| 966 | 974 | ||
| 967 | if (is_alted) { unregister_code(KC_RALT); } | 975 | if (is_alted) { |
| 968 | if (is_shifted) { unregister_code(KC_LSFT); } | 976 | unregister_code(KC_RALT); |
| 977 | } | ||
| 978 | if (is_shifted) { | ||
| 979 | unregister_code(KC_LSFT); | ||
| 980 | } | ||
| 969 | } | 981 | } |
| 970 | 982 | ||
| 971 | void set_single_persistent_default_layer(uint8_t default_layer) { | 983 | void set_single_persistent_default_layer(uint8_t default_layer) { |
