diff options
author | Drashna Jaelre <drashna@live.com> | 2019-03-23 11:25:26 -0700 |
---|---|---|
committer | skullydazed <skullydazed@users.noreply.github.com> | 2019-04-12 14:07:05 -0700 |
commit | e88530af792ce68ebd4d5fd02a843837396daec9 (patch) | |
tree | c3453c2b69f2000eba62bd0f00af8893212c0656 /quantum | |
parent | 7148c0b10c298af12172231e79c0cda1c1f76f04 (diff) | |
download | firmware-e88530af792ce68ebd4d5fd02a843837396daec9.tar.gz firmware-e88530af792ce68ebd4d5fd02a843837396daec9.tar.bz2 firmware-e88530af792ce68ebd4d5fd02a843837396daec9.zip |
Make send_char multilined for readaability
So future us' will thaank us
Diffstat (limited to 'quantum')
-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) { void send_char(char ascii_code) { uint8_t keycode; - bool is_shifted; - bool is_alted; + bool is_shifted = false; + bool is_alted = false; keycode = pgm_read_byte(&ascii_to_keycode_lut[(uint8_t)ascii_code]); - if (pgm_read_byte(&ascii_to_shift_lut[(uint8_t)ascii_code])) { is_shifted = true; } else { is_shifted = false; } - if (pgm_read_byte(&ascii_to_alt_lut[(uint8_t)ascii_code])) { is_alted = true; } else { is_alted = false; } + if (pgm_read_byte(&ascii_to_shift_lut[(uint8_t)ascii_code])) { + is_shifted = true; + } + if (pgm_read_byte(&ascii_to_alt_lut[(uint8_t)ascii_code])) { + is_alted = true; + } - if (is_shifted) { register_code(KC_LSFT); } - if (is_alted) { register_code(KC_RALT); } + if (is_shifted) { + register_code(KC_LSFT); + } + if (is_alted) { + register_code(KC_RALT); + } tap_code(keycode); - if (is_alted) { unregister_code(KC_RALT); } - if (is_shifted) { unregister_code(KC_LSFT); } + if (is_alted) { + unregister_code(KC_RALT); + } + if (is_shifted) { + unregister_code(KC_LSFT); + } } void set_single_persistent_default_layer(uint8_t default_layer) { |