aboutsummaryrefslogtreecommitdiff
path: root/keyboards/clueboard/card/keymaps/default/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/clueboard/card/keymaps/default/keymap.c')
-rw-r--r--keyboards/clueboard/card/keymaps/default/keymap.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/keyboards/clueboard/card/keymaps/default/keymap.c b/keyboards/clueboard/card/keymaps/default/keymap.c
new file mode 100644
index 000000000..84b7d61ac
--- /dev/null
+++ b/keyboards/clueboard/card/keymaps/default/keymap.c
@@ -0,0 +1,59 @@
1#include QMK_KEYBOARD_H
2
3enum custom_keycodes {
4 SONG_SU = SAFE_RANGE,
5 SONG_SC,
6 SONG_GB
7};
8
9const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
10 [0] = LAYOUT(
11 RGB_TOG, RGB_SAI, RGB_VAI,
12 RGB_HUD, RGB_HUI,
13 RGB_MOD, RGB_SAD, RGB_VAD,
14 BL_STEP,
15 SONG_SU,SONG_SC,SONG_GB
16 )
17};
18
19#ifdef AUDIO_ENABLE
20
21float tone_startup[][2] = SONG(STARTUP_SOUND);
22float tone_qwerty[][2] = SONG(QWERTY_SOUND);
23float tone_dvorak[][2] = SONG(DVORAK_SOUND);
24float tone_colemak[][2] = SONG(COLEMAK_SOUND);
25float tone_plover[][2] = SONG(PLOVER_SOUND);
26float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
27float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
28
29float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
30#endif
31
32bool process_record_user(uint16_t keycode, keyrecord_t *record) {
33 switch (keycode) {
34#ifdef AUDIO_ENABLE
35 case SONG_SU:
36 if (record->event.pressed) {
37 PLAY_SONG(tone_startup);
38 }
39
40 return false;
41
42 case SONG_SC:
43 if (record->event.pressed) {
44 PLAY_SONG(music_scale);
45 }
46
47 return false;
48
49 case SONG_GB:
50 if (record->event.pressed) {
51 PLAY_SONG(tone_goodbye);
52 }
53
54 return false;
55#endif
56 default:
57 return true;
58 }
59}