diff options
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/>. | |||
| 33 | #include "nodebug.h" | 33 | #include "nodebug.h" |
| 34 | #endif | 34 | #endif |
| 35 | 35 | ||
| 36 | #ifdef FAUXCLICKY_ENABLE | ||
| 37 | #include <fauxclicky.h> | ||
| 38 | #endif | ||
| 36 | 39 | ||
| 37 | void action_exec(keyevent_t event) | 40 | void action_exec(keyevent_t event) |
| 38 | { | 41 | { |
| @@ -41,6 +44,16 @@ void action_exec(keyevent_t event) | |||
| 41 | dprint("EVENT: "); debug_event(event); dprintln(); | 44 | dprint("EVENT: "); debug_event(event); dprintln(); |
| 42 | } | 45 | } |
| 43 | 46 | ||
| 47 | #ifdef FAUXCLICKY_ENABLE | ||
| 48 | if (IS_PRESSED(event)) { | ||
| 49 | FAUXCLICKY_ACTION_PRESS; | ||
| 50 | } | ||
| 51 | if (IS_RELEASED(event)) { | ||
| 52 | FAUXCLICKY_ACTION_RELEASE; | ||
| 53 | } | ||
| 54 | fauxclicky_check(); | ||
| 55 | #endif | ||
| 56 | |||
| 44 | #ifdef ONEHAND_ENABLE | 57 | #ifdef ONEHAND_ENABLE |
| 45 | if (!IS_NOEVENT(event)) { | 58 | if (!IS_NOEVENT(event)) { |
| 46 | process_hand_swap(&event); | 59 | 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 @@ | |||
| 16 | */ | 16 | */ |
| 17 | uint32_t default_layer_state = 0; | 17 | uint32_t default_layer_state = 0; |
| 18 | 18 | ||
| 19 | __attribute__((weak)) | ||
| 20 | uint32_t default_layer_state_set_kb(uint32_t state) { | ||
| 21 | return state; | ||
| 22 | } | ||
| 23 | |||
| 19 | static void default_layer_state_set(uint32_t state) | 24 | static void default_layer_state_set(uint32_t state) |
| 20 | { | 25 | { |
| 26 | state = default_layer_state_set_kb(state); | ||
| 21 | debug("default_layer_state: "); | 27 | debug("default_layer_state: "); |
| 22 | default_layer_debug(); debug(" to "); | 28 | default_layer_debug(); debug(" to "); |
| 23 | default_layer_state = state; | 29 | default_layer_state = state; |
| @@ -57,8 +63,14 @@ void default_layer_xor(uint32_t state) | |||
| 57 | */ | 63 | */ |
| 58 | uint32_t layer_state = 0; | 64 | uint32_t layer_state = 0; |
| 59 | 65 | ||
| 66 | __attribute__((weak)) | ||
| 67 | uint32_t layer_state_set_kb(uint32_t state) { | ||
| 68 | return state; | ||
| 69 | } | ||
| 70 | |||
| 60 | static void layer_state_set(uint32_t state) | 71 | static void layer_state_set(uint32_t state) |
| 61 | { | 72 | { |
| 73 | state = layer_state_set_kb(state); | ||
| 62 | dprint("layer_state: "); | 74 | dprint("layer_state: "); |
| 63 | layer_debug(); dprint(" to "); | 75 | layer_debug(); dprint(" to "); |
| 64 | layer_state = state; | 76 | 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; | |||
| 29 | void default_layer_debug(void); | 29 | void default_layer_debug(void); |
| 30 | void default_layer_set(uint32_t state); | 30 | void default_layer_set(uint32_t state); |
| 31 | 31 | ||
| 32 | __attribute__((weak)) | ||
| 33 | uint32_t default_layer_state_set_kb(uint32_t state); | ||
| 34 | |||
| 32 | #ifndef NO_ACTION_LAYER | 35 | #ifndef NO_ACTION_LAYER |
| 33 | /* bitwise operation */ | 36 | /* bitwise operation */ |
| 34 | void default_layer_or(uint32_t state); | 37 | void default_layer_or(uint32_t state); |
| @@ -69,6 +72,8 @@ void layer_xor(uint32_t state); | |||
| 69 | #define layer_xor(state) | 72 | #define layer_xor(state) |
| 70 | #define layer_debug() | 73 | #define layer_debug() |
| 71 | 74 | ||
| 75 | __attribute__((weak)) | ||
| 76 | uint32_t layer_state_set_kb(uint32_t state); | ||
| 72 | #endif | 77 | #endif |
| 73 | 78 | ||
| 74 | /* pressed actions cache */ | 79 | /* 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/>. | |||
| 51 | #ifdef RGBLIGHT_ENABLE | 51 | #ifdef RGBLIGHT_ENABLE |
| 52 | # include "rgblight.h" | 52 | # include "rgblight.h" |
| 53 | #endif | 53 | #endif |
| 54 | #ifdef FAUXCLICKY_ENABLE | ||
| 55 | # include "fauxclicky.h" | ||
| 56 | #endif | ||
| 54 | #ifdef SERIAL_LINK_ENABLE | 57 | #ifdef SERIAL_LINK_ENABLE |
| 55 | # include "serial_link/system/serial_link.h" | 58 | # include "serial_link/system/serial_link.h" |
| 56 | #endif | 59 | #endif |
| @@ -108,6 +111,9 @@ void keyboard_init(void) { | |||
| 108 | #ifdef RGBLIGHT_ENABLE | 111 | #ifdef RGBLIGHT_ENABLE |
| 109 | rgblight_init(); | 112 | rgblight_init(); |
| 110 | #endif | 113 | #endif |
| 114 | #ifdef FAUXCLICKY_ENABLE | ||
| 115 | fauxclicky_init(); | ||
| 116 | #endif | ||
| 111 | #if defined(NKRO_ENABLE) && defined(FORCE_NKRO) | 117 | #if defined(NKRO_ENABLE) && defined(FORCE_NKRO) |
| 112 | keymap_config.nkro = 1; | 118 | keymap_config.nkro = 1; |
| 113 | #endif | 119 | #endif |
