summaryrefslogtreecommitdiffstats
path: root/tmk_core
diff options
context:
space:
mode:
authorXyverz <xyverz@gmail.com>2017-02-21 08:54:09 +0100
committerXyverz <xyverz@gmail.com>2017-02-21 08:54:09 +0100
commitbf6f7a623dbe4e3bba4bcc6d86ac28b842226825 (patch)
tree59ce47b0d4b21a2606e1f6d367317af8bdbd06ae /tmk_core
parentca1ec7b121c973fae614e69093f40ee9ba25e629 (diff)
parent7ff41df32c29bca4e3a6efc3047b8fa93bb99b92 (diff)
downloadqmk_firmware-bf6f7a623dbe4e3bba4bcc6d86ac28b842226825.tar.gz
qmk_firmware-bf6f7a623dbe4e3bba4bcc6d86ac28b842226825.tar.xz
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common/action.c13
-rw-r--r--tmk_core/common/action_layer.c12
-rw-r--r--tmk_core/common/action_layer.h5
-rw-r--r--tmk_core/common/keyboard.c6
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