summaryrefslogtreecommitdiff
path: root/quantum/action.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/action.c')
-rw-r--r--quantum/action.c42
1 files changed, 9 insertions, 33 deletions
diff --git a/quantum/action.c b/quantum/action.c
index 5e81efb671..d932c01688 100644
--- a/quantum/action.c
+++ b/quantum/action.c
@@ -23,7 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "led.h"
#include "action_layer.h"
#include "action_tapping.h"
-#include "action_macro.h"
#include "action_util.h"
#include "action.h"
#include "wait.h"
@@ -634,12 +633,7 @@ void process_action(keyrecord_t *record, action_t action) {
break;
# endif
#endif
- /* Extentions */
-#ifndef NO_ACTION_MACRO
- case ACT_MACRO:
- action_macro_play(action_get_macro(record, action.func.id, action.func.opt));
- break;
-#endif
+
#ifdef SWAP_HANDS_ENABLE
case ACT_SWAP_HANDS:
switch (action.swap.code) {
@@ -713,11 +707,6 @@ void process_action(keyrecord_t *record, action_t action) {
# endif
}
#endif
-#ifndef NO_ACTION_FUNCTION
- case ACT_FUNCTION:
- action_function(record, action.func.id, action.func.opt);
- break;
-#endif
default:
break;
}
@@ -794,7 +783,7 @@ void process_action(keyrecord_t *record, action_t action) {
*
* FIXME: Needs documentation.
*/
-void register_code(uint8_t code) {
+__attribute__((weak)) void register_code(uint8_t code) {
if (code == KC_NO) {
return;
}
@@ -890,7 +879,7 @@ void register_code(uint8_t code) {
*
* FIXME: Needs documentation.
*/
-void unregister_code(uint8_t code) {
+__attribute__((weak)) void unregister_code(uint8_t code) {
if (code == KC_NO) {
return;
}
@@ -955,7 +944,7 @@ void unregister_code(uint8_t code) {
* \param code The basic keycode to tap.
* \param delay The amount of time in milliseconds to leave the keycode registered, before unregistering it.
*/
-void tap_code_delay(uint8_t code, uint16_t delay) {
+__attribute__((weak)) void tap_code_delay(uint8_t code, uint16_t delay) {
register_code(code);
for (uint16_t i = delay; i > 0; i--) {
wait_ms(1);
@@ -967,13 +956,13 @@ void tap_code_delay(uint8_t code, uint16_t delay) {
*
* \param code The basic keycode to tap. If `code` is `KC_CAPS_LOCK`, the delay will be `TAP_HOLD_CAPS_DELAY`, otherwise `TAP_CODE_DELAY`, if defined.
*/
-void tap_code(uint8_t code) { tap_code_delay(code, code == KC_CAPS_LOCK ? TAP_HOLD_CAPS_DELAY : TAP_CODE_DELAY); }
+__attribute__((weak)) void tap_code(uint8_t code) { tap_code_delay(code, code == KC_CAPS_LOCK ? TAP_HOLD_CAPS_DELAY : TAP_CODE_DELAY); }
/** \brief Adds the given physically pressed modifiers and sends a keyboard report immediately.
*
* \param mods A bitfield of modifiers to register.
*/
-void register_mods(uint8_t mods) {
+__attribute__((weak)) void register_mods(uint8_t mods) {
if (mods) {
add_mods(mods);
send_keyboard_report();
@@ -984,7 +973,7 @@ void register_mods(uint8_t mods) {
*
* \param mods A bitfield of modifiers to unregister.
*/
-void unregister_mods(uint8_t mods) {
+__attribute__((weak)) void unregister_mods(uint8_t mods) {
if (mods) {
del_mods(mods);
send_keyboard_report();
@@ -995,7 +984,7 @@ void unregister_mods(uint8_t mods) {
*
* \param mods A bitfield of modifiers to register.
*/
-void register_weak_mods(uint8_t mods) {
+__attribute__((weak)) void register_weak_mods(uint8_t mods) {
if (mods) {
add_weak_mods(mods);
send_keyboard_report();
@@ -1006,7 +995,7 @@ void register_weak_mods(uint8_t mods) {
*
* \param mods A bitfield of modifiers to unregister.
*/
-void unregister_weak_mods(uint8_t mods) {
+__attribute__((weak)) void unregister_weak_mods(uint8_t mods) {
if (mods) {
del_weak_mods(mods);
send_keyboard_report();
@@ -1041,7 +1030,6 @@ void clear_keyboard_but_mods_and_keys() {
host_consumer_send(0);
#endif
clear_weak_mods();
- clear_macro_mods();
send_keyboard_report();
#ifdef MOUSEKEY_ENABLE
mousekey_clear();
@@ -1104,12 +1092,6 @@ bool is_tap_action(action_t action) {
return true;
}
return false;
- case ACT_MACRO:
- case ACT_FUNCTION:
- if (action.func.opt & FUNC_TAP) {
- return true;
- }
- return false;
}
return false;
}
@@ -1166,12 +1148,6 @@ void debug_action(action_t action) {
case ACT_LAYER_TAP_EXT:
dprint("ACT_LAYER_TAP_EXT");
break;
- case ACT_MACRO:
- dprint("ACT_MACRO");
- break;
- case ACT_FUNCTION:
- dprint("ACT_FUNCTION");
- break;
case ACT_SWAP_HANDS:
dprint("ACT_SWAP_HANDS");
break;