[Erez & Jack] Packages Space Cadet shifts into keycodes
This commit is contained in:
parent
f4a426a0b1
commit
1237025963
6 changed files with 1104 additions and 1212 deletions
|
@ -21,6 +21,7 @@ void leader_end(void) {}
|
|||
uint8_t starting_note = 0x0C;
|
||||
int offset = 7;
|
||||
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
bool music_activated = false;
|
||||
|
||||
|
@ -59,6 +60,8 @@ uint8_t chord_key_down = 0;
|
|||
static uint8_t input_mode;
|
||||
#endif
|
||||
|
||||
static bool shift_interrupted[] = {0, 0, 0};
|
||||
|
||||
bool keys_chord(uint8_t keys[]) {
|
||||
uint8_t keys_size = sizeof(keys)/sizeof(keys[0]);
|
||||
bool pass = true;
|
||||
|
@ -415,6 +418,45 @@ bool process_record_quantum(keyrecord_t *record) {
|
|||
|
||||
#endif
|
||||
|
||||
switch(keycode) {
|
||||
case KC_LSPO: {
|
||||
if (record->event.pressed) {
|
||||
shift_interrupted[0] = false;
|
||||
register_mods(MOD_BIT(KC_LSFT));
|
||||
}
|
||||
else {
|
||||
if (!shift_interrupted[0]) {
|
||||
register_code(KC_9);
|
||||
unregister_code(KC_9);
|
||||
}
|
||||
unregister_mods(MOD_BIT(KC_LSFT));
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
case KC_RSPC: {
|
||||
if (record->event.pressed) {
|
||||
shift_interrupted[1] = false;
|
||||
register_mods(MOD_BIT(KC_RSFT));
|
||||
}
|
||||
else {
|
||||
if (!shift_interrupted[1]) {
|
||||
register_code(KC_0);
|
||||
unregister_code(KC_0);
|
||||
}
|
||||
unregister_mods(MOD_BIT(KC_RSFT));
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
shift_interrupted[0] = true;
|
||||
shift_interrupted[1] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return process_action_kb(record);
|
||||
}
|
||||
|
||||
|
@ -481,4 +523,4 @@ void audio_on_user() {}
|
|||
__attribute__ ((weak))
|
||||
void music_scale_user() {}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue