summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
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/action_tapping.c2
-rw-r--r--tmk_core/common/keyboard.c6
-rw-r--r--tmk_core/protocol/ps2_mouse.h5
6 files changed, 40 insertions, 3 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/action_tapping.c b/tmk_core/common/action_tapping.c
index e16e11be7..ff78d7f2a 100644
--- a/tmk_core/common/action_tapping.c
+++ b/tmk_core/common/action_tapping.c
@@ -257,7 +257,7 @@ bool process_tapping(keyrecord_t *keyp)
return true;
}
} else {
- if (!IS_NOEVENT(event)) debug("Tapping: other key just after tap.\n") {};
+ if (!IS_NOEVENT(event)) debug("Tapping: other key just after tap.\n");
process_record(keyp);
return true;
}
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
diff --git a/tmk_core/protocol/ps2_mouse.h b/tmk_core/protocol/ps2_mouse.h
index 3c93a4634..eeeffe4d8 100644
--- a/tmk_core/protocol/ps2_mouse.h
+++ b/tmk_core/protocol/ps2_mouse.h
@@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define PS2_MOUSE_SEND(command, message) \
do { \
- uint8_t rcv = ps2_host_send(command); \
+ __attribute__ ((unused)) uint8_t rcv = ps2_host_send(command); \
if (debug_mouse) { \
print((message)); \
xprintf(" command: %X, result: %X, error: %X \n", command, rcv, ps2_error); \
@@ -55,13 +55,14 @@ do { \
#define PS2_MOUSE_RECEIVE(message) \
do { \
- uint8_t rcv = ps2_host_recv_response(); \
+ __attribute__ ((unused)) uint8_t rcv = ps2_host_recv_response(); \
if (debug_mouse) { \
print((message)); \
xprintf(" result: %X, error: %X \n", rcv, ps2_error); \
} \
} while(0)
+__attribute__ ((unused))
static enum ps2_mouse_mode_e {
PS2_MOUSE_STREAM_MODE,
PS2_MOUSE_REMOTE_MODE,