Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef KEYBOARD_H
  2. #define KEYBOARD_H
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. #include "host.h"
  6. /* keyboard Modifiers in boot protocol report */
  7. #define BIT_LCTRL (1<<0)
  8. #define BIT_LSHIFT (1<<1)
  9. #define BIT_LALT (1<<2)
  10. #define BIT_LGUI (1<<3)
  11. #define BIT_RCTRL (1<<4)
  12. #define BIT_RSHIFT (1<<5)
  13. #define BIT_RALT (1<<6)
  14. #define BIT_RGUI (1<<7)
  15. #define BIT_LCTL BIT_LCTRL
  16. #define BIT_RCTL BIT_RCTRL
  17. #define BIT_LSFT BIT_LSHIFT
  18. #define BIT_RSFT BIT_RSHIFT
  19. extern report_keyboard_t *keyboard_report;
  20. extern report_keyboard_t *keyboard_report_prev;
  21. void keyboard_set_led(uint8_t led);
  22. void keyboard_send(void);
  23. void keyboard_add_key(uint8_t key);
  24. void keyboard_add_mod_bit(uint8_t mod);
  25. void keyboard_set_mods(uint8_t mods);
  26. void keyboard_add_code(uint8_t code);
  27. void keyboard_swap_report(void);
  28. void keyboard_clear_report(void);
  29. uint8_t keyboard_has_anykey(void);
  30. uint8_t *keyboard_get_keys(void);
  31. uint8_t keyboard_get_mods(void);
  32. #endif