]> git.donarmstrong.com Git - qmk_firmware.git/blob - users/drashna/drashna.h
Update keyboards/kbdfans/kbd67/readme.md
[qmk_firmware.git] / users / drashna / drashna.h
1 /*
2 Copyright 2017 Christopher Courtney <drashna@live.com> @drashna
3
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
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #pragma once
19 #include "quantum.h"
20 #include "version.h"
21 #include "eeprom.h"
22 #include "wrappers.h"
23 #include "process_records.h"
24 #ifdef TAP_DANCE_ENABLE
25   #include "tap_dances.h"
26 #endif // TAP_DANCE_ENABLE
27 #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
28   #include "rgb_stuff.h"
29 #endif
30
31
32 /* Define layer names */
33 enum userspace_layers {
34   _QWERTY = 0,
35   _NUMLOCK = 0,
36   _COLEMAK,
37   _DVORAK,
38   _WORKMAN,
39   _NORMAN,
40   _MALTRON,
41   _EUCALYN,
42   _CARPLAX,
43   _MODS, /* layer 8 */
44   _GAMEPAD,
45   _DIABLO,
46   _MACROS,
47   _MEDIA,
48   _LOWER,
49   _RAISE,
50   _ADJUST,
51 };
52
53 /*
54 define modifiers here, since MOD_* doesn't seem to work for these
55  */
56 #define MODS_SHIFT_MASK  (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
57 #define MODS_CTRL_MASK  (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL))
58 #define MODS_ALT_MASK  (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
59 #define MODS_GUI_MASK  (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))
60
61
62
63 bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed);
64 bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer);
65 bool send_game_macro(const char *str, keyrecord_t *record, bool override);
66 void matrix_init_keymap(void);
67 void shutdown_keymap(void);
68 void suspend_power_down_keymap(void);
69 void suspend_wakeup_init_keymap(void);
70 void matrix_scan_keymap(void);
71 uint32_t layer_state_set_keymap (uint32_t state);
72 uint32_t default_layer_state_set_keymap (uint32_t state);
73 void led_set_keymap(uint8_t usb_led);
74 void eeconfig_init_keymap(void);
75
76 typedef union {
77   uint32_t raw;
78   struct {
79     bool     rgb_layer_change :1;
80     bool     is_overwatch     :1;
81     bool     nuke_switch      :1;
82     uint8_t  unicode_mod      :4;
83     bool     swapped_numbers  :1;
84   };
85 } userspace_config_t;
86
87 extern userspace_config_t userspace_config;
88
89
90 /*
91 Custom Keycodes for Diablo 3 layer
92 But since TD() doesn't work when tap dance is disabled
93 We use custom codes here, so we can substitute the right stuff
94 */
95 #ifdef TAP_DANCE_ENABLE
96 #define KC_D3_1 TD(TD_D3_1)
97 #define KC_D3_2 TD(TD_D3_2)
98 #define KC_D3_3 TD(TD_D3_3)
99 #define KC_D3_4 TD(TD_D3_4)
100 #else // TAP_DANCE_ENABLE
101 #define KC_D3_1 KC_1
102 #define KC_D3_2 KC_2
103 #define KC_D3_3 KC_3
104 #define KC_D3_4 KC_4
105 #endif // TAP_DANCE_ENABLE