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.

111 lines
3.2 KiB

6 years ago
6 years ago
6 years ago
  1. #include "_qmk_handwire.h"
  2. #define _______ KC_TRNS
  3. enum keyboard_layers {
  4. _BL,
  5. _FL,
  6. _CL
  7. };
  8. enum custom_keycodes {
  9. S_BSKTC = SAFE_RANGE,
  10. S_ODEJY,
  11. S_RCKBY,
  12. S_DOEDR,
  13. S_SCALE,
  14. S_ONEUP,
  15. S_COIN,
  16. S_SONIC,
  17. S_ZELDA
  18. };
  19. #ifdef AUDIO_ENABLE
  20. float song_basketcase[][2] = SONG(BASKET_CASE);
  21. float song_ode_to_joy[][2] = SONG(ODE_TO_JOY);
  22. float song_rock_a_bye_baby[][2] = SONG(ROCK_A_BYE_BABY);
  23. float song_doe_a_deer[][2] = SONG(DOE_A_DEER);
  24. float song_scale[][2] = SONG(MUSIC_SCALE_SOUND);
  25. float song_coin[][2] = SONG(COIN_SOUND);
  26. float song_one_up[][2] = SONG(ONE_UP_SOUND);
  27. float song_sonic_ring[][2] = SONG(SONIC_RING);
  28. float song_zelda_puzzle[][2] = SONG(ZELDA_PUZZLE);
  29. #endif
  30. const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  31. [0] = KEYMAP(
  32. RESET, KC_1, KC_2, KC_3, KC_4, KC_0, KC_DEL,
  33. KC_TAB, DEBUG, KC_W, KC_E, KC_R, KC_T, KC_HOME,
  34. KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_END,
  35. KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_N,
  36. KC_RCTL, KC_LEFT, KC_DOWN, KC_UP, KC_LGUI,
  37. KC_SPC, MO(2), MO(1),
  38. KC_INS, KC_6, KC_7, KC_8, KC_9, KC_0, RESET,
  39. KC_PGUP, KC_Y, KC_U, KC_I, KC_O, DEBUG, KC_DEL,
  40. KC_PGDN, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_QUOT,
  41. KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
  42. KC_RCTL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT,
  43. MO(2), MO(1), KC_SPC
  44. )
  45. };
  46. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  47. switch (keycode) {
  48. case S_BSKTC:
  49. if (record->event.pressed) {
  50. stop_all_notes();
  51. PLAY_SONG(song_basketcase);
  52. }
  53. return false;
  54. case S_ODEJY:
  55. if (record->event.pressed) {
  56. stop_all_notes();
  57. PLAY_SONG(song_ode_to_joy);
  58. }
  59. return false;
  60. case S_RCKBY:
  61. if (record->event.pressed) {
  62. stop_all_notes();
  63. PLAY_SONG(song_rock_a_bye_baby);
  64. }
  65. return false;
  66. case S_DOEDR:
  67. if (record->event.pressed) {
  68. stop_all_notes();
  69. PLAY_SONG(song_doe_a_deer);
  70. }
  71. return false;
  72. case S_SCALE:
  73. if (record->event.pressed) {
  74. stop_all_notes();
  75. PLAY_SONG(song_scale);
  76. }
  77. return false;
  78. case S_ONEUP:
  79. if (record->event.pressed) {
  80. stop_all_notes();
  81. PLAY_SONG(song_one_up);
  82. }
  83. return false;
  84. case S_COIN:
  85. if (record->event.pressed) {
  86. stop_all_notes();
  87. PLAY_SONG(song_coin);
  88. }
  89. return false;
  90. case S_SONIC:
  91. if (record->event.pressed) {
  92. stop_all_notes();
  93. PLAY_SONG(song_sonic_ring);
  94. }
  95. return false;
  96. case S_ZELDA:
  97. if (record->event.pressed) {
  98. stop_all_notes();
  99. PLAY_SONG(song_zelda_puzzle);
  100. }
  101. return false;
  102. }
  103. return true;
  104. }