X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tmk_core%2Fcommon%2Faction.h;h=799e3bb0efd52d5a7a400145c4ef6a8b1cdfaaad;hb=b36bb58b7624533022dc38b02421c9f1d1f3f2e1;hp=44ec3047ba5a03a0fdb33c39edee4085c7b7e92c;hpb=8b0274f60a47eae523e28b5a7c6c7f581b6d605a;p=qmk_firmware.git diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h index 44ec3047b..799e3bb0e 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h @@ -59,23 +59,49 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt); void action_function(keyrecord_t *record, uint8_t id, uint8_t opt); /* keyboard-specific key event (pre)processing */ -void process_action_kb(keyrecord_t *record); +bool process_record_quantum(keyrecord_t *record); /* Utilities for actions. */ -#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) +#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) extern bool disable_action_cache; #endif -void process_action_nocache(keyrecord_t *record); -void process_action(keyrecord_t *record); + +/* Code for handling one-handed key modifiers. */ +#ifdef SWAP_HANDS_ENABLE +extern bool swap_hands; +extern const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS]; +#if (MATRIX_COLS <= 8) +typedef uint8_t swap_state_row_t; +#elif (MATRIX_COLS <= 16) +typedef uint16_t swap_state_row_t; +#elif (MATRIX_COLS <= 32) +typedef uint32_t swap_state_row_t; +#else +#error "MATRIX_COLS: invalid value" +#endif + +void process_hand_swap(keyevent_t *record); +#endif + +void process_record_nocache(keyrecord_t *record); +void process_record(keyrecord_t *record); +void process_action(keyrecord_t *record, action_t action); void register_code(uint8_t code); void unregister_code(uint8_t code); +void tap_code(uint8_t code); 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); +void clear_keyboard_but_mods_and_keys(void); void layer_switch(uint8_t new_layer); bool is_tap_key(keypos_t key); +bool is_tap_action(action_t action); + +#ifndef NO_ACTION_TAPPING +void process_record_tap_hint(keyrecord_t *record); +#endif /* debug */ void debug_event(keyevent_t event);