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"
31 /* tapping count and state */
40 /* Key event container for recording */
43 #ifndef NO_ACTION_TAPPING
48 /* Execute action per keyevent */
49 void action_exec(keyevent_t event
);
52 action_t
action_for_key(uint8_t layer
, keypos_t key
);
55 const macro_t
*action_get_macro(keyrecord_t
*record
, uint8_t id
, uint8_t opt
);
57 /* user defined special function */
58 void action_function(keyrecord_t
*record
, uint8_t id
, uint8_t opt
);
60 /* keyboard-specific key event (pre)processing */
61 bool process_record_quantum(keyrecord_t
*record
);
63 /* Utilities for actions. */
64 #if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE)
65 extern bool disable_action_cache
;
68 /* Code for handling one-handed key modifiers. */
69 #ifdef SWAP_HANDS_ENABLE
70 extern bool swap_hands
;
71 extern const keypos_t hand_swap_config
[MATRIX_ROWS
][MATRIX_COLS
];
72 # if (MATRIX_COLS <= 8)
73 typedef uint8_t swap_state_row_t
;
74 # elif (MATRIX_COLS <= 16)
75 typedef uint16_t swap_state_row_t
;
76 # elif (MATRIX_COLS <= 32)
77 typedef uint32_t swap_state_row_t
;
79 # error "MATRIX_COLS: invalid value"
82 void process_hand_swap(keyevent_t
*record
);
85 void process_record_nocache(keyrecord_t
*record
);
86 void process_record(keyrecord_t
*record
);
87 void process_action(keyrecord_t
*record
, action_t action
);
88 void register_code(uint8_t code
);
89 void unregister_code(uint8_t code
);
90 void tap_code(uint8_t code
);
91 void register_mods(uint8_t mods
);
92 void unregister_mods(uint8_t mods
);
93 void register_weak_mods(uint8_t mods
);
94 void unregister_weak_mods(uint8_t mods
);
95 // void set_mods(uint8_t mods);
96 void clear_keyboard(void);
97 void clear_keyboard_but_mods(void);
98 void clear_keyboard_but_mods_and_keys(void);
99 void layer_switch(uint8_t new_layer
);
100 bool is_tap_key(keypos_t key
);
101 bool is_tap_action(action_t action
);
103 #ifndef NO_ACTION_TAPPING
104 void process_record_tap_hint(keyrecord_t
*record
);
108 void debug_event(keyevent_t event
);
109 void debug_record(keyrecord_t record
);
110 void debug_action(action_t action
);
116 #endif /* ACTION_H */