1
0
Fork 0

Add One Shot Key callbacks (#4697)

* Added callbacks to one shot modifier changes

* Altered signature of callback functions

* Reordered the callback methods, shortened brief documentation

* Added One Shot Modifier callback documentation

* First attempt at unit tests

* Revert "First attempt at unit tests"

This reverts commit 5ec21a782202c0d74cf21cb852bd319f0c8b4842.

* Simplified oneshot function implementations

* Made clear_oneshot_locked_mods to be conform action_util.h, adhering to the (void) signature

* Made used datatypes for oneshot mods consistently unsigned integers

* Corrected callback to call clear callback when clear_oneshot_locked_mods is invoked

* Simplified oneshot equals statements

* Corrected return type and signature of get and set oneshot locked mods

* Consolidated one shot callbacks, added initial layer callback version

* Fixed non-updating one shot layer variable after timeout or other clear, added code comments

* Added better one shot key docs
This commit is contained in:
Thomas Baart 2019-02-05 19:19:56 +01:00 committed by Drashna Jaelre
parent 7df9e584fa
commit 47051f506f
3 changed files with 159 additions and 15 deletions

View file

@ -71,8 +71,8 @@ void oneshot_enable(void);
void oneshot_disable(void);
bool has_oneshot_mods_timed_out(void);
int8_t get_oneshot_locked_mods(void);
void set_oneshot_locked_mods(int8_t mods);
uint8_t get_oneshot_locked_mods(void);
void set_oneshot_locked_mods(uint8_t mods);
void clear_oneshot_locked_mods(void);
typedef enum {
@ -89,6 +89,13 @@ bool is_oneshot_layer_active(void);
uint8_t get_oneshot_layer_state(void);
bool has_oneshot_layer_timed_out(void);
void oneshot_locked_mods_changed_user(uint8_t mods);
void oneshot_locked_mods_changed_kb(uint8_t mods);
void oneshot_mods_changed_user(uint8_t mods);
void oneshot_mods_changed_kb(uint8_t mods);
void oneshot_layer_changed_user(uint8_t layer);
void oneshot_layer_changed_kb(uint8_t layer);
/* inspect */
uint8_t has_anymod(void);