bocaj.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. Copyright 2017 Christopher Courtney <drashna@live.com> @drashna
  3. Copyright 2020 Jacob Jerrell <jacob.jerrell@gmail.com> @JacobJerrell
  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.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. #pragma once
  16. #include QMK_KEYBOARD_H
  17. #include "version.h"
  18. #include "eeprom.h"
  19. #include "process_records.h"
  20. #include "wrappers.h"
  21. #if defined(RGB_MATRIX_ENABLE)
  22. # include "rgb_matrix_stuff.h"
  23. #endif
  24. /* Define layer names */
  25. enum userspace_layers {
  26. _WORKMAN = 0,
  27. _QWERTY,
  28. _WWORKMAN,
  29. _WQWERTY,
  30. _LOWER,
  31. _RAISE,
  32. _ADJUST,
  33. _MOD,
  34. LAYER_SAFE_RANGE,
  35. };
  36. #define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
  37. #define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL))
  38. #define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
  39. #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))
  40. bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed);
  41. bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer);
  42. void matrix_init_keymap(void);
  43. void shutdown_keymap(void);
  44. void suspend_power_down_keymap(void);
  45. void suspend_wakeup_init_keymap(void);
  46. void matrix_scan_keymap(void);
  47. layer_state_t layer_state_set_keymap(layer_state_t state);
  48. layer_state_t default_layer_state_set_keymap(layer_state_t state);
  49. void led_set_keymap(uint8_t usb_led);
  50. void eeconfig_init_keymap(void);
  51. bool hasAllBitsInMask(uint8_t value, uint8_t mask);
  52. // clang-format off
  53. #ifdef KEYBOARD_planck_ez
  54. typedef union {
  55. uint32_t raw;
  56. struct {
  57. bool rgb_layer_change :1;
  58. bool rgb_matrix_idle_anim :1;
  59. };
  60. } userspace_config_t;
  61. // clang-format on
  62. extern userspace_config_t userspace_config;
  63. #endif