summaryrefslogtreecommitdiffstats
path: root/tmk_core/common/action.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common/action.c')
-rw-r--r--tmk_core/common/action.c63
1 files changed, 58 insertions, 5 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index 33d920554..fff834791 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -44,6 +44,10 @@ int retro_tapping_counter = 0;
#include <fauxclicky.h>
#endif
+/** \brief Called to execute an action.
+ *
+ * FIXME: Needs documentation.
+ */
void action_exec(keyevent_t event)
{
if (!IS_NOEVENT(event)) {
@@ -95,6 +99,10 @@ void action_exec(keyevent_t event)
bool swap_hands = false;
bool swap_held = false;
+/** \brief Process Hand Swap
+ *
+ * FIXME: Needs documentation.
+ */
void process_hand_swap(keyevent_t *event) {
static swap_state_row_t swap_state[MATRIX_ROWS];
@@ -134,7 +142,10 @@ bool process_record_quantum(keyrecord_t *record) {
}
#ifndef NO_ACTION_TAPPING
-// Allows for handling tap-hold actions immediately instead of waiting for TAPPING_TERM or another keypress.
+/** \brief Allows for handling tap-hold actions immediately instead of waiting for TAPPING_TERM or another keypress.
+ *
+ * FIXME: Needs documentation.
+ */
void process_record_tap_hint(keyrecord_t *record)
{
action_t action = layer_switch_get_action(record->event.key);
@@ -154,6 +165,10 @@ void process_record_tap_hint(keyrecord_t *record)
}
#endif
+/** \brief Take a key event (key press or key release) and processes it.
+ *
+ * FIXME: Needs documentation.
+ */
void process_record(keyrecord_t *record)
{
if (IS_NOEVENT(record->event)) { return; }
@@ -172,6 +187,10 @@ void process_record(keyrecord_t *record)
process_action(record, action);
}
+/** \brief Take an action and processes it.
+ *
+ * FIXME: Needs documentation.
+ */
void process_action(keyrecord_t *record, action_t action)
{
keyevent_t event = record->event;
@@ -674,8 +693,9 @@ void process_action(keyrecord_t *record, action_t action)
-/*
- * Utilities for actions.
+/** \brief Utilities for actions. (FIXME: Needs better description)
+ *
+ * FIXME: Needs documentation.
*/
void register_code(uint8_t code)
{
@@ -755,6 +775,10 @@ void register_code(uint8_t code)
}
}
+/** \brief Utilities for actions. (FIXME: Needs better description)
+ *
+ * FIXME: Needs documentation.
+ */
void unregister_code(uint8_t code)
{
if (code == KC_NO) {
@@ -810,6 +834,10 @@ void unregister_code(uint8_t code)
}
}
+/** \brief Utilities for actions. (FIXME: Needs better description)
+ *
+ * FIXME: Needs documentation.
+ */
void register_mods(uint8_t mods)
{
if (mods) {
@@ -818,6 +846,10 @@ void register_mods(uint8_t mods)
}
}
+/** \brief Utilities for actions. (FIXME: Needs better description)
+ *
+ * FIXME: Needs documentation.
+ */
void unregister_mods(uint8_t mods)
{
if (mods) {
@@ -826,12 +858,20 @@ void unregister_mods(uint8_t mods)
}
}
+/** \brief Utilities for actions. (FIXME: Needs better description)
+ *
+ * FIXME: Needs documentation.
+ */
void clear_keyboard(void)
{
clear_mods();
clear_keyboard_but_mods();
}
+/** \brief Utilities for actions. (FIXME: Needs better description)
+ *
+ * FIXME: Needs documentation.
+ */
void clear_keyboard_but_mods(void)
{
clear_weak_mods();
@@ -848,6 +888,10 @@ void clear_keyboard_but_mods(void)
#endif
}
+/** \brief Utilities for actions. (FIXME: Needs better description)
+ *
+ * FIXME: Needs documentation.
+ */
bool is_tap_key(keypos_t key)
{
action_t action = layer_switch_get_action(key);
@@ -880,14 +924,19 @@ bool is_tap_key(keypos_t key)
}
-/*
- * debug print
+/** \brief Debug print (FIXME: Needs better description)
+ *
+ * FIXME: Needs documentation.
*/
void debug_event(keyevent_t event)
{
dprintf("%04X%c(%u)", (event.key.row<<8 | event.key.col), (event.pressed ? 'd' : 'u'), event.time);
}
+/** \brief Debug print (FIXME: Needs better description)
+ *
+ * FIXME: Needs documentation.
+ */
void debug_record(keyrecord_t record)
{
debug_event(record.event);
@@ -896,6 +945,10 @@ void debug_record(keyrecord_t record)
#endif
}
+/** \brief Debug print (FIXME: Needs better description)
+ *
+ * FIXME: Needs documentation.
+ */
void debug_action(action_t action)
{
switch (action.kind.id) {