get rid of global state
parent
5e9593a4a5
commit
9fc027ebbe
202
src/main.c
202
src/main.c
|
@ -32,7 +32,7 @@ typedef u8 keycode;
|
||||||
typedef u16 media_keycode;
|
typedef u16 media_keycode;
|
||||||
typedef u8 layer;
|
typedef u8 layer;
|
||||||
|
|
||||||
typedef void (*keyfunc)(void);
|
typedef void (*keyfunc)(keycode, bool);
|
||||||
|
|
||||||
#include "./main.h"
|
#include "./main.h"
|
||||||
|
|
||||||
|
@ -59,15 +59,8 @@ static bool (*kb_was_pressed)[KB_ROWS][KB_COLUMNS] = &_kb_was_pressed;
|
||||||
|
|
||||||
static layer layers_pressed[KB_ROWS][KB_COLUMNS];
|
static layer layers_pressed[KB_ROWS][KB_COLUMNS];
|
||||||
|
|
||||||
static u8 current_row;
|
|
||||||
static u8 current_col;
|
|
||||||
static layer current_layer;
|
|
||||||
static keycode current_keycode;
|
|
||||||
static bool current_is_pressed;
|
|
||||||
|
|
||||||
static i8 layers_active[KB_LAYERS];
|
static i8 layers_active[KB_LAYERS];
|
||||||
static layer layers_top = 0;
|
static layer layers_top;
|
||||||
static bool layer_released = false;
|
|
||||||
|
|
||||||
static bool layer_sticky_on;
|
static bool layer_sticky_on;
|
||||||
static bool layer_sticky[KB_LAYERS];
|
static bool layer_sticky[KB_LAYERS];
|
||||||
|
@ -75,15 +68,6 @@ static bool layer_sticky_done;
|
||||||
static u8 mod_sticky;
|
static u8 mod_sticky;
|
||||||
static bool mod_sticky_done;
|
static bool mod_sticky_done;
|
||||||
|
|
||||||
static const keyfunc _kb_layer_funcs[] = { // TODO ugh
|
|
||||||
&kbfun_layer_press_release,
|
|
||||||
&kbfun_layer_sticky,
|
|
||||||
&kbfun_shift_layer_press_release,
|
|
||||||
&kbfun_control_layer_press_release,
|
|
||||||
&kbfun_alt_layer_press_release,
|
|
||||||
&kbfun_win_layer_press_release,
|
|
||||||
};
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
@ -113,32 +97,25 @@ void main_key_loop() {
|
||||||
// (so they can be released using the function from that layer)
|
// (so they can be released using the function from that layer)
|
||||||
for (u8 row=0; row<KB_ROWS; row++) {
|
for (u8 row=0; row<KB_ROWS; row++) {
|
||||||
for (u8 col=0; col<KB_COLUMNS; col++) {
|
for (u8 col=0; col<KB_COLUMNS; col++) {
|
||||||
current_is_pressed = (*kb_is_pressed)[row][col];
|
bool is_pressed = (*kb_is_pressed)[row][col];
|
||||||
bool was_pressed = (*kb_was_pressed)[row][col];
|
bool was_pressed = (*kb_was_pressed)[row][col];
|
||||||
|
|
||||||
if (current_is_pressed != was_pressed) {
|
if (is_pressed != was_pressed) {
|
||||||
if (current_is_pressed) {
|
layer layer;
|
||||||
current_layer = layers_top;
|
if (is_pressed) {
|
||||||
layers_pressed[row][col] = current_layer;
|
layer = layers_top;
|
||||||
|
layers_pressed[row][col] = layer;
|
||||||
} else {
|
} else {
|
||||||
current_layer = layers_pressed[row][col];
|
layer = layers_pressed[row][col];
|
||||||
|
layers_pressed[row][col] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set remaining vars, and "execute" key
|
// set remaining vars, and "execute" key
|
||||||
current_row = row;
|
exec_key(layer, row, col, is_pressed);
|
||||||
current_col = col;
|
|
||||||
current_keycode = kb_keycode(current_layer, current_row, current_col);
|
|
||||||
exec_key();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// re-press all layers so stacked layers work right
|
|
||||||
if (layer_released) {
|
|
||||||
layer_released = false;
|
|
||||||
re_press_pressed_layers();
|
|
||||||
}
|
|
||||||
|
|
||||||
// send the USB report (even if nothing's changed)
|
// send the USB report (even if nothing's changed)
|
||||||
usb_keyboard_send();
|
usb_keyboard_send();
|
||||||
usb_extra_consumer_send();
|
usb_extra_consumer_send();
|
||||||
|
@ -191,7 +168,14 @@ void init_layers() {
|
||||||
for (layer l=0; l < KB_LAYERS; l++) {
|
for (layer l=0; l < KB_LAYERS; l++) {
|
||||||
layers_active[l] = 0;
|
layers_active[l] = 0;
|
||||||
}
|
}
|
||||||
layers_active[0] = 1;
|
layers_active[0] = 1;
|
||||||
|
layers_top = 0;
|
||||||
|
|
||||||
|
for (u8 row=0; row<KB_ROWS; row++) {
|
||||||
|
for (u8 col=0; col<KB_COLUMNS; col++) {
|
||||||
|
layers_pressed[row][col] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@ -200,7 +184,7 @@ void init_layers() {
|
||||||
|
|
||||||
// find highest active layer
|
// find highest active layer
|
||||||
layer highest_active_layer() {
|
layer highest_active_layer() {
|
||||||
for (layer l = KB_LAYERS; l > 0; l--) {
|
for (layer l = KB_LAYERS - 1; l > 0; l--) {
|
||||||
if (layers_active[l] > 0) { return l; }
|
if (layers_active[l] > 0) { return l; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,37 +211,22 @@ void layer_disable(layer l) {
|
||||||
if (layers_active[l] > 0) {
|
if (layers_active[l] > 0) {
|
||||||
layers_active[l] -= 1;
|
layers_active[l] -= 1;
|
||||||
}
|
}
|
||||||
layer_released = true;
|
|
||||||
|
|
||||||
if (l == layers_top) {
|
|
||||||
layers_top = highest_active_layer();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool is_layer_keyfunc(keyfunc f) {
|
|
||||||
for (int i=0; i<array_length(_kb_layer_funcs); i++) {
|
|
||||||
if (f == _kb_layer_funcs[i]) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void re_press_pressed_layers() {
|
|
||||||
for (u8 row=0; row<KB_ROWS; row++) {
|
for (u8 row=0; row<KB_ROWS; row++) {
|
||||||
for (u8 col=0; col<KB_COLUMNS; col++) {
|
for (u8 col=0; col<KB_COLUMNS; col++) {
|
||||||
bool is_pressed = (*kb_is_pressed)[row][col];
|
if (layers_pressed[row][col] == l) {
|
||||||
if (is_pressed) {
|
// re-press affected keys
|
||||||
layer layer = layers_pressed[row][col];
|
keycode key = kb_keycode(l, row, col);
|
||||||
keycode key = kb_keycode(layer, row, col);
|
debug_printf("re: %d on l: %d at: %d x %d\n",
|
||||||
keyfunc func = kb_keyfunc_press(layer, row, col);
|
key, l,
|
||||||
debug_printf("? %d l: %d on: %d at: %d x %d\n",
|
|
||||||
is_layer_keyfunc(func),
|
|
||||||
key, layer,
|
|
||||||
row, col);
|
row, col);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (l == layers_top) {
|
||||||
|
layers_top = highest_active_layer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@ -273,10 +242,10 @@ keyfunc kb_keyfunc_release (layer l, u8 row, u8 col) { return (keyfunc) pgm_read
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// basic keypresses
|
// basic keypresses
|
||||||
void _kbfun_normal_press_release(bool press, keycode key) {
|
void _kbfun_normal_press_release(keycode key, bool is_pressed) {
|
||||||
if (key == 0) { return; } // noop
|
if (key == 0) { return; } // noop
|
||||||
|
|
||||||
if (press) {
|
if (is_pressed) {
|
||||||
for (u8 i=0; i < sizeof(keyboard_keys); i++) {
|
for (u8 i=0; i < sizeof(keyboard_keys); i++) {
|
||||||
if (keyboard_keys[i] == 0) {
|
if (keyboard_keys[i] == 0) {
|
||||||
keyboard_keys[i] = key;
|
keyboard_keys[i] = key;
|
||||||
|
@ -293,9 +262,9 @@ void _kbfun_normal_press_release(bool press, keycode key) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _kbfun_mediakey_press_release(bool press, keycode key) {
|
void _kbfun_mediakey_press_release(keycode key, bool is_pressed) {
|
||||||
media_keycode media_key = _media_code_lookup(key);
|
media_keycode media_key = _media_code_lookup(key);
|
||||||
if (press) {
|
if (is_pressed) {
|
||||||
consumer_key = media_key;
|
consumer_key = media_key;
|
||||||
} else {
|
} else {
|
||||||
// only one media key can be pressed at a time, so only clear most recent one
|
// only one media key can be pressed at a time, so only clear most recent one
|
||||||
|
@ -305,8 +274,8 @@ void _kbfun_mediakey_press_release(bool press, keycode key) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _kbfun_modifier_press_release(bool press, keycode key) {
|
void _kbfun_modifier_press_release(keycode key, bool is_pressed) {
|
||||||
if (press) {
|
if (is_pressed) {
|
||||||
keyboard_modifier_keys |= (1<<key);
|
keyboard_modifier_keys |= (1<<key);
|
||||||
} else {
|
} else {
|
||||||
keyboard_modifier_keys &= ~(1<<key);
|
keyboard_modifier_keys &= ~(1<<key);
|
||||||
|
@ -341,39 +310,40 @@ void _kbfun_normal_sticky_done() {
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// execute the keypress or keyrelease function (if it exists) of the key at the current possition
|
// execute the keypress or keyrelease function (if it exists) of the key at the current possition
|
||||||
void exec_key() {
|
void exec_key(layer layer, u8 row, u8 col, bool is_pressed) {
|
||||||
void (*key_function)(void) =
|
keycode key = kb_keycode(layer, row, col);
|
||||||
( (current_is_pressed)
|
void (*key_function)(keycode, bool) =
|
||||||
? kb_keyfunc_press(current_layer, current_row, current_col)
|
( (is_pressed)
|
||||||
: kb_keyfunc_release(current_layer, current_row, current_col) );
|
? kb_keyfunc_press(layer, row, col)
|
||||||
|
: kb_keyfunc_release(layer, row, col) );
|
||||||
|
|
||||||
if (key_function) { (*key_function)(); }
|
if (key_function) { (*key_function)(key, is_pressed); }
|
||||||
}
|
}
|
||||||
|
|
||||||
// normal key
|
// normal key
|
||||||
void kbfun_normal_press_release() {
|
void kbfun_normal_press_release(keycode key, bool is_pressed) {
|
||||||
_kbfun_normal_sticky_done();
|
_kbfun_normal_sticky_done();
|
||||||
_kbfun_normal_press_release(current_is_pressed, current_keycode);
|
_kbfun_normal_press_release(key, is_pressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
// media key
|
// media key
|
||||||
void kbfun_mediakey_press_release() {
|
void kbfun_mediakey_press_release(keycode key, bool is_pressed) {
|
||||||
_kbfun_normal_sticky_done();
|
_kbfun_normal_sticky_done();
|
||||||
_kbfun_mediakey_press_release(current_is_pressed, current_keycode);
|
_kbfun_mediakey_press_release(key, is_pressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
// modifier
|
// modifier
|
||||||
void kbfun_modifier_press_release() {
|
void kbfun_modifier_press_release(keycode key, bool is_pressed) {
|
||||||
layer_sticky_done = true;
|
layer_sticky_done = true;
|
||||||
_kbfun_modifier_press_release(current_is_pressed, current_keycode);
|
_kbfun_modifier_press_release(key, is_pressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
// layer key
|
// layer key
|
||||||
void kbfun_layer_press_release() {
|
void kbfun_layer_press_release(keycode key, bool is_pressed) {
|
||||||
layer_sticky_done = true; // don't disable sticky mods!
|
layer_sticky_done = true; // don't disable sticky mods!
|
||||||
|
|
||||||
layer l = (layer) current_keycode;
|
layer l = (layer) key;
|
||||||
if (current_is_pressed) {
|
if (is_pressed) {
|
||||||
layer_enable(l);
|
layer_enable(l);
|
||||||
} else {
|
} else {
|
||||||
layer_disable(l);
|
layer_disable(l);
|
||||||
|
@ -381,10 +351,10 @@ void kbfun_layer_press_release() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// sticky layer key
|
// sticky layer key
|
||||||
void kbfun_layer_sticky() {
|
void kbfun_layer_sticky(keycode key, bool is_pressed) {
|
||||||
layer l = (layer) current_keycode;
|
layer l = (layer) key;
|
||||||
|
|
||||||
if (current_is_pressed) {
|
if (is_pressed) {
|
||||||
layer_enable(l);
|
layer_enable(l);
|
||||||
layer_sticky_done = false;
|
layer_sticky_done = false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -399,16 +369,16 @@ void kbfun_layer_sticky() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// sticky modifier key
|
// sticky modifier key
|
||||||
void kbfun_modifier_sticky() {
|
void kbfun_modifier_sticky(keycode key, bool is_pressed) {
|
||||||
// TODO handle: sticky, then same modifier
|
// TODO handle: sticky, then same modifier
|
||||||
keycode mod = current_keycode;
|
keycode mod = key;
|
||||||
|
|
||||||
if (current_is_pressed) {
|
if (is_pressed) {
|
||||||
kbfun_modifier_press_release();
|
kbfun_modifier_press_release(key, true);
|
||||||
mod_sticky_done = false;
|
mod_sticky_done = false;
|
||||||
} else {
|
} else {
|
||||||
if (mod_sticky_done) {
|
if (mod_sticky_done) {
|
||||||
kbfun_modifier_press_release();
|
kbfun_modifier_press_release(key, false);
|
||||||
} else {
|
} else {
|
||||||
mod_sticky |= 1<<mod;
|
mod_sticky |= 1<<mod;
|
||||||
mod_sticky_done = false;
|
mod_sticky_done = false;
|
||||||
|
@ -420,56 +390,54 @@ void kbfun_modifier_sticky() {
|
||||||
// combo keyfuncs
|
// combo keyfuncs
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void _kbfun_combo_normal_press_release(keycode combo_key) {
|
void _kbfun_combo_normal_press_release(keycode combo_key, keycode key, bool is_pressed) {
|
||||||
_kbfun_modifier_press_release(current_is_pressed, combo_key);
|
_kbfun_modifier_press_release(combo_key, is_pressed);
|
||||||
kbfun_normal_press_release();
|
kbfun_normal_press_release(key, is_pressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _kbfun_combo_layer_press_release(keycode combo_key) {
|
void _kbfun_combo_layer_press_release(keycode combo_key, keycode key, bool is_pressed) {
|
||||||
kbfun_layer_press_release();
|
kbfun_layer_press_release(key, is_pressed);
|
||||||
_kbfun_modifier_press_release(current_is_pressed, combo_key);
|
_kbfun_modifier_press_release(combo_key, is_pressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
void kbfun_shift_press_release() { _kbfun_combo_normal_press_release(MOD_KEY_LeftShift); } // +shift
|
void kbfun_shift_press_release(keycode key, bool is_pressed) { _kbfun_combo_normal_press_release(MOD_KEY_LeftShift, key, is_pressed); } // +shift
|
||||||
void kbfun_control_press_release() { _kbfun_combo_normal_press_release(MOD_KEY_LeftControl); } // +control
|
void kbfun_control_press_release(keycode key, bool is_pressed) { _kbfun_combo_normal_press_release(MOD_KEY_LeftControl, key, is_pressed); } // +control
|
||||||
void kbfun_alt_press_release() { _kbfun_combo_normal_press_release(MOD_KEY_LeftAlt); } // +alt
|
void kbfun_alt_press_release(keycode key, bool is_pressed) { _kbfun_combo_normal_press_release(MOD_KEY_LeftAlt, key, is_pressed); } // +alt
|
||||||
void kbfun_win_press_release() { _kbfun_combo_normal_press_release(MOD_KEY_LeftGUI); } // +win
|
void kbfun_win_press_release(keycode key, bool is_pressed) { _kbfun_combo_normal_press_release(MOD_KEY_LeftGUI, key, is_pressed); } // +win
|
||||||
|
|
||||||
void kbfun_shift_layer_press_release() { _kbfun_combo_layer_press_release(MOD_KEY_LeftShift); } // +shift + layer
|
void kbfun_shift_layer_press_release(keycode key, bool is_pressed) { _kbfun_combo_layer_press_release(MOD_KEY_LeftShift, key, is_pressed); } // +shift + layer
|
||||||
void kbfun_control_layer_press_release() { _kbfun_combo_layer_press_release(MOD_KEY_LeftControl); } // +control + layer
|
void kbfun_control_layer_press_release(keycode key, bool is_pressed) { _kbfun_combo_layer_press_release(MOD_KEY_LeftControl, key, is_pressed); } // +control + layer
|
||||||
void kbfun_alt_layer_press_release() { _kbfun_combo_layer_press_release(MOD_KEY_LeftAlt); } // +alt + layer
|
void kbfun_alt_layer_press_release(keycode key, bool is_pressed) { _kbfun_combo_layer_press_release(MOD_KEY_LeftAlt, key, is_pressed); } // +alt + layer
|
||||||
void kbfun_win_layer_press_release() { _kbfun_combo_layer_press_release(MOD_KEY_LeftGUI); } // +win + layer
|
void kbfun_win_layer_press_release(keycode key, bool is_pressed) { _kbfun_combo_layer_press_release(MOD_KEY_LeftGUI, key, is_pressed); } // +win + layer
|
||||||
|
|
||||||
// capslock
|
// capslock
|
||||||
void kbfun_capslock_press_release() {
|
void kbfun_capslock_press_release(keycode key, bool is_pressed) {
|
||||||
static u8 keys_pressed;
|
static u8 keys_pressed;
|
||||||
static bool lshift_pressed;
|
static bool lshift_pressed;
|
||||||
static bool rshift_pressed;
|
static bool rshift_pressed;
|
||||||
|
|
||||||
keycode key = current_keycode;
|
if (!is_pressed) { keys_pressed--; }
|
||||||
|
|
||||||
if (!current_is_pressed) { keys_pressed--; }
|
|
||||||
|
|
||||||
// take care of the key that was actually pressed
|
// take care of the key that was actually pressed
|
||||||
_kbfun_modifier_press_release(current_is_pressed, key);
|
_kbfun_modifier_press_release(key, is_pressed);
|
||||||
|
|
||||||
// take care of capslock (only on the press of the 2nd key)
|
// take care of capslock (only on the press of the 2nd key)
|
||||||
if (keys_pressed == 1 && current_is_pressed) {
|
if (keys_pressed == 1 && is_pressed) {
|
||||||
// save the state of left and right shift
|
// save the state of left and right shift
|
||||||
lshift_pressed = _kbfun_modifier_is_pressed(MOD_KEY_LeftShift);
|
lshift_pressed = _kbfun_modifier_is_pressed(MOD_KEY_LeftShift);
|
||||||
rshift_pressed = _kbfun_modifier_is_pressed(MOD_KEY_RightShift);
|
rshift_pressed = _kbfun_modifier_is_pressed(MOD_KEY_RightShift);
|
||||||
// disable both
|
// disable both
|
||||||
_kbfun_modifier_press_release(false, MOD_KEY_LeftShift);
|
_kbfun_modifier_press_release(MOD_KEY_LeftShift, false);
|
||||||
_kbfun_modifier_press_release(false, MOD_KEY_RightShift);
|
_kbfun_modifier_press_release(MOD_KEY_RightShift, false);
|
||||||
|
|
||||||
// press capslock, then release it
|
// press capslock, then release it
|
||||||
_kbfun_normal_press_release(true, KEY_CapsLock); usb_keyboard_send();
|
_kbfun_normal_press_release(KEY_CapsLock, true); usb_keyboard_send();
|
||||||
_kbfun_normal_press_release(false, KEY_CapsLock); usb_keyboard_send();
|
_kbfun_normal_press_release(KEY_CapsLock, false); usb_keyboard_send();
|
||||||
|
|
||||||
// restore the state of left and right shift
|
// restore the state of left and right shift
|
||||||
if (lshift_pressed) { _kbfun_modifier_press_release(true, MOD_KEY_LeftShift); }
|
if (lshift_pressed) { _kbfun_modifier_press_release(MOD_KEY_LeftShift, true); }
|
||||||
if (rshift_pressed) { _kbfun_modifier_press_release(true, MOD_KEY_RightShift); }
|
if (rshift_pressed) { _kbfun_modifier_press_release(MOD_KEY_RightShift, true); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_is_pressed) { keys_pressed++; }
|
if (is_pressed) { keys_pressed++; }
|
||||||
}
|
}
|
||||||
|
|
46
src/main.h
46
src/main.h
|
@ -1,39 +1,37 @@
|
||||||
/* This file was automatically generated. Do not edit! */
|
/* This file was automatically generated. Do not edit! */
|
||||||
void kbfun_capslock_press_release();
|
void kbfun_capslock_press_release(keycode key,bool is_pressed);
|
||||||
void kbfun_win_press_release();
|
void kbfun_win_layer_press_release(keycode key,bool is_pressed);
|
||||||
void kbfun_alt_press_release();
|
void kbfun_alt_layer_press_release(keycode key,bool is_pressed);
|
||||||
void kbfun_control_press_release();
|
void kbfun_control_layer_press_release(keycode key,bool is_pressed);
|
||||||
void kbfun_shift_press_release();
|
void kbfun_shift_layer_press_release(keycode key,bool is_pressed);
|
||||||
void _kbfun_combo_layer_press_release(keycode combo_key);
|
void kbfun_win_press_release(keycode key,bool is_pressed);
|
||||||
void _kbfun_combo_normal_press_release(keycode combo_key);
|
void kbfun_alt_press_release(keycode key,bool is_pressed);
|
||||||
void kbfun_modifier_sticky();
|
void kbfun_control_press_release(keycode key,bool is_pressed);
|
||||||
void kbfun_modifier_press_release();
|
void kbfun_shift_press_release(keycode key,bool is_pressed);
|
||||||
void kbfun_mediakey_press_release();
|
void _kbfun_combo_layer_press_release(keycode combo_key,keycode key,bool is_pressed);
|
||||||
void kbfun_normal_press_release();
|
void _kbfun_combo_normal_press_release(keycode combo_key,keycode key,bool is_pressed);
|
||||||
|
void kbfun_modifier_sticky(keycode key,bool is_pressed);
|
||||||
|
void kbfun_layer_sticky(keycode key,bool is_pressed);
|
||||||
|
void kbfun_layer_press_release(keycode key,bool is_pressed);
|
||||||
|
void kbfun_modifier_press_release(keycode key,bool is_pressed);
|
||||||
|
void kbfun_mediakey_press_release(keycode key,bool is_pressed);
|
||||||
|
void kbfun_normal_press_release(keycode key,bool is_pressed);
|
||||||
void _kbfun_normal_sticky_done();
|
void _kbfun_normal_sticky_done();
|
||||||
bool _kbfun_modifier_is_pressed(keycode key);
|
bool _kbfun_modifier_is_pressed(keycode key);
|
||||||
bool _kbfun_mediakey_is_pressed(keycode key);
|
bool _kbfun_mediakey_is_pressed(keycode key);
|
||||||
bool _kbfun_normal_is_pressed(keycode key);
|
bool _kbfun_normal_is_pressed(keycode key);
|
||||||
void _kbfun_modifier_press_release(bool press,keycode key);
|
void _kbfun_modifier_press_release(keycode key,bool is_pressed);
|
||||||
void _kbfun_mediakey_press_release(bool press,keycode key);
|
void _kbfun_mediakey_press_release(keycode key,bool is_pressed);
|
||||||
void _kbfun_normal_press_release(bool press,keycode key);
|
void _kbfun_normal_press_release(keycode key,bool is_pressed);
|
||||||
keyfunc kb_keyfunc_release(layer l,u8 row,u8 col);
|
keyfunc kb_keyfunc_release(layer l,u8 row,u8 col);
|
||||||
keyfunc kb_keyfunc_press(layer l,u8 row,u8 col);
|
keyfunc kb_keyfunc_press(layer l,u8 row,u8 col);
|
||||||
bool is_layer_keyfunc(keyfunc f);
|
keycode kb_keycode(layer l,u8 row,u8 col);
|
||||||
void layer_enable(layer l);
|
void layer_enable(layer l);
|
||||||
layer highest_active_layer();
|
layer highest_active_layer();
|
||||||
void layer_disable(layer l);
|
void layer_disable(layer l);
|
||||||
void re_press_pressed_layers();
|
void exec_key(layer layer,u8 row,u8 col,bool is_pressed);
|
||||||
void exec_key();
|
|
||||||
keycode kb_keycode(layer l,u8 row,u8 col);
|
|
||||||
void main_key_loop();
|
void main_key_loop();
|
||||||
void init_sticky();
|
void init_sticky();
|
||||||
void init_layers();
|
void init_layers();
|
||||||
void init_hw();
|
void init_hw();
|
||||||
int main();
|
int main();
|
||||||
void kbfun_win_layer_press_release();
|
|
||||||
void kbfun_alt_layer_press_release();
|
|
||||||
void kbfun_control_layer_press_release();
|
|
||||||
void kbfun_shift_layer_press_release();
|
|
||||||
void kbfun_layer_sticky();
|
|
||||||
void kbfun_layer_press_release();
|
|
||||||
|
|
Loading…
Reference in New Issue