]> git.donarmstrong.com Git - tmk_firmware.git/blobdiff - common/action.h
Remove MCU dependent code from common/keyboard.c
[tmk_firmware.git] / common / action.h
index 5f659337f9706fba99b6e9202728fed588b998db..8a4736d7bc19cbb833481649b467cc4da109e1ac 100644 (file)
@@ -25,30 +25,35 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "action_macro.h"
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* tapping count and state */
+typedef struct {
+    bool    interrupted :1;
+    bool    reserved2   :1;
+    bool    reserved1   :1;
+    bool    reserved0   :1;
+    uint8_t count       :4;
+} tap_t;
+
 /* Key event container for recording */
 typedef struct {
     keyevent_t  event;
 #ifndef NO_ACTION_TAPPING
-    /* tapping count and state */
-    struct {
-        bool    interrupted :1;
-        bool    reserved2   :1;
-        bool    reserved1   :1;
-        bool    reserved0   :1;
-        uint8_t count       :4;
-    } tap;
+    tap_t tap;
 #endif
 } keyrecord_t;
 
-
 /* Execute action per keyevent */
 void action_exec(keyevent_t event);
 
 /* action for key */
-action_t action_for_key(uint8_t layer, key_t key);
+action_t action_for_key(uint8_t layer, keypos_t key);
 
 /* macro */
-const prog_macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt);
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt);
 
 /* user defined special function */
 void action_function(keyrecord_t *record, uint8_t id, uint8_t opt);
@@ -57,18 +62,21 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt);
 void process_action(keyrecord_t *record);
 void register_code(uint8_t code);
 void unregister_code(uint8_t code);
-void add_mods(uint8_t mods);
-void del_mods(uint8_t mods);
-void set_mods(uint8_t mods);
+void register_mods(uint8_t mods);
+void unregister_mods(uint8_t mods);
+//void set_mods(uint8_t mods);
 void clear_keyboard(void);
 void clear_keyboard_but_mods(void);
-bool sending_anykey(void);
 void layer_switch(uint8_t new_layer);
-bool is_tap_key(key_t key);
+bool is_tap_key(keypos_t key);
 
 /* debug */
 void debug_event(keyevent_t event);
 void debug_record(keyrecord_t record);
 void debug_action(action_t action);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif  /* ACTION_H */