diff options
author | Gabriel Young <gabeplaysdrums@live.com> | 2017-02-19 14:34:58 -0800 |
---|---|---|
committer | Gabriel Young <gabeplaysdrums@live.com> | 2017-02-19 14:34:58 -0800 |
commit | 40a8a88e72c185eec629973580b72dfaaf71b116 (patch) | |
tree | 583330bc173017de5e1d4a10ff7100ebc0f1a34b /tmk_core | |
parent | 1e97f77278b757d740a800ae228c6202de0679b4 (diff) | |
parent | 49e72632d2200fc3bf71d5ced2aa43058da3b2e0 (diff) | |
download | firmware-40a8a88e72c185eec629973580b72dfaaf71b116.tar.gz firmware-40a8a88e72c185eec629973580b72dfaaf71b116.tar.bz2 firmware-40a8a88e72c185eec629973580b72dfaaf71b116.zip |
Merge branch 'qmk/master'
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/common/action.c | 13 | ||||
-rw-r--r-- | tmk_core/common/action_layer.c | 12 | ||||
-rw-r--r-- | tmk_core/common/action_layer.h | 5 | ||||
-rw-r--r-- | tmk_core/common/keyboard.c | 6 |
4 files changed, 36 insertions, 0 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index f03670a7f..94de36918 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -33,6 +33,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "nodebug.h" #endif +#ifdef FAUXCLICKY_ENABLE +#include <fauxclicky.h> +#endif void action_exec(keyevent_t event) { @@ -41,6 +44,16 @@ void action_exec(keyevent_t event) dprint("EVENT: "); debug_event(event); dprintln(); } +#ifdef FAUXCLICKY_ENABLE + if (IS_PRESSED(event)) { + FAUXCLICKY_ACTION_PRESS; + } + if (IS_RELEASED(event)) { + FAUXCLICKY_ACTION_RELEASE; + } + fauxclicky_check(); +#endif + #ifdef ONEHAND_ENABLE if (!IS_NOEVENT(event)) { process_hand_swap(&event); diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index a3c757964..58d919a04 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -16,8 +16,14 @@ */ uint32_t default_layer_state = 0; +__attribute__((weak)) +uint32_t default_layer_state_set_kb(uint32_t state) { + return state; +} + static void default_layer_state_set(uint32_t state) { + state = default_layer_state_set_kb(state); debug("default_layer_state: "); default_layer_debug(); debug(" to "); default_layer_state = state; @@ -57,8 +63,14 @@ void default_layer_xor(uint32_t state) */ uint32_t layer_state = 0; +__attribute__((weak)) +uint32_t layer_state_set_kb(uint32_t state) { + return state; +} + static void layer_state_set(uint32_t state) { + state = layer_state_set_kb(state); dprint("layer_state: "); layer_debug(); dprint(" to "); layer_state = state; diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h index 025cf5420..d89ed6e5c 100644 --- a/tmk_core/common/action_layer.h +++ b/tmk_core/common/action_layer.h @@ -29,6 +29,9 @@ extern uint32_t default_layer_state; void default_layer_debug(void); void default_layer_set(uint32_t state); +__attribute__((weak)) +uint32_t default_layer_state_set_kb(uint32_t state); + #ifndef NO_ACTION_LAYER /* bitwise operation */ void default_layer_or(uint32_t state); @@ -69,6 +72,8 @@ void layer_xor(uint32_t state); #define layer_xor(state) #define layer_debug() +__attribute__((weak)) +uint32_t layer_state_set_kb(uint32_t state); #endif /* pressed actions cache */ diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 3aa82231b..eac1f1dd8 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -51,6 +51,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #ifdef RGBLIGHT_ENABLE # include "rgblight.h" #endif +#ifdef FAUXCLICKY_ENABLE +# include "fauxclicky.h" +#endif #ifdef SERIAL_LINK_ENABLE # include "serial_link/system/serial_link.h" #endif @@ -108,6 +111,9 @@ void keyboard_init(void) { #ifdef RGBLIGHT_ENABLE rgblight_init(); #endif +#ifdef FAUXCLICKY_ENABLE + fauxclicky_init(); +#endif #if defined(NKRO_ENABLE) && defined(FORCE_NKRO) keymap_config.nkro = 1; #endif |