Skip to content

Commit

Permalink
Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna authored and skullydazed committed Apr 12, 2019
1 parent e88530a commit 1d7a06a
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions quantum/quantum.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,27 +951,17 @@ void send_string_with_delay_P(const char *str, uint8_t interval) {
}

void send_char(char ascii_code) {
uint8_t keycode;
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;
}
if (pgm_read_byte(&ascii_to_alt_lut[(uint8_t)ascii_code])) {
is_alted = true;
}
uint8_t keycode = pgm_read_byte(&ascii_to_keycode_lut[(uint8_t)ascii_code]);
bool is_shifted = pgm_read_byte(&ascii_to_shift_lut[(uint8_t)ascii_code]);
bool is_alted = pgm_read_byte(&ascii_to_alt_lut[(uint8_t)ascii_code]);

if (is_shifted) {
register_code(KC_LSFT);
}
if (is_alted) {
register_code(KC_RALT);
}

tap_code(keycode);

if (is_alted) {
unregister_code(KC_RALT);
}
Expand Down

0 comments on commit 1d7a06a

Please sign in to comment.