2 Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #include "action_code.h"
25 #include "action_macro.h"
32 /* tapping count and state */
41 /* Key event container for recording */
44 #ifndef NO_ACTION_TAPPING
49 /* Execute action per keyevent */
50 void action_exec(keyevent_t event);
53 action_t action_for_key(uint8_t layer, keypos_t key);
56 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt);
58 /* user defined special function */
59 void action_function(keyrecord_t *record, uint8_t id, uint8_t opt);
61 /* keyboard-specific key event (pre)processing */
62 bool process_record_quantum(keyrecord_t *record);
64 /* Utilities for actions. */
65 #if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE)
66 extern bool disable_action_cache;
69 /* Code for handling one-handed key modifiers. */
70 #ifdef SWAP_HANDS_ENABLE
71 extern bool swap_hands;
72 extern const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS];
73 #if (MATRIX_COLS <= 8)
74 typedef uint8_t swap_state_row_t;
75 #elif (MATRIX_COLS <= 16)
76 typedef uint16_t swap_state_row_t;
77 #elif (MATRIX_COLS <= 32)
78 typedef uint32_t swap_state_row_t;
80 #error "MATRIX_COLS: invalid value"
83 void process_hand_swap(keyevent_t *record);
86 void process_record_nocache(keyrecord_t *record);
87 void process_record(keyrecord_t *record);
88 void process_action(keyrecord_t *record, action_t action);
89 void register_code(uint8_t code);
90 void unregister_code(uint8_t code);
91 void tap_code(uint8_t code);
92 void register_mods(uint8_t mods);
93 void unregister_mods(uint8_t mods);
94 //void set_mods(uint8_t mods);
95 void clear_keyboard(void);
96 void clear_keyboard_but_mods(void);
97 void layer_switch(uint8_t new_layer);
98 bool is_tap_key(keypos_t key);
100 #ifndef NO_ACTION_TAPPING
101 void process_record_tap_hint(keyrecord_t *record);
105 void debug_event(keyevent_t event);
106 void debug_record(keyrecord_t record);
107 void debug_action(action_t action);
113 #endif /* ACTION_H */