diff options
| author | Jordan Blackbourn <blackbournj@gmail.com> | 2022-01-11 13:44:18 +1300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-10 16:44:18 -0800 |
| commit | cd12b54650b4ac9023e697f036911c81b2eed693 (patch) | |
| tree | fcc398acc0be6fe671903e790388ad4ea598dfcd /keyboards/orthocode/orthocode.c | |
| parent | 372c9102e23b1c669e27262f905d76299f52e628 (diff) | |
| download | qmk_firmware-cd12b54650b4ac9023e697f036911c81b2eed693.tar.gz qmk_firmware-cd12b54650b4ac9023e697f036911c81b2eed693.zip | |
[Keyboard] Added via support for orthocode (#15777)
Diffstat (limited to 'keyboards/orthocode/orthocode.c')
| -rw-r--r-- | keyboards/orthocode/orthocode.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/keyboards/orthocode/orthocode.c b/keyboards/orthocode/orthocode.c index 23596d3e5..8ddd32c39 100644 --- a/keyboards/orthocode/orthocode.c +++ b/keyboards/orthocode/orthocode.c | |||
| @@ -15,6 +15,36 @@ | |||
| 15 | */ | 15 | */ |
| 16 | #include "orthocode.h" | 16 | #include "orthocode.h" |
| 17 | 17 | ||
| 18 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
| 19 | if (!process_record_user(keycode, record)) { | ||
| 20 | return false; | ||
| 21 | } | ||
| 22 | |||
| 23 | static bool shiftspace_mods = false; | ||
| 24 | switch (keycode) { | ||
| 25 | case SHIFTSPACE: | ||
| 26 | if (record->event.pressed) { | ||
| 27 | if(get_mods() & MOD_BIT(KC_RSFT)) { | ||
| 28 | register_code(KC_MINS); | ||
| 29 | shiftspace_mods = true; | ||
| 30 | } | ||
| 31 | else { | ||
| 32 | register_code(KC_SPC); | ||
| 33 | } | ||
| 34 | } else { | ||
| 35 | if (shiftspace_mods) { | ||
| 36 | unregister_code(KC_MINS); | ||
| 37 | shiftspace_mods = false; | ||
| 38 | } else { | ||
| 39 | unregister_code(KC_SPC); | ||
| 40 | } | ||
| 41 | } | ||
| 42 | return false; | ||
| 43 | break; | ||
| 44 | } | ||
| 45 | return true; | ||
| 46 | } | ||
| 47 | |||
| 18 | #ifdef ENCODER_ENABLE | 48 | #ifdef ENCODER_ENABLE |
| 19 | bool encoder_update_kb(uint8_t index, bool clockwise) { | 49 | bool encoder_update_kb(uint8_t index, bool clockwise) { |
| 20 | if (!encoder_update_user(index, clockwise)) { return false; } | 50 | if (!encoder_update_user(index, clockwise)) { return false; } |
