diff options
| author | QMK Bot <hello@qmk.fm> | 2020-08-29 22:57:48 +0000 |
|---|---|---|
| committer | QMK Bot <hello@qmk.fm> | 2020-08-29 22:57:48 +0000 |
| commit | a3db72df7299140e52f57d082a3742a8b480a226 (patch) | |
| tree | 41d62db0fecd2eb0aeae1744b52e677555e55288 /quantum/process_keycode/process_auto_shift.c | |
| parent | 000eb14d789f84afc7dbd33955dbfb6481792f0b (diff) | |
| download | qmk_firmware-a3db72df7299140e52f57d082a3742a8b480a226.tar.gz qmk_firmware-a3db72df7299140e52f57d082a3742a8b480a226.zip | |
format code according to conventions [skip ci]
Diffstat (limited to 'quantum/process_keycode/process_auto_shift.c')
| -rw-r--r-- | quantum/process_keycode/process_auto_shift.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/quantum/process_keycode/process_auto_shift.c b/quantum/process_keycode/process_auto_shift.c index 330037cef..b1267922c 100644 --- a/quantum/process_keycode/process_auto_shift.c +++ b/quantum/process_keycode/process_auto_shift.c | |||
| @@ -41,34 +41,34 @@ void autoshift_flush(void) { | |||
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | void autoshift_on(uint16_t keycode) { | 43 | void autoshift_on(uint16_t keycode) { |
| 44 | autoshift_time = timer_read(); | 44 | autoshift_time = timer_read(); |
| 45 | autoshift_lastkey = keycode; | 45 | autoshift_lastkey = keycode; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | void autoshift_toggle(void) { | 48 | void autoshift_toggle(void) { |
| 49 | if (autoshift_enabled) { | 49 | if (autoshift_enabled) { |
| 50 | autoshift_enabled = false; | 50 | autoshift_enabled = false; |
| 51 | autoshift_flush(); | 51 | autoshift_flush(); |
| 52 | } else { | 52 | } else { |
| 53 | autoshift_enabled = true; | 53 | autoshift_enabled = true; |
| 54 | } | 54 | } |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | void autoshift_enable(void) { autoshift_enabled = true; } | 57 | void autoshift_enable(void) { autoshift_enabled = true; } |
| 58 | void autoshift_disable(void) { | 58 | void autoshift_disable(void) { |
| 59 | autoshift_enabled = false; | 59 | autoshift_enabled = false; |
| 60 | autoshift_flush(); | 60 | autoshift_flush(); |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | #ifndef AUTO_SHIFT_NO_SETUP | 63 | # ifndef AUTO_SHIFT_NO_SETUP |
| 64 | void autoshift_timer_report(void) { | 64 | void autoshift_timer_report(void) { |
| 65 | char display[8]; | 65 | char display[8]; |
| 66 | 66 | ||
| 67 | snprintf(display, 8, "\n%d\n", autoshift_timeout); | 67 | snprintf(display, 8, "\n%d\n", autoshift_timeout); |
| 68 | 68 | ||
| 69 | send_string((const char *)display); | 69 | send_string((const char *)display); |
| 70 | } | 70 | } |
| 71 | #endif | 71 | # endif |
| 72 | 72 | ||
| 73 | bool get_autoshift_state(void) { return autoshift_enabled; } | 73 | bool get_autoshift_state(void) { return autoshift_enabled; } |
| 74 | 74 | ||
| @@ -79,7 +79,6 @@ void set_autoshift_timeout(uint16_t timeout) { autoshift_timeout = timeout; } | |||
| 79 | bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { | 79 | bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { |
| 80 | if (record->event.pressed) { | 80 | if (record->event.pressed) { |
| 81 | switch (keycode) { | 81 | switch (keycode) { |
| 82 | |||
| 83 | case KC_ASTG: | 82 | case KC_ASTG: |
| 84 | autoshift_toggle(); | 83 | autoshift_toggle(); |
| 85 | return true; | 84 | return true; |
| @@ -92,10 +91,10 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { | |||
| 92 | return true; | 91 | return true; |
| 93 | 92 | ||
| 94 | # ifndef AUTO_SHIFT_NO_SETUP | 93 | # ifndef AUTO_SHIFT_NO_SETUP |
| 95 | case KC_ASUP: | 94 | case KC_ASUP: |
| 96 | autoshift_timeout += 5; | 95 | autoshift_timeout += 5; |
| 97 | return true; | 96 | return true; |
| 98 | case KC_ASDN: | 97 | case KC_ASDN: |
| 99 | autoshift_timeout -= 5; | 98 | autoshift_timeout -= 5; |
| 100 | return true; | 99 | return true; |
| 101 | 100 | ||
