]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Make send_char multilined for readaability
authorDrashna Jaelre <drashna@live.com>
Sat, 23 Mar 2019 18:25:26 +0000 (11:25 -0700)
committerskullydazed <skullydazed@users.noreply.github.com>
Fri, 12 Apr 2019 21:07:05 +0000 (14:07 -0700)
So future us' will thaank us

quantum/quantum.c

index 7038228f739b1b73f4d33d4b368d0563b217a020..3677424bbdd788a9e7b0d0295568e7d9cc4c635e 100644 (file)
@@ -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) {