summaryrefslogtreecommitdiff
path: root/keyboards/clueboard/card/keymaps/default/keymap.c
blob: 23ff1c4ec21e9134590310d10f26ede8806de0f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include QMK_KEYBOARD_H

enum custom_keycodes {
	SONG_SU = SAFE_RANGE,
	SONG_SC,
	SONG_GB
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
	[0] = LAYOUT(
		RGB_TOG,        RGB_SAI,        RGB_VAI, \
		        RGB_HUD,        RGB_HUI,         \
		RGB_MOD,        RGB_SAD,        RGB_VAD, \
		BL_STEP,                                 \
		SONG_SU,SONG_SC,SONG_GB                  \
	)
};

#ifdef AUDIO_ENABLE

float tone_startup[][2] = SONG(STARTUP_SOUND);
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
float tone_plover[][2] = SONG(PLOVER_SOUND);
float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);

float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  switch (keycode) {
#ifdef AUDIO_ENABLE
    case SONG_SU:
      if (record->event.pressed) {
        PLAY_SONG(tone_startup);
      }

      return false;

    case SONG_SC:
      if (record->event.pressed) {
        PLAY_SONG(music_scale);
      }

      return false;

    case SONG_GB:
      if (record->event.pressed) {
        PLAY_SONG(tone_goodbye);
      }

      return false;
#endif
    default:
      return true;
  }
}