Keyboard firmwares for Atmel AVR and Cortex-M
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. Copyright 2012,2013 Jun Wako <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #ifndef ACTION_H
  15. #define ACTION_H
  16. #include <stdint.h>
  17. #include <stdbool.h>
  18. #include "keyboard.h"
  19. #include "keycode.h"
  20. #include "action_code.h"
  21. #include "action_macro.h"
  22. /* tapping count and state */
  23. typedef struct {
  24. bool interrupted :1;
  25. bool reserved2 :1;
  26. bool reserved1 :1;
  27. bool reserved0 :1;
  28. uint8_t count :4;
  29. } tap_t;
  30. /* Key event container for recording */
  31. typedef struct {
  32. keyevent_t event;
  33. #ifndef NO_ACTION_TAPPING
  34. tap_t tap;
  35. #endif
  36. } keyrecord_t;
  37. /* Execute action per keyevent */
  38. void action_exec(keyevent_t event);
  39. /* action for key */
  40. action_t action_for_key(uint8_t layer, key_t key);
  41. /* macro */
  42. const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt);
  43. /* user defined special function */
  44. void action_function(keyrecord_t *record, uint8_t id, uint8_t opt);
  45. /* Utilities for actions. */
  46. void process_action(keyrecord_t *record);
  47. void register_code(uint8_t code);
  48. void unregister_code(uint8_t code);
  49. void register_mods(uint8_t mods);
  50. void unregister_mods(uint8_t mods);
  51. //void set_mods(uint8_t mods);
  52. void clear_keyboard(void);
  53. void clear_keyboard_but_mods(void);
  54. bool sending_anykey(void);
  55. void layer_switch(uint8_t new_layer);
  56. bool is_tap_key(key_t key);
  57. /* debug */
  58. void debug_event(keyevent_t event);
  59. void debug_record(keyrecord_t record);
  60. void debug_action(action_t action);
  61. #endif /* ACTION_H */