[Keymap] major keymap overhaul (#10185)

* experiment with userspace

* reorganise

* readme

* missing oneshot shift from ignored keys

* recombine hands in layout macro
This commit is contained in:
Callum Oakley 2020-09-09 23:37:34 +01:00 committed by GitHub
parent 6e948feb6a
commit 3d4f0028d6
Failed to generate hash of commit
12 changed files with 382 additions and 297 deletions

27
users/callum/swapper.c Normal file
View file

@ -0,0 +1,27 @@
#include "swapper.h"
void update_swapper(
bool *active,
uint16_t cmdish,
uint16_t tabish,
uint16_t trigger,
uint16_t keycode,
keyrecord_t *record
) {
if (keycode == trigger) {
if (record->event.pressed) {
if (!*active) {
*active = true;
register_code(cmdish);
}
register_code(tabish);
} else {
unregister_code(tabish);
// Don't unregister cmdish until some other key is hit or released.
}
} else if (*active) {
unregister_code(cmdish);
*active = false;
}
}