bocaj.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. Copyright 2018 Jacob Jerrell <jacob.jerrell@gmail.com> @JacobJerrell
  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. #pragma once
  15. #include "quantum.h"
  16. #include "version.h"
  17. #include "eeprom.h"
  18. #include "wrappers.h"
  19. #include "process_records.h"
  20. #ifdef TAP_DANCE_ENABLE
  21. #include "tap_dances.h"
  22. #endif // TAP_DANCE_ENABLE
  23. /* Layer Names */
  24. enum userspace_layers {
  25. _WORKMAN = 0,
  26. _WINWORKMAN,
  27. _QWERTY,
  28. _LOWER,
  29. _ADJUST,
  30. _DIABLO,
  31. };
  32. #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
  33. #define BOCAJ_UNICODE_MODE UC_OSX
  34. #else
  35. // set to 2 for UC_WIN, set to 4 for UC_WINC
  36. #define BOCAJ_UNICODE_MODE 2
  37. #endif
  38. /*
  39. define modifiers here, since MOD_* doesn't seem to work for these
  40. */
  41. #define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
  42. #define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL))
  43. #define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
  44. #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))
  45. bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed);
  46. bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer);
  47. bool send_game_macro(const char *str, keyrecord_t *record, bool override);
  48. void matrix_init_keymap(void);
  49. void shutdown_keymap(void);
  50. void suspend_power_down_keymap(void);
  51. void suspend_wakeup_init_keymap(void);
  52. void matrix_scan_keymap(void);
  53. uint32_t layer_state_set_keymap (uint32_t state);
  54. uint32_t default_layer_state_set_keymap (uint32_t state);
  55. void led_set_keymap(uint8_t usb_led);
  56. void eeconfig_init_keymap(void);
  57. void tap(uint16_t keycode);
  58. typedef union {
  59. uint8_t raw;
  60. } userspace_config_t;
  61. extern userspace_config_t userspace_config;
  62. // If Tap Dancing is enabled, we manage that here.
  63. // If it is not, then we define the KC_D3_# codes gracefully
  64. #ifdef TAP_DANCE_ENABLE
  65. #define KC_D3_1 TD(TD_D3_1)
  66. #define KC_D3_2 TD(TD_D3_2)
  67. #define KC_D3_3 TD(TD_D3_3)
  68. #define KC_D3_4 TD(TD_D3_4)
  69. #else // !TAP_DANCE_ENABLE
  70. #define KC_D3_1 KC_1
  71. #define KC_D3_2 KC_2
  72. #define KC_D3_3 KC_3
  73. #define KC_D3_4 KC_4
  74. #endif // TAP_DANCE_ENABLE