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.

134 lines
2.9 KiB

[Keymap] merge jdelkins userspace and associated keymaps (#11276) * [Keymap] merge jdelkins userspace and associated keymaps * Add copyright & license info * Change rgblight_config.enable to rgblight_is_enabled() * Update keyboards/dz60/keymaps/jdelkins/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/dz60/keymaps/jdelkins/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/dz60/keymaps/jdelkins/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * Remove superfluous includes * Change EXTRAFLAGS+=-flto to LTO_ENABLE=yes * Remove unnecessary jdelkins_ss symlink in users * Add copyright and license notices * Use preferred way to determine capslock / numlock state Co-authored-by: Drashna Jaelre <drashna@live.com> * Add #pragma once to a header Co-authored-by: Drashna Jaelre <drashna@live.com> * Include QMK_KEYBOARD_H only once, in userspace header * Remove unnecessary initialization in matrix_init_keymap * Do process_record_keymap before cases handled in process_record_user * Reorganize & simplify secrets feature enablement * Use tap_code16 Co-authored-by: Ryan <fauxpark@gmail.com> * Remove superfluous break Co-authored-by: Ryan <fauxpark@gmail.com> * Remove copyright from rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Remove copyright from rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Use tap_code16 Co-authored-by: Ryan <fauxpark@gmail.com> * include "print.h" instead of <print.h> Co-authored-by: Ryan <fauxpark@gmail.com> * Use tap_cod16 Co-authored-by: Ryan <fauxpark@gmail.com> * Use tap_code16 Co-authored-by: Ryan <fauxpark@gmail.com> * Use tap_code16 Co-authored-by: Ryan <fauxpark@gmail.com> * Use tap_code16 Co-authored-by: Ryan <fauxpark@gmail.com> * Remove copyright from rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * add #pragma once to a header Co-authored-by: Ryan <fauxpark@gmail.com> * include "print.h" instead of <print.h> Co-authored-by: Ryan <fauxpark@gmail.com> * Remove copyright from rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Remove copyright from rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Remove copyright from rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Use tap_code16 Co-authored-by: Ryan <fauxpark@gmail.com> * Use tap_code16 Co-authored-by: Ryan <fauxpark@gmail.com> * Use :flash target where possible * Remove special case flash target and use PROGRAM_CMD * dz60/jdelkins_ss: use tap_code16 Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
3 years ago
  1. /*
  2. Copyright 2020 Joel Elkins <joel@elkins.com>
  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 QMK_KEYBOARD_H
  16. // Secrets
  17. #if !defined(NO_SECRETS) && __has_include("secrets.h")
  18. # define DO_SECRETS
  19. #endif
  20. void send_secret_string(uint8_t n);
  21. // standard layers
  22. enum jdelkins_layers {
  23. _QWERTY = 0,
  24. _RPT,
  25. _GAME,
  26. _FUNC,
  27. _KP,
  28. _SECRETS,
  29. _ADJUST,
  30. _LAYER_MAX
  31. };
  32. // key definitions
  33. typedef union {
  34. uint32_t raw;
  35. struct {
  36. bool system_mac :1;
  37. };
  38. } user_config_t;
  39. extern user_config_t user_config;
  40. static inline void do_mac_key(uint16_t norm_key, uint16_t mac_key, keyrecord_t *record) {
  41. uint16_t key = user_config.system_mac ? mac_key : norm_key;
  42. if (record->event.pressed)
  43. register_code16(key);
  44. else
  45. unregister_code16(key);
  46. }
  47. enum jdelkins_keycodes {
  48. KB_MAKE = SAFE_RANGE,
  49. KB_FLSH,
  50. KB_VRSN,
  51. KB_BOOT,
  52. FW_WRD,
  53. BK_WRD,
  54. KB_BOL,
  55. KB_EOL,
  56. TG_SYS,
  57. KB_COPY,
  58. KB_PASTE,
  59. MY_GUI,
  60. MY_ALT,
  61. MY_RGUI,
  62. MY_RALT,
  63. MY_CALC,
  64. #ifdef DO_SECRETS
  65. KC_SECRET_1,
  66. KC_SECRET_2,
  67. KC_SECRET_3,
  68. KC_SECRET_4,
  69. KC_SECRET_5,
  70. KC_SECRET_6,
  71. #endif
  72. USER_SAFE_RANGE,
  73. };
  74. #ifdef DO_SECRETS
  75. # define KC_SEC1 KC_SECRET_1
  76. # define KC_SEC2 KC_SECRET_2
  77. # define KC_SEC3 KC_SECRET_3
  78. # define KC_SEC4 KC_SECRET_4
  79. # define KC_SEC5 KC_SECRET_5
  80. # define KC_SEC6 KC_SECRET_6
  81. #else
  82. # define KC_SEC1 KC_NO
  83. # define KC_SEC2 KC_NO
  84. # define KC_SEC3 KC_NO
  85. # define KC_SEC4 KC_NO
  86. # define KC_SEC5 KC_NO
  87. # define KC_SEC6 KC_NO
  88. #endif
  89. #define MODS_SHIFT (get_mods() & MOD_MASK_SHIFT)
  90. #define MODS_CTRL (get_mods() & MOD_MASK_CTRL)
  91. #define MODS_ALT (get_mods() & MOD_MASK_ALT)
  92. #define MODS_GUI (get_mods() & MOD_MASK_GUI)
  93. #define MY_CAPS LCTL_T(KC_CAPS)
  94. #define MY_SPC LT(_FUNC, KC_SPC)
  95. #define NUMLOCK_ON host_keyboard_led_state().num_lock
  96. #define CAPSLOCK_ON host_keyboard_led_state().caps_lock
  97. #ifdef TAP_DANCE_ENABLE
  98. enum {
  99. SINGLE_TAP = 1,
  100. SINGLE_HOLD = 2,
  101. DOUBLE_TAP = 3,
  102. DOUBLE_HOLD = 4,
  103. DOUBLE_SINGLE_TAP = 5, //send two single taps
  104. TRIPLE_TAP = 6,
  105. TRIPLE_HOLD = 7
  106. };
  107. int cur_dance(qk_tap_dance_state_t *state); // prefer tap
  108. int hold_cur_dance(qk_tap_dance_state_t *state); // prefer hold
  109. #endif // TAP_DANCE_ENABLE