aboutsummaryrefslogtreecommitdiff
path: root/quantum/quantum.c
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2019-03-23 11:25:26 -0700
committerskullydazed <skullydazed@users.noreply.github.com>2019-04-12 14:07:05 -0700
commite88530af792ce68ebd4d5fd02a843837396daec9 (patch)
treec3453c2b69f2000eba62bd0f00af8893212c0656 /quantum/quantum.c
parent7148c0b10c298af12172231e79c0cda1c1f76f04 (diff)
downloadqmk_firmware-e88530af792ce68ebd4d5fd02a843837396daec9.tar.gz
qmk_firmware-e88530af792ce68ebd4d5fd02a843837396daec9.zip
Make send_char multilined for readaability
So future us' will thaank us
Diffstat (limited to 'quantum/quantum.c')
-rw-r--r--quantum/quantum.c28
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
953void send_char(char ascii_code) { 953void 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
971void set_single_persistent_default_layer(uint8_t default_layer) { 983void set_single_persistent_default_layer(uint8_t default_layer) {