diff options
Diffstat (limited to 'keyboards/atomic/keymaps/pvc/keymap.c')
-rw-r--r-- | keyboards/atomic/keymaps/pvc/keymap.c | 605 |
1 files changed, 605 insertions, 0 deletions
diff --git a/keyboards/atomic/keymaps/pvc/keymap.c b/keyboards/atomic/keymaps/pvc/keymap.c new file mode 100644 index 000000000..9ed79899d --- /dev/null +++ b/keyboards/atomic/keymaps/pvc/keymap.c | |||
@@ -0,0 +1,605 @@ | |||
1 | #include QMK_KEYBOARD_H | ||
2 | #include "action_layer.h" | ||
3 | #include "eeconfig.h" | ||
4 | #include "led.h" | ||
5 | #include "mousekey.h" | ||
6 | |||
7 | #ifdef AUDIO_ENABLE | ||
8 | #include "audio.h" | ||
9 | #include "song_list.h" | ||
10 | #endif | ||
11 | |||
12 | enum keyboard_layers { | ||
13 | LAYER_QWERTY = 0, | ||
14 | LAYER_UPPER, | ||
15 | LAYER_LOWER, | ||
16 | LAYER_FUNCTION, | ||
17 | LAYER_MOUSE, | ||
18 | LAYER_ADJUST, | ||
19 | }; | ||
20 | enum keyboard_macros { | ||
21 | MACRO_QWERTY = 0, | ||
22 | MACRO_UPPER, | ||
23 | MACRO_LOWER, | ||
24 | MACRO_FUNCTION, | ||
25 | MACRO_MOUSE, | ||
26 | MACRO_TIMBRE_1, | ||
27 | MACRO_TIMBRE_2, | ||
28 | MACRO_TIMBRE_3, | ||
29 | MACRO_TIMBRE_4, | ||
30 | MACRO_TEMPO_U, | ||
31 | MACRO_TEMPO_D, | ||
32 | MACRO_TONE_DEFAULT, | ||
33 | MACRO_MUSIC_TOGGLE, | ||
34 | MACRO_AUDIO_TOGGLE, | ||
35 | MACRO_INC_VOICE, | ||
36 | MACRO_DEC_VOICE, | ||
37 | MACRO_BACKLIGHT, | ||
38 | MACRO_BREATH_TOGGLE, | ||
39 | MACRO_BREATH_SPEED_INC, | ||
40 | MACRO_BREATH_SPEED_DEC, | ||
41 | MACRO_BREATH_DEFAULT, | ||
42 | MACRO_MOUSE_MOVE_UL, | ||
43 | MACRO_MOUSE_MOVE_UR, | ||
44 | MACRO_MOUSE_MOVE_DL, | ||
45 | MACRO_MOUSE_MOVE_DR, | ||
46 | MACRO_HELP_1, | ||
47 | MACRO_HELP_2, | ||
48 | MACRO_HELP_3, | ||
49 | MACRO_HELP_4, | ||
50 | MACRO_HELP_5, | ||
51 | MACRO_HELP_6, | ||
52 | MACRO_HELP_7, | ||
53 | MACRO_HELP_8, | ||
54 | MACRO_HELP_9, | ||
55 | }; | ||
56 | |||
57 | #define M_QWRTY M(MACRO_QWERTY) | ||
58 | #define M_UPPER M(MACRO_UPPER) | ||
59 | #define M_LOWER M(MACRO_LOWER) | ||
60 | #define M_FUNCT M(MACRO_FUNCTION) | ||
61 | #define M_MOUSE M(MACRO_MOUSE) | ||
62 | #define TIMBR_1 M(MACRO_TIMBRE_1) | ||
63 | #define TIMBR_2 M(MACRO_TIMBRE_2) | ||
64 | #define TIMBR_3 M(MACRO_TIMBRE_3) | ||
65 | #define TIMBR_4 M(MACRO_TIMBRE_4) | ||
66 | #define TMPO_UP M(MACRO_TEMPO_U) | ||
67 | #define TMPO_DN M(MACRO_TEMPO_D) | ||
68 | #define TMPO_DF M(MACRO_TONE_DEFAULT) | ||
69 | #define M_BACKL M(MACRO_BACKLIGHT) | ||
70 | #define M_BRTOG M(MACRO_BREATH_TOGGLE) | ||
71 | #define M_BSPDU M(MACRO_BREATH_SPEED_INC) | ||
72 | #define M_BSPDD M(MACRO_BREATH_SPEED_DEC) | ||
73 | #define M_BDFLT M(MACRO_BREATH_DEFAULT) | ||
74 | #define M_MS_UL M(MACRO_MOUSE_MOVE_UL) | ||
75 | #define M_MS_UR M(MACRO_MOUSE_MOVE_UR) | ||
76 | #define M_MS_DL M(MACRO_MOUSE_MOVE_DL) | ||
77 | #define M_MS_DR M(MACRO_MOUSE_MOVE_DR) | ||
78 | #define M_HELP1 M(MACRO_HELP_1) | ||
79 | #define M_HELP2 M(MACRO_HELP_2) | ||
80 | #define M_HELP3 M(MACRO_HELP_3) | ||
81 | #define M_HELP4 M(MACRO_HELP_4) | ||
82 | #define M_HELP5 M(MACRO_HELP_5) | ||
83 | #define M_HELP6 M(MACRO_HELP_6) | ||
84 | #define M_HELP7 M(MACRO_HELP_7) | ||
85 | #define M_HELP8 M(MACRO_HELP_8) | ||
86 | #define M_HELP9 M(MACRO_HELP_9) | ||
87 | |||
88 | |||
89 | #define VC_UP M(MACRO_INC_VOICE) | ||
90 | #define VC_DOWN M(MACRO_DEC_VOICE) | ||
91 | |||
92 | |||
93 | #define SC_UNDO LCTL(KC_Z) | ||
94 | #define SC_REDO LCTL(KC_Y) | ||
95 | #define SC_CUT LCTL(KC_X) | ||
96 | #define SC_COPY LCTL(KC_C) | ||
97 | #define SC_PSTE LCTL(KC_V) | ||
98 | #define SC_SELA LCTL(KC_A) | ||
99 | #define SC_SAVE LCTL(KC_S) | ||
100 | #define SC_OPEN LCTL(KC_O) | ||
101 | #define SC_ACLS LALT(KC_F4) | ||
102 | #define SC_CCLS LCTL(KC_F4) | ||
103 | |||
104 | #define TG_NKRO MAGIC_TOGGLE_NKRO | ||
105 | #define OS_SHFT OSM(MOD_LSFT) | ||
106 | |||
107 | #define ________________ _______, _______ | ||
108 | #define XXXXXXXXXXXXXXXX XXXXXXX, XXXXXXX | ||
109 | |||
110 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
111 | |||
112 | /* LAYER = LAYER_QWERTY | ||
113 | .--------------------------------------------------------------------------------------------------------------------------------------. | ||
114 | | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP . BACKSP | | ||
115 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
116 | | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | DEL | | ||
117 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
118 | | CAP LK | A | S | D | F | G | H | J | K | L | ; | ' | ENTER . ENTER | PG UP | | ||
119 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
120 | | LSHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT . RSHIFT | UP | PG DN | | ||
121 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
122 | | LCTRL | LWIN | FN | LALT | UPPER | SPACE . SPACE | LOWER | OSHIFT | RALT | APP | RCTRL | LEFT | DOWN | RIGHT | | ||
123 | '--------------------------------------------------------------------------------------------------------------------------------------' | ||
124 | */ | ||
125 | [LAYER_QWERTY] = LAYOUT_ortho_5x15( | ||
126 | KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSPC, KC_BSPC, | ||
127 | KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL , | ||
128 | KC_CAPS, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , KC_ENT , KC_PGUP, | ||
129 | KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_RSFT, KC_UP , KC_PGDN, | ||
130 | KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_UPPER, KC_SPC , KC_SPC , M_LOWER, OS_SHFT, KC_RALT, KC_APP , KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT | ||
131 | ), | ||
132 | /* LAYER = LAYER_UPPER | ||
133 | .--------------------------------------------------------------------------------------------------------------------------------------. | ||
134 | | PRINT | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | NUM LK | KP / | KP * | KP - | XXXXXX | XXXXXX | ______ . ______ | | ||
135 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
136 | | PAUSE | F1 | F2 | F3 | F4 | NUM LK | KP / | KP 7 | KP 8 | KP 9 | KP - | ______ | ______ | ______ | INS | | ||
137 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
138 | | ______ | F5 | F6 | F7 | F8 | CAP LK | KP * | KP 4 | KP 5 | KP 6 | KP + | ______ | ______ . ______ | HOME | | ||
139 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
140 | | ______ | F9 | F10 | F11 | F12 | SCR LK | KP 0 | KP 1 | KP 2 | KP 3 | KP ENT | ______ . ______ | ______ | END | | ||
141 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
142 | | ______ | ______ | ______ | ______ | UPPER | KP 0 . KP 0 | ______ | RALT | KP . | KP ENT | ______ | ______ | ______ | ______ | | ||
143 | '--------------------------------------------------------------------------------------------------------------------------------------' | ||
144 | */ | ||
145 | [LAYER_UPPER] = LAYOUT_ortho_5x15( | ||
146 | KC_PSCR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, XXXXXXX, XXXXXXX, _______, _______, | ||
147 | KC_PAUS, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_NLCK, KC_PSLS, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, _______, _______, _______, KC_INS , | ||
148 | _______, KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_CAPS, KC_PAST, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______, _______, _______, KC_HOME, | ||
149 | _______, KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_SLCK, KC_KP_0, KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, _______, _______, _______, KC_END , | ||
150 | _______, _______, _______, _______, M_UPPER, KC_KP_0, KC_KP_0, _______, KC_RALT, KC_PDOT, KC_PENT, _______, _______, _______, _______ | ||
151 | ), | ||
152 | /* LAYER = LAYER_LOWER | ||
153 | .--------------------------------------------------------------------------------------------------------------------------------------. | ||
154 | | PRINT | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | ______ . ______ | | ||
155 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
156 | | ______ | $ | { | [ | ( | % | # | ) | ] | } | @ | ______ | ______ | ______ | INS | | ||
157 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
158 | | ______ | ^ | * | + | - | / | \ | _ | ' | " | ` | ______ | ______ . ______ | HOME | | ||
159 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
160 | | ______ | | | & | ! | ~ | ; | : | = | < | > | ? | ______ . ______ | ______ | END | | ||
161 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
162 | | ______ | ______ | ______ | ______ | ______ | ______ . ______ | LOWER | ______ | ______ | ______ | ______ | ______ | ______ | ______ | | ||
163 | '--------------------------------------------------------------------------------------------------------------------------------------' | ||
164 | */ | ||
165 | [LAYER_LOWER] = LAYOUT_ortho_5x15( | ||
166 | KC_PSCR, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , _______, _______, | ||
167 | _______, KC_DLR , KC_LCBR, KC_LBRC, KC_LPRN, KC_PERC, KC_HASH, KC_RPRN, KC_RBRC, KC_RCBR, KC_AT , _______, _______, _______, KC_INS , | ||
168 | _______, KC_CIRC, KC_ASTR, KC_PLUS, KC_MINS, KC_SLSH, KC_BSLS, KC_UNDS, KC_QUOT, KC_DQT , KC_GRV , _______, _______, _______, KC_HOME, | ||
169 | _______, KC_PIPE, KC_AMPR, KC_EXLM, KC_TILD, KC_SCLN, KC_COLN, KC_EQL , KC_LT , KC_GT , KC_QUES, _______, _______, _______, KC_END , | ||
170 | _______, _______, _______, _______, _______, _______, _______, M_LOWER, _______, _______, _______, _______, _______, _______, _______ | ||
171 | ), | ||
172 | /* LAYER = LAYER_FUNCTION | ||
173 | .--------------------------------------------------------------------------------------------------------------------------------------. | ||
174 | | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX . XXXXXX | | ||
175 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
176 | | XXXXXX | F13 | F14 | F15 | F16 | NUM LK | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | | ||
177 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
178 | | XXXXXX | F17 | F18 | F19 | F20 | SCR LK | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX . XXXXXX | XXXXXX | | ||
179 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
180 | | ______ | F21 | F22 | F23 | F24 | CAP LK | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | ______ . ______ | VOL UP | MUTE | | ||
181 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
182 | | ______ | ______ | FN | ______ | ______ | PLAY . PLAY | ______ | ______ | ______ | ______ | ______ | PREV | VOL DN | NEXT | | ||
183 | '--------------------------------------------------------------------------------------------------------------------------------------' | ||
184 | */ | ||
185 | [LAYER_FUNCTION] = LAYOUT_ortho_5x15( | ||
186 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
187 | XXXXXXX, KC_F13 , KC_F14 , KC_F15 , KC_F16 , KC_NLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
188 | XXXXXXX, KC_F17 , KC_F18 , KC_F19 , KC_F20 , KC_SLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
189 | _______, KC_F21 , KC_F22 , KC_F23 , KC_F24 , KC_CAPS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_VOLU, KC_MUTE, | ||
190 | _______, _______, M_FUNCT, _______, _______, KC_MPLY, KC_MPLY, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT | ||
191 | ), | ||
192 | /* LAYER = LAYER_MOUSE | ||
193 | .--------------------------------------------------------------------------------------------------------------------------------------. | ||
194 | | ESC | MS AC0 | MS AC1 | MS AC2 | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX . XXXXXX | | ||
195 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
196 | | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | MS UL | MS U | MS UR | XXXXXX | XXXXXX | XXXXXX | MS WHL | MS WHR | | ||
197 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
198 | | XXXXXX | MS BT5 | MS BT4 | MS BT3 | MS BT2 | XXXXXX | XXXXXX | MS L | XXXXXX | MS R | XXXXXX | XXXXXX | XXXXXX . XXXXXX | MS WHU | | ||
199 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
200 | | ______ | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | MS DL | MS D | MS DR | XXXXXX | ______ . ______ | MS U | MS WHD | | ||
201 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
202 | | ______ | ______ | ______ | ______ | ______ | MS BT1 . MS BT1 | ______ | ______ | ______ | ______ | ______ | MS L | MS D | MS R | | ||
203 | '--------------------------------------------------------------------------------------------------------------------------------------' | ||
204 | */ | ||
205 | [LAYER_MOUSE] = LAYOUT_ortho_5x15( | ||
206 | KC_ESC , KC_ACL0, KC_ACL1, KC_ACL2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
207 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, M_MS_UL, KC_MS_U, M_MS_UR, XXXXXXX, XXXXXXX, XXXXXXX, KC_WH_L, KC_WH_R, | ||
208 | XXXXXXX, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, XXXXXXX, XXXXXXX, KC_MS_L, XXXXXXX, KC_MS_R, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_WH_U, | ||
209 | _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, M_MS_DL, KC_MS_D, M_MS_DR, XXXXXXX, _______, _______, KC_MS_U, KC_WH_D, | ||
210 | _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R | ||
211 | ), | ||
212 | /* LAYER = LAYER_ADJUST | ||
213 | .--------------------------------------------------------------------------------------------------------------------------------------. | ||
214 | | XXXXXX | HELP 1 | HELP 2 | HELP 3 | HELP 4 | HELP 5 | HELP 6 | HELP 7 | HELP 8 | HELP 9 | XXXXXX | MUSIC | AUDIO | XXXXXX . XXXXXX | | ||
215 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
216 | | XXXXXX | BRTOG | BRSPD+ | BRSPD- | BRDFLT | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | | ||
217 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
218 | | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX | XXXXXX . XXXXXX | XXXXXX | | ||
219 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
220 | | XXXXXX | QWERTY | XXXXXX | XXXXXX | BACKLT | RESET | XXXXXX | MOUSE | XXXXXX | XXXXXX | XXXXXX | XXXXXX . XXXXXX | VOICE+ | XXXXXX | | ||
221 | |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | ||
222 | | XXXXXX | XXXXXX | XXXXXX | XXXXXX | UPPER | XXXXXX . XXXXXX | LOWER | XXXXXX | XXXXXX | XXXXXX | XXXXXX | TEMPO- | VOICE- | TEMPO+ | | ||
223 | '--------------------------------------------------------------------------------------------------------------------------------------' | ||
224 | */ | ||
225 | [LAYER_ADJUST] = LAYOUT_ortho_5x15( | ||
226 | XXXXXXX, M_HELP1, M_HELP2, M_HELP3, M_HELP4, M_HELP5, M_HELP6, M_HELP7, M_HELP8, M_HELP9, XXXXXXX, MU_TOG , AU_TOG , XXXXXXX, XXXXXXX, | ||
227 | XXXXXXX, M_BRTOG, M_BSPDU, M_BSPDD, M_BDFLT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
228 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
229 | XXXXXXX, M_QWRTY, XXXXXXX, XXXXXXX, M_BACKL, RESET , XXXXXXX, M_MOUSE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MUV_IN , XXXXXXX, | ||
230 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, M_UPPER, XXXXXXX, XXXXXXX, M_LOWER, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TMPO_DN, MUV_DE , TMPO_UP | ||
231 | ), | ||
232 | }; | ||
233 | |||
234 | #ifdef AUDIO_ENABLE | ||
235 | |||
236 | float tone_my_startup[][2] = SONG(ODE_TO_JOY); | ||
237 | float tone_my_goodbye[][2] = SONG(ROCK_A_BYE_BABY); | ||
238 | |||
239 | float tone_qwerty[][2] = SONG(QWERTY_SOUND); | ||
240 | float tone_dvorak[][2] = SONG(DVORAK_SOUND); | ||
241 | float tone_colemak[][2] = SONG(COLEMAK_SOUND); | ||
242 | |||
243 | float tone_audio_on[][2] = SONG(CLOSE_ENCOUNTERS_5_NOTE); | ||
244 | float tone_music_on[][2] = SONG(DOE_A_DEER); | ||
245 | float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); | ||
246 | |||
247 | float tone_caps_on[][2] = SONG(CAPS_LOCK_ON_SOUND); | ||
248 | float tone_caps_off[][2] = SONG(CAPS_LOCK_OFF_SOUND); | ||
249 | float tone_numlk_on[][2] = SONG(NUM_LOCK_ON_SOUND); | ||
250 | float tone_numlk_off[][2] = SONG(NUM_LOCK_OFF_SOUND); | ||
251 | float tone_scroll_on[][2] = SONG(SCROLL_LOCK_ON_SOUND); | ||
252 | float tone_scroll_off[][2] = SONG(SCROLL_LOCK_OFF_SOUND); | ||
253 | |||
254 | #endif /* AUDIO_ENABLE */ | ||
255 | |||
256 | void persistent_default_layer_set(uint16_t default_layer) { | ||
257 | eeconfig_update_default_layer(default_layer); | ||
258 | default_layer_set(default_layer); | ||
259 | } | ||
260 | |||
261 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { | ||
262 | |||
263 | // MACRODOWN only works in this function | ||
264 | switch(id) { | ||
265 | |||
266 | case MACRO_HELP_1: | ||
267 | if (record->event.pressed) | ||
268 | { | ||
269 | uprintf("1"); | ||
270 | } | ||
271 | break; | ||
272 | |||
273 | case MACRO_HELP_2: | ||
274 | if (record->event.pressed) | ||
275 | { | ||
276 | uprintf("2"); | ||
277 | } | ||
278 | break; | ||
279 | |||
280 | case MACRO_HELP_3: | ||
281 | if (record->event.pressed) | ||
282 | { | ||
283 | uprintf("3"); | ||
284 | } | ||
285 | break; | ||
286 | |||
287 | case MACRO_HELP_4: | ||
288 | if (record->event.pressed) | ||
289 | { | ||
290 | uprintf("4"); | ||
291 | } | ||
292 | break; | ||
293 | |||
294 | case MACRO_HELP_5: | ||
295 | if (record->event.pressed) | ||
296 | { | ||
297 | uprintf("5"); | ||
298 | } | ||
299 | break; | ||
300 | |||
301 | case MACRO_HELP_6: | ||
302 | if (record->event.pressed) | ||
303 | { | ||
304 | uprintf("6"); | ||
305 | } | ||
306 | break; | ||
307 | |||
308 | case MACRO_HELP_7: | ||
309 | if (record->event.pressed) | ||
310 | { | ||
311 | uprintf("7"); | ||
312 | } | ||
313 | break; | ||
314 | |||
315 | case MACRO_HELP_8: | ||
316 | if (record->event.pressed) | ||
317 | { | ||
318 | uprintf("8"); | ||
319 | } | ||
320 | break; | ||
321 | |||
322 | case MACRO_HELP_9: | ||
323 | if (record->event.pressed) | ||
324 | { | ||
325 | uprintf("9"); | ||
326 | } | ||
327 | break; | ||
328 | |||
329 | case MACRO_BREATH_TOGGLE: | ||
330 | if (record->event.pressed) | ||
331 | { | ||
332 | breathing_toggle(); | ||
333 | } | ||
334 | break; | ||
335 | |||
336 | case MACRO_BREATH_SPEED_INC: | ||
337 | if (record->event.pressed) | ||
338 | { | ||
339 | breathing_period_inc(); | ||
340 | } | ||
341 | break; | ||
342 | |||
343 | case MACRO_BREATH_SPEED_DEC: | ||
344 | if (record->event.pressed) | ||
345 | { | ||
346 | breathing_period_dec(); | ||
347 | } | ||
348 | break; | ||
349 | |||
350 | case MACRO_BREATH_DEFAULT: | ||
351 | if (record->event.pressed) | ||
352 | { | ||
353 | breathing_period_default(); | ||
354 | } | ||
355 | break; | ||
356 | |||
357 | case MACRO_QWERTY: | ||
358 | if (record->event.pressed) | ||
359 | { | ||
360 | persistent_default_layer_set(1UL<<LAYER_QWERTY); | ||
361 | } | ||
362 | break; | ||
363 | |||
364 | case MACRO_UPPER: | ||
365 | if (record->event.pressed) | ||
366 | { | ||
367 | layer_on(LAYER_UPPER); | ||
368 | breathing_period_set(2); | ||
369 | breathing_pulse(); | ||
370 | update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); | ||
371 | } | ||
372 | else | ||
373 | { | ||
374 | layer_off(LAYER_UPPER); | ||
375 | update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); | ||
376 | } | ||
377 | break; | ||
378 | |||
379 | case MACRO_LOWER: | ||
380 | if (record->event.pressed) | ||
381 | { | ||
382 | layer_on(LAYER_LOWER); | ||
383 | breathing_period_set(2); | ||
384 | breathing_pulse(); | ||
385 | update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); | ||
386 | } | ||
387 | else | ||
388 | { | ||
389 | layer_off(LAYER_LOWER); | ||
390 | update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); | ||
391 | } | ||
392 | break; | ||
393 | |||
394 | case MACRO_FUNCTION: | ||
395 | if (record->event.pressed) | ||
396 | { | ||
397 | breathing_period_set(3); | ||
398 | breathing_enable(); | ||
399 | layer_on(LAYER_FUNCTION); | ||
400 | } | ||
401 | else | ||
402 | { | ||
403 | breathing_period_set(1); | ||
404 | breathing_disable(); | ||
405 | layer_off(LAYER_FUNCTION); | ||
406 | } | ||
407 | break; | ||
408 | |||
409 | #ifdef MOUSEKEY_ENABLE | ||
410 | |||
411 | case MACRO_MOUSE: | ||
412 | if (record->event.pressed) | ||
413 | { | ||
414 | layer_invert(LAYER_MOUSE); | ||
415 | } | ||
416 | break; | ||
417 | |||
418 | #endif /* MOUSEKEY_ENABLE */ | ||
419 | |||
420 | #ifdef AUDIO_ENABLE | ||
421 | |||
422 | case MACRO_TIMBRE_1: | ||
423 | if (record->event.pressed) set_timbre(TIMBRE_12); | ||
424 | break; | ||
425 | |||
426 | case MACRO_TIMBRE_2: | ||
427 | if (record->event.pressed) set_timbre(TIMBRE_25); | ||
428 | break; | ||
429 | |||
430 | case MACRO_TIMBRE_3: | ||
431 | if (record->event.pressed) set_timbre(TIMBRE_50); | ||
432 | break; | ||
433 | |||
434 | case MACRO_TIMBRE_4: | ||
435 | if (record->event.pressed) set_timbre(TIMBRE_75); | ||
436 | break; | ||
437 | |||
438 | case MACRO_TEMPO_U: | ||
439 | if (record->event.pressed) increase_tempo(10); | ||
440 | break; | ||
441 | |||
442 | case MACRO_TEMPO_D: | ||
443 | if (record->event.pressed) decrease_tempo(10); | ||
444 | break; | ||
445 | |||
446 | case MACRO_TONE_DEFAULT: | ||
447 | if (record->event.pressed) | ||
448 | { | ||
449 | set_timbre(TIMBRE_DEFAULT); | ||
450 | set_tempo(TEMPO_DEFAULT); | ||
451 | } | ||
452 | break; | ||
453 | |||
454 | /* | ||
455 | case MACRO_AUDIO_TOGGLE: | ||
456 | if (record->event.pressed) | ||
457 | { | ||
458 | if (is_audio_on()) | ||
459 | { | ||
460 | audio_off(); | ||
461 | } | ||
462 | else | ||
463 | { | ||
464 | audio_on(); | ||
465 | PLAY_SONG(tone_audio_on); | ||
466 | } | ||
467 | } | ||
468 | break; | ||
469 | |||
470 | case MACRO_MUSIC_TOGGLE: | ||
471 | if (record->event.pressed) | ||
472 | { | ||
473 | if (IS_LAYER_ON(LAYER_MUSIC)) | ||
474 | { | ||
475 | layer_off(LAYER_MUSIC); | ||
476 | stop_all_notes(); | ||
477 | } | ||
478 | else | ||
479 | { | ||
480 | PLAY_SONG(tone_music_on); | ||
481 | layer_on(LAYER_MUSIC); | ||
482 | } | ||
483 | } | ||
484 | break; | ||
485 | case MACRO_INC_VOICE: | ||
486 | if (record->event.pressed) | ||
487 | { | ||
488 | #ifdef AUDIO_ENABLE | ||
489 | voice_iterate(); | ||
490 | PLAY_SONG(music_scale); | ||
491 | #endif | ||
492 | } | ||
493 | break; | ||
494 | |||
495 | case MACRO_DEC_VOICE: | ||
496 | if (record->event.pressed) | ||
497 | { | ||
498 | #ifdef AUDIO_ENABLE | ||
499 | voice_deiterate(); | ||
500 | PLAY_SONG(music_scale); | ||
501 | #endif | ||
502 | } | ||
503 | break; | ||
504 | */ | ||
505 | |||
506 | #endif /* AUDIO_ENABLE */ | ||
507 | |||
508 | #ifdef BACKLIGHT_ENABLE | ||
509 | case MACRO_BACKLIGHT: | ||
510 | if (record->event.pressed) | ||
511 | { | ||
512 | backlight_step(); | ||
513 | } | ||
514 | #endif | ||
515 | |||
516 | default: | ||
517 | break; | ||
518 | |||
519 | } | ||
520 | return MACRO_NONE; | ||
521 | }; | ||
522 | |||
523 | |||
524 | #ifdef AUDIO_ENABLE | ||
525 | |||
526 | void matrix_init_user(void) | ||
527 | { | ||
528 | set_voice(default_voice); | ||
529 | startup_user(); | ||
530 | println("Matrix Init"); | ||
531 | } | ||
532 | |||
533 | void led_set_user(uint8_t usb_led) | ||
534 | { | ||
535 | static uint8_t old_usb_led = 0; | ||
536 | |||
537 | _delay_ms(10); // gets rid of tick | ||
538 | |||
539 | if (!is_playing_notes()) | ||
540 | { | ||
541 | if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK))) | ||
542 | { | ||
543 | // If CAPS LK LED is turning on... | ||
544 | PLAY_SONG(tone_caps_on); | ||
545 | } | ||
546 | else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK))) | ||
547 | { | ||
548 | // If CAPS LK LED is turning off... | ||
549 | PLAY_SONG(tone_caps_off); | ||
550 | } | ||
551 | else if ((usb_led & (1<<USB_LED_NUM_LOCK)) && !(old_usb_led & (1<<USB_LED_NUM_LOCK))) | ||
552 | { | ||
553 | // If NUM LK LED is turning on... | ||
554 | PLAY_SONG(tone_numlk_on); | ||
555 | } | ||
556 | else if (!(usb_led & (1<<USB_LED_NUM_LOCK)) && (old_usb_led & (1<<USB_LED_NUM_LOCK))) | ||
557 | { | ||
558 | // If NUM LED is turning off... | ||
559 | PLAY_SONG(tone_numlk_off); | ||
560 | } | ||
561 | else if ((usb_led & (1<<USB_LED_SCROLL_LOCK)) && !(old_usb_led & (1<<USB_LED_SCROLL_LOCK))) | ||
562 | { | ||
563 | // If SCROLL LK LED is turning on... | ||
564 | PLAY_SONG(tone_scroll_on); | ||
565 | } | ||
566 | else if (!(usb_led & (1<<USB_LED_SCROLL_LOCK)) && (old_usb_led & (1<<USB_LED_SCROLL_LOCK))) | ||
567 | { | ||
568 | // If SCROLL LED is turning off... | ||
569 | PLAY_SONG(tone_scroll_off); | ||
570 | } | ||
571 | } | ||
572 | |||
573 | old_usb_led = usb_led; | ||
574 | } | ||
575 | |||
576 | |||
577 | void startup_user() | ||
578 | { | ||
579 | _delay_ms(10); // gets rid of tick | ||
580 | PLAY_SONG(tone_my_startup); | ||
581 | } | ||
582 | |||
583 | void shutdown_user() | ||
584 | { | ||
585 | PLAY_SONG(tone_my_goodbye); | ||
586 | _delay_ms(2000); | ||
587 | stop_all_notes(); | ||
588 | } | ||
589 | |||
590 | void audio_on_user(void) | ||
591 | { | ||
592 | PLAY_SONG(tone_audio_on); | ||
593 | } | ||
594 | |||
595 | void music_on_user(void) | ||
596 | { | ||
597 | PLAY_SONG(tone_music_on); | ||
598 | } | ||
599 | |||
600 | void music_scale_user(void) | ||
601 | { | ||
602 | PLAY_SONG(music_scale); | ||
603 | } | ||
604 | |||
605 | #endif /* AUDIO_ENABLE */ | ||