forked from mirrors/qmk_userspace
[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:
parent
6e948feb6a
commit
3d4f0028d6
12 changed files with 382 additions and 297 deletions
27
users/callum/swapper.c
Normal file
27
users/callum/swapper.c
Normal 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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue