[Keyboard] Added via support for orthocode (#15777)

This commit is contained in:
Jordan Blackbourn 2022-01-11 13:44:18 +13:00 committed by GitHub
parent 372c9102e2
commit cd12b54650
Failed to generate hash of commit
7 changed files with 140 additions and 6 deletions

View file

@ -15,6 +15,36 @@
*/
#include "orthocode.h"
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (!process_record_user(keycode, record)) {
return false;
}
static bool shiftspace_mods = false;
switch (keycode) {
case SHIFTSPACE:
if (record->event.pressed) {
if(get_mods() & MOD_BIT(KC_RSFT)) {
register_code(KC_MINS);
shiftspace_mods = true;
}
else {
register_code(KC_SPC);
}
} else {
if (shiftspace_mods) {
unregister_code(KC_MINS);
shiftspace_mods = false;
} else {
unregister_code(KC_SPC);
}
}
return false;
break;
}
return true;
}
#ifdef ENCODER_ENABLE
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) { return false; }