aboutsummaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2019-04-11 15:12:26 -0700
committerskullydazed <skullydazed@users.noreply.github.com>2019-04-12 14:07:05 -0700
commit1d7a06a0a25167ff49702bab39e7e4e60dc6319f (patch)
treee7b8bca094d42e98ad6f6ed5f9642753077c058a /quantum
parente88530af792ce68ebd4d5fd02a843837396daec9 (diff)
downloadqmk_firmware-1d7a06a0a25167ff49702bab39e7e4e60dc6319f.tar.gz
qmk_firmware-1d7a06a0a25167ff49702bab39e7e4e60dc6319f.zip
Cleanup code
Diffstat (limited to 'quantum')
-rw-r--r--quantum/quantum.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 3677424bb..8ac3a57dc 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -951,17 +951,9 @@ void send_string_with_delay_P(const char *str, uint8_t interval) {
951} 951}
952 952
953void send_char(char ascii_code) { 953void send_char(char ascii_code) {
954 uint8_t keycode; 954 uint8_t keycode = pgm_read_byte(&ascii_to_keycode_lut[(uint8_t)ascii_code]);
955 bool is_shifted = false; 955 bool is_shifted = pgm_read_byte(&ascii_to_shift_lut[(uint8_t)ascii_code]);
956 bool is_alted = false; 956 bool is_alted = pgm_read_byte(&ascii_to_alt_lut[(uint8_t)ascii_code]);
957
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])) {
960 is_shifted = true;
961 }
962 if (pgm_read_byte(&ascii_to_alt_lut[(uint8_t)ascii_code])) {
963 is_alted = true;
964 }
965 957
966 if (is_shifted) { 958 if (is_shifted) {
967 register_code(KC_LSFT); 959 register_code(KC_LSFT);
@@ -969,9 +961,7 @@ void send_char(char ascii_code) {
969 if (is_alted) { 961 if (is_alted) {
970 register_code(KC_RALT); 962 register_code(KC_RALT);
971 } 963 }
972
973 tap_code(keycode); 964 tap_code(keycode);
974
975 if (is_alted) { 965 if (is_alted) {
976 unregister_code(KC_RALT); 966 unregister_code(KC_RALT);
977 } 967 }