drashna.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. /*
  2. Copyright 2017 Christopher Courtney <drashna@live.com> @drashna
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #include "drashna.h"
  15. #include "version.h"
  16. #if (__has_include("secrets.h") && !defined(NO_SECRETS))
  17. #include "secrets.h"
  18. #else
  19. // `PROGMEM const char secret[][x]` may work better, but it takes up more space in the firmware
  20. // And I'm not familiar enough to know which is better or why...
  21. PROGMEM const char secret[][64] = {
  22. "test1",
  23. "test2",
  24. "test3",
  25. "test4",
  26. "test5"
  27. };
  28. #endif
  29. float tone_copy[][2] = SONG(SCROLL_LOCK_ON_SOUND);
  30. float tone_paste[][2] = SONG(SCROLL_LOCK_OFF_SOUND);
  31. static uint16_t copy_paste_timer;
  32. #ifdef RGBLIGHT_ENABLE
  33. bool rgb_layer_change = true;
  34. #endif
  35. userspace_config_t userspace_config;
  36. // Helper Functions
  37. void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); };
  38. #ifdef RGBLIGHT_ENABLE
  39. void rgblight_sethsv_default_helper(uint8_t index) {
  40. uint8_t default_layer = eeconfig_read_default_layer();
  41. if (default_layer & (1UL << _COLEMAK)) {
  42. rgblight_sethsv_at(300, 255, 255, index);
  43. rgblight_sethsv_at(300, 255, 255, index);
  44. }
  45. else if (default_layer & (1UL << _DVORAK)) {
  46. rgblight_sethsv_at(120, 255, 255, index);
  47. rgblight_sethsv_at(120, 255, 255, index);
  48. }
  49. else if (default_layer & (1UL << _WORKMAN)) {
  50. rgblight_sethsv_at(43, 255, 255, index);
  51. rgblight_sethsv_at(43, 255, 255, index);
  52. }
  53. else {
  54. rgblight_sethsv_at(180, 255, 255, index);
  55. rgblight_sethsv_at(180, 255, 255, index);
  56. }
  57. }
  58. #endif // RGBLIGHT_ENABLE
  59. // ========================================= TAP DANCE =========================================
  60. #ifdef TAP_DANCE_ENABLE
  61. //define diablo macro timer variables
  62. static uint16_t diablo_timer[4];
  63. static uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 };
  64. static uint8_t diablo_key_time[4];
  65. // has the correct number of seconds elapsed (as defined by diablo_times)
  66. bool check_dtimer(uint8_t dtimer) { return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; };
  67. // Cycle through the times for the macro, starting at 0, for disabled.
  68. // Max of six values, so don't exceed
  69. void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) {
  70. if (state->count >= 7) {
  71. diablo_key_time[diablo_key] = diablo_times[0];
  72. reset_tap_dance(state);
  73. } else {
  74. diablo_key_time[diablo_key] = diablo_times[state->count - 1];
  75. }
  76. }
  77. // Would rather have one function for all of this, but no idea how to do that...
  78. void diablo_tapdance1(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 0); }
  79. void diablo_tapdance2(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 1); }
  80. void diablo_tapdance3(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 2); }
  81. void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 3); }
  82. //Tap Dance Definitions
  83. qk_tap_dance_action_t tap_dance_actions[] = {
  84. // tap once to disable, and more to enable timed micros
  85. [TD_D3_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1),
  86. [TD_D3_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2),
  87. [TD_D3_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3),
  88. [TD_D3_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4),
  89. };
  90. // Sends the key press to system, but only if on the Diablo layer
  91. void send_diablo_keystroke(uint8_t diablo_key) {
  92. if (biton32(layer_state) == _DIABLO) {
  93. switch (diablo_key) {
  94. case 0:
  95. tap(KC_1); break;
  96. case 1:
  97. tap(KC_2); break;
  98. case 2:
  99. tap(KC_3); break;
  100. case 3:
  101. tap(KC_4); break;
  102. }
  103. }
  104. }
  105. // Checks each of the 4 timers/keys to see if enough time has elapsed
  106. // Runs the "send string" command if enough time has passed, and resets the timer.
  107. void run_diablo_macro_check(void) {
  108. uint8_t dtime;
  109. for (dtime = 0; dtime < 4; dtime++) {
  110. if (check_dtimer(dtime) && diablo_key_time[dtime]) {
  111. diablo_timer[dtime] = timer_read();
  112. send_diablo_keystroke(dtime);
  113. }
  114. }
  115. }
  116. #endif // TAP_DANCE_ENABLE
  117. // Add reconfigurable functions here, for keymap customization
  118. // This allows for a global, userspace functions, and continued
  119. // customization of the keymap. Use _keymap instead of _user
  120. // functions in the keymaps
  121. __attribute__ ((weak))
  122. void matrix_init_keymap(void) {}
  123. __attribute__ ((weak))
  124. void matrix_scan_keymap(void) {}
  125. __attribute__ ((weak))
  126. bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
  127. return true;
  128. }
  129. __attribute__ ((weak))
  130. uint32_t layer_state_set_keymap (uint32_t state) {
  131. return state;
  132. }
  133. __attribute__ ((weak))
  134. void led_set_keymap(uint8_t usb_led) {}
  135. // Call user matrix init, set default RGB colors and then
  136. // call the keymap's init function
  137. void matrix_init_user(void) {
  138. uint8_t default_layer = eeconfig_read_default_layer();
  139. #ifdef RGBLIGHT_ENABLE
  140. rgblight_enable();
  141. #endif // RGBLIGHT_ENABLE
  142. if (default_layer & (1UL << _COLEMAK)) {
  143. #ifdef RGBLIGHT_ENABLE
  144. rgblight_sethsv_magenta();
  145. #endif // RGBLIGHT_ENABLE
  146. } else if (default_layer & (1UL << _DVORAK)) {
  147. #ifdef RGBLIGHT_ENABLE
  148. rgblight_sethsv_green();
  149. #endif // RGBLIGHT_ENABLE
  150. } else if (default_layer & (1UL << _WORKMAN)) {
  151. #ifdef RGBLIGHT_ENABLE
  152. rgblight_sethsv_goldenrod();
  153. #endif // RGBLIGHT_ENABLE
  154. } else {
  155. #ifdef RGBLIGHT_ENABLE
  156. rgblight_sethsv_teal();
  157. #endif // RGBLIGHT_ENABLE
  158. }
  159. userspace_config.raw = eeprom_read_byte(EECONFIG_USERSPACE);
  160. clicky_enable = userspace_config.clicky_enable;
  161. #if ( defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE) )
  162. set_unicode_input_mode(UC_WINC);
  163. #endif //UNICODE_ENABLE
  164. matrix_init_keymap();
  165. }
  166. // No global matrix scan code, so just run keymap's matrix
  167. // scan function
  168. void matrix_scan_user(void) {
  169. #ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code.
  170. run_diablo_macro_check();
  171. #endif // TAP_DANCE_ENABLE
  172. matrix_scan_keymap();
  173. }
  174. // This block is for all of the gaming macros, as they were all doing
  175. // the same thing, but with differring text sent.
  176. bool send_game_macro(const char *str, keyrecord_t *record, bool override) {
  177. if (!record->event.pressed || override) {
  178. clear_keyboard();
  179. tap(userspace_config.is_overwatch ? KC_BSPC : KC_ENTER);
  180. wait_ms(50);
  181. send_string(str);
  182. wait_ms(50);
  183. tap(KC_ENTER);
  184. }
  185. if (override) wait_ms(3000);
  186. return false;
  187. }
  188. // Defines actions tor my global custom keycodes. Defined in drashna.h file
  189. // Then runs the _keymap's record handier if not processed here
  190. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  191. // If console is enabled, it will print the matrix position and status of each key pressed
  192. #ifdef CONSOLE_ENABLE
  193. xprintf("KL: row: %u, column: %u, pressed: %u\n", record->event.key.col, record->event.key.row, record->event.pressed);
  194. #endif //CONSOLE_ENABLE
  195. switch (keycode) {
  196. case KC_QWERTY:
  197. if (record->event.pressed) {
  198. set_single_persistent_default_layer(_QWERTY);
  199. }
  200. return false;
  201. break;
  202. case KC_COLEMAK:
  203. if (record->event.pressed) {
  204. set_single_persistent_default_layer(_COLEMAK);
  205. }
  206. return false;
  207. break;
  208. case KC_DVORAK:
  209. if (record->event.pressed) {
  210. set_single_persistent_default_layer(_DVORAK);
  211. }
  212. return false;
  213. break;
  214. case KC_WORKMAN:
  215. if (record->event.pressed) {
  216. set_single_persistent_default_layer(_WORKMAN);
  217. }
  218. return false;
  219. break;
  220. case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
  221. if (!record->event.pressed) {
  222. SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP
  223. #if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU))
  224. ":dfu"
  225. #elif defined(BOOTLOADER_HALFKAY)
  226. ":teensy"
  227. #elif defined(BOOTLOADER_CATERINA)
  228. ":avrdude"
  229. #endif // bootloader options
  230. SS_TAP(X_ENTER));
  231. }
  232. return false;
  233. break;
  234. case KC_RESET: // Custom RESET code that sets RGBLights to RED
  235. if (!record->event.pressed) {
  236. #ifdef RGBLIGHT_ENABLE
  237. rgblight_enable();
  238. rgblight_mode(1);
  239. rgblight_setrgb_red();
  240. #endif // RGBLIGHT_ENABLE
  241. reset_keyboard();
  242. }
  243. return false;
  244. break;
  245. case EPRM: // Resets EEPROM
  246. if (record->event.pressed) {
  247. eeconfig_init();
  248. }
  249. return false;
  250. break;
  251. case VRSN: // Prints firmware version
  252. if (record->event.pressed) {
  253. SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE);
  254. }
  255. return false;
  256. break;
  257. case KC_SECRET_1 ... KC_SECRET_5: // Secrets! Externally defined strings, not stored in repo
  258. if (!record->event.pressed) {
  259. clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
  260. send_string_P(secret[keycode - KC_SECRET_1]);
  261. }
  262. return false;
  263. break;
  264. // These are a serious of gaming macros.
  265. // Only enables for the viterbi, basically,
  266. // to save on firmware space, since it's limited.
  267. #if !(defined(KEYBOARD_orthodox_rev1) || defined(KEYBOARD_orthodox_rev3) || defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_iris_rev2))
  268. case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros
  269. if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeprom_update_byte(EECONFIG_USERSPACE, userspace_config.raw); }
  270. #ifdef RGBLIGHT_ENABLE
  271. userspace_config.is_overwatch ? rgblight_mode(17) : rgblight_mode(18);
  272. #endif //RGBLIGHT_ENABLE
  273. return false; break;
  274. case KC_SALT:
  275. return send_game_macro("Salt, salt, salt...", record, false);
  276. case KC_MORESALT:
  277. return send_game_macro("Please sir, can I have some more salt?!", record, false);
  278. case KC_SALTHARD:
  279. return send_game_macro("Your salt only makes me harder, and even more aggressive!", record, false);
  280. case KC_GOODGAME:
  281. return send_game_macro("Good game, everyone!", record, false);
  282. case KC_GLHF:
  283. return send_game_macro("Good luck, have fun!!!", record, false);
  284. case KC_SYMM:
  285. return send_game_macro("Left click to win!", record, false);
  286. case KC_JUSTGAME:
  287. return send_game_macro("It may be a game, but if you don't want to actually try, please go play AI, so that people that actually want to take the game seriously and \"get good\" have a place to do so without trolls like you throwing games.", record, false);
  288. case KC_TORB:
  289. return send_game_macro("That was positively riveting!", record, false);
  290. case KC_AIM:
  291. send_game_macro("That aim is absolutely amazing. It's almost like you're a machine!", record, true);
  292. return send_game_macro("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!", record, false);
  293. case KC_C9:
  294. return send_game_macro("OMG!!! C9!!!", record, false);
  295. case KC_GGEZ:
  296. return send_game_macro("That was a fantastic game, though it was a bit easy. Try harder next time!", record, false);
  297. #endif // !(defined(KEYBOARD_orthodox_rev1) || defined(KEYBOARD_orthodox_rev3) || defined(KEYBOARD_ergodox_ez))
  298. #ifdef TAP_DANCE_ENABLE
  299. case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them
  300. if (record->event.pressed) {
  301. uint8_t dtime;
  302. for (dtime = 0; dtime < 4; dtime++) {
  303. diablo_key_time[dtime] = diablo_times[0];
  304. }
  305. }
  306. return false; break;
  307. #endif // TAP_DANCE_ENABLE
  308. case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal
  309. #ifdef RGBLIGHT_ENABLE
  310. if (record->event.pressed) {
  311. rgb_layer_change = !rgb_layer_change;
  312. if (rgb_layer_change) {
  313. layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better)
  314. }
  315. }
  316. #endif // RGBLIGHT_ENABLE
  317. return false; break;
  318. #ifdef RGBLIGHT_ENABLE
  319. case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions
  320. if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled
  321. rgb_layer_change = false;
  322. }
  323. return true; break;
  324. #endif // RGBLIGHT_ENABLE
  325. case KC_CCCV: // One key copy/paste
  326. if(record->event.pressed){
  327. copy_paste_timer = timer_read();
  328. } else {
  329. if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy
  330. register_code(KC_LCTL);
  331. tap(KC_C);
  332. unregister_code(KC_LCTL);
  333. #ifdef AUDIO_ENABLE
  334. PLAY_SONG(tone_copy);
  335. #endif
  336. } else { // Tap, paste
  337. register_code(KC_LCTL);
  338. tap(KC_V);
  339. unregister_code(KC_LCTL);
  340. #ifdef AUDIO_ENABLE
  341. PLAY_SONG(tone_paste);
  342. #endif
  343. }
  344. }
  345. return false;
  346. break;
  347. case CLICKY_TOGGLE:
  348. userspace_config.clicky_enable = clicky_enable;
  349. eeprom_update_byte(EECONFIG_USERSPACE, userspace_config.raw);
  350. break;
  351. #ifdef UNICODE_ENABLE
  352. case UC_FLIP: // (╯°□°)╯ ︵ ┻━┻
  353. if (record->event.pressed) {
  354. register_code(KC_RSFT);
  355. tap(KC_9);
  356. unregister_code(KC_RSFT);
  357. process_unicode((0x256F | QK_UNICODE), record); // Arm
  358. process_unicode((0x00B0 | QK_UNICODE), record); // Eye
  359. process_unicode((0x25A1 | QK_UNICODE), record); // Mouth
  360. process_unicode((0x00B0 | QK_UNICODE), record); // Eye
  361. register_code(KC_RSFT);
  362. tap(KC_0);
  363. unregister_code(KC_RSFT);
  364. process_unicode((0x256F | QK_UNICODE), record); // Arm
  365. tap(KC_SPC);
  366. process_unicode((0x0361 | QK_UNICODE), record); // Flippy
  367. tap(KC_SPC);
  368. process_unicode((0x253B | QK_UNICODE), record); // Table
  369. process_unicode((0x2501 | QK_UNICODE), record); // Table
  370. process_unicode((0x253B | QK_UNICODE), record); // Table
  371. }
  372. return false;
  373. break;
  374. #endif // UNICODE_ENABLE
  375. }
  376. return process_record_keymap(keycode, record);
  377. }
  378. // Runs state check and changes underglow color and animation
  379. // on layer change, no matter where the change was initiated
  380. // Then runs keymap's layer change check
  381. uint32_t layer_state_set_user(uint32_t state) {
  382. uint8_t default_layer = eeconfig_read_default_layer();
  383. state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
  384. switch (biton32(state)) {
  385. case _NAV:
  386. #ifdef RGBLIGHT_ENABLE
  387. if (rgb_layer_change) {
  388. rgblight_sethsv_blue();
  389. rgblight_mode(1);
  390. }
  391. #endif // RGBLIGHT_ENABLE
  392. break;
  393. case _SYMB:
  394. #ifdef RGBLIGHT_ENABLE
  395. if (rgb_layer_change) {
  396. rgblight_sethsv_blue();
  397. rgblight_mode(2);
  398. }
  399. #endif // RGBLIGHT_ENABLE
  400. break;
  401. case _MOUS:
  402. #ifdef RGBLIGHT_ENABLE
  403. if (rgb_layer_change) {
  404. rgblight_sethsv_yellow();
  405. rgblight_mode(1);
  406. }
  407. #endif // RGBLIGHT_ENABLE
  408. break;
  409. case _MACROS:
  410. #ifdef RGBLIGHT_ENABLE
  411. if (rgb_layer_change) {
  412. rgblight_sethsv_orange();
  413. userspace_config.is_overwatch ? rgblight_mode(17) : rgblight_mode(18);
  414. }
  415. #endif // RGBLIGHT_ENABLE
  416. break;
  417. case _MEDIA:
  418. #ifdef RGBLIGHT_ENABLE
  419. if (rgb_layer_change) {
  420. rgblight_sethsv_chartreuse();
  421. rgblight_mode(22);
  422. }
  423. #endif // RGBLIGHT_ENABLE
  424. break;
  425. case _GAMEPAD:
  426. #ifdef RGBLIGHT_ENABLE
  427. if (rgb_layer_change) {
  428. rgblight_sethsv_orange();
  429. rgblight_mode(17);
  430. }
  431. #endif // RGBLIGHT_ENABLE
  432. break;
  433. case _DIABLO:
  434. #ifdef RGBLIGHT_ENABLE
  435. if (rgb_layer_change) {
  436. rgblight_sethsv_red();
  437. rgblight_mode(5);
  438. }
  439. #endif // RGBLIGHT_ENABLE
  440. break;
  441. case _RAISE:
  442. #ifdef RGBLIGHT_ENABLE
  443. if (rgb_layer_change) {
  444. rgblight_sethsv_yellow();
  445. rgblight_mode(5);
  446. }
  447. #endif // RGBLIGHT_ENABLE
  448. break;
  449. case _LOWER:
  450. #ifdef RGBLIGHT_ENABLE
  451. if (rgb_layer_change) {
  452. rgblight_sethsv_orange();
  453. rgblight_mode(5);
  454. }
  455. #endif // RGBLIGHT_ENABLE
  456. break;
  457. case _ADJUST:
  458. #ifdef RGBLIGHT_ENABLE
  459. if (rgb_layer_change) {
  460. rgblight_sethsv_red();
  461. rgblight_mode(23);
  462. }
  463. #endif // RGBLIGHT_ENABLE
  464. break;
  465. case _COVECUBE:
  466. #ifdef RGBLIGHT_ENABLE
  467. if (rgb_layer_change) {
  468. rgblight_sethsv_green();
  469. rgblight_mode(2);
  470. }
  471. #endif // RGBLIGHT_ENABLE
  472. break;
  473. default: // for any other layers, or the default layer
  474. if (default_layer & (1UL << _COLEMAK)) {
  475. #ifdef RGBLIGHT_ENABLE
  476. if (rgb_layer_change) { rgblight_sethsv_magenta(); }
  477. #endif // RGBLIGHT_ENABLE
  478. }
  479. else if (default_layer & (1UL << _DVORAK)) {
  480. #ifdef RGBLIGHT_ENABLE
  481. if (rgb_layer_change) { rgblight_sethsv_green(); }
  482. #endif // RGBLIGHT_ENABLE
  483. }
  484. else if (default_layer & (1UL << _WORKMAN)) {
  485. #ifdef RGBLIGHT_ENABLE
  486. if (rgb_layer_change) { rgblight_sethsv_goldenrod(); }
  487. #endif // RGBLIGHT_ENABLE
  488. }
  489. else {
  490. #ifdef RGBLIGHT_ENABLE
  491. if (rgb_layer_change) { rgblight_sethsv_teal(); }
  492. #endif // RGBLIGHT_ENABLE
  493. }
  494. if (biton32(state) == _MODS) { // If the non-OSM layer is enabled, then breathe
  495. #ifdef RGBLIGHT_ENABLE
  496. if (rgb_layer_change) { rgblight_mode(2); }
  497. #endif // RGBLIGHT_ENABLE
  498. } else { // otherwise, stay solid
  499. #ifdef RGBLIGHT_ENABLE
  500. if (rgb_layer_change) { rgblight_mode(1); }
  501. #endif // RGBLIGHT_ENABLE
  502. }
  503. break;
  504. }
  505. return layer_state_set_keymap (state);
  506. }
  507. // Any custom LED code goes here.
  508. // So far, I only have keyboard specific code,
  509. // So nothing goes here.
  510. void led_set_user(uint8_t usb_led) {
  511. led_set_keymap(usb_led);
  512. }