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.

421 lines
24 KiB

  1. #include QMK_KEYBOARD_H
  2. // Include for debugging.
  3. #include <print.h>
  4. #define MILLISECONDS_IN_SECOND 1000
  5. //========================================================== CONFIGURABLE DEFAULTS ==========================================================
  6. #define RGB_DEFAULT_TIME_OUT 30
  7. #define RGB_FAST_MODE_TIME_OUT 3
  8. #define RGB_TIME_OUT_MAX 600
  9. #define RGB_TIME_OUT_MIN 10
  10. #define RGB_TIME_OUT_STEP 10
  11. static uint16_t idle_timer; // Idle LED timeout timer
  12. static uint8_t idle_second_counter; // Idle LED seconds counter, counts seconds not milliseconds
  13. bool rgb_enabled_flag; // Current LED state flag. If false then LED is off.
  14. bool rgb_time_out_enable; // Idle LED toggle enable. If false then LED will not turn off after idle timeout.
  15. bool rgb_time_out_fast_mode_enabled;
  16. bool rgb_time_out_user_value; // This holds the toggle value set by user with ROUT_TG. It's necessary as RGB_TOG changes timeout enable.
  17. uint16_t rgb_time_out_seconds; // Idle LED timeout value, in seconds not milliseconds
  18. uint16_t rgb_time_out_saved_seconds;
  19. led_flags_t rgb_time_out_saved_flag; // Store LED flag before timeout so it can be restored when LED is turned on again.
  20. enum tapdance_keycodes {
  21. TD_GUI_ML = 0, // Tap dance key to switch to mouse layer _ML
  22. TD_LCTRL_TERM,
  23. TD_RCTRL_TERM,
  24. };
  25. enum ctrl_keycodes {
  26. U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active
  27. U_T_AGCR, //USB Toggle Automatic GCR control
  28. DBG_TOG, //DEBUG Toggle On / Off
  29. DBG_MTRX, //DEBUG Toggle Matrix Prints
  30. DBG_KBD, //DEBUG Toggle Keyboard Prints
  31. DBG_MOU, //DEBUG Toggle Mouse Prints
  32. MD_BOOT, //Restart into bootloader after hold timeout
  33. SEL_CPY, //Select Copy. Select the word cursor is pointed at and copy, using double mouse click and ctrl+c
  34. ROUT_TG, //Timeout Toggle. Toggle idle LED time out on or off
  35. ROUT_VI, //Timeout Value Increase. Increase idle time out before LED disabled
  36. ROUT_VD, //Timeout Value Decrease. Decrease idle time out before LED disabled
  37. ROUT_FM, //RGB timeout fast mode toggle
  38. COPY_ALL, //Copy all text using ctrl(a+c)
  39. TERMINAL,
  40. };
  41. enum layout_names {
  42. _KL=0, // Keys Layout: The main keyboard layout that has all the characters
  43. _FL, // Function Layout: The function key activated layout with default functions and some added ones
  44. _ML, // Mouse Layout: Mouse Keys and mouse movement
  45. _VL, // VIM Layout: VIM shorcuts and macros
  46. _GL, // GIT Layout: GIT shortcuts and macros
  47. _YL, // Yakuake Layout: Yakuake drop-down terminal shortcuts and macros
  48. _EL, // KDE Layout: Shortcuts for KDE desktop using default KDE shortcuts settings
  49. };
  50. //Associate our tap dance key with its functionality
  51. qk_tap_dance_action_t tap_dance_actions[] = {
  52. [TD_GUI_ML] = ACTION_TAP_DANCE_LAYER_TOGGLE(KC_LGUI, _ML),
  53. [TD_LCTRL_TERM] = ACTION_TAP_DANCE_DOUBLE(KC_LCTRL, LCA(KC_T)),
  54. [TD_RCTRL_TERM] = ACTION_TAP_DANCE_DOUBLE(KC_RCTRL, LCA(KC_T)),
  55. };
  56. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  57. /*
  58. [DEFAULT] = LAYOUT(
  59. KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS,
  60. KC_GRV, 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_INS, KC_HOME, KC_PGUP,
  61. 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, KC_END, KC_PGDN,
  62. 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,
  63. 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_UP,
  64. KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
  65. ),
  66. */
  67. [_KL] = LAYOUT(
  68. KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS,
  69. KC_GRV, 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_INS, KC_HOME, KC_PGUP,
  70. 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, KC_END, KC_PGDN,
  71. 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,
  72. KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_SFTENT, KC_UP,
  73. TD(TD_LCTRL_TERM), TD(TD_GUI_ML), KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
  74. ),
  75. [_FL] = LAYOUT(
  76. _______, DM_PLY1, DM_PLY2, _______, _______, DM_REC1, DM_REC2, _______, _______, DM_RSTP, _______, KC_WAKE, KC_SLEP, KC_MUTE, _______, _______,
  77. _______, RGB_M_P, _______, _______, _______, _______, _______, _______, _______, ROUT_FM, ROUT_TG, ROUT_VD, ROUT_VI, _______, KC_MSTP, KC_MPLY, KC_VOLU,
  78. _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO, U_T_AGCR, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD,
  79. _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______,
  80. _______, RGB_TOG, _______, COPY_ALL, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, KC_BRIU,
  81. _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BRID, _______
  82. ),
  83. [_ML] = LAYOUT(
  84. _______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  85. _______, KC_BTN4, KC_BTN3, KC_BTN5, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  86. _______, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  87. _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, _______, _______, _______, _______, _______, _______, _______, _______,
  88. _______, _______, _______, SEL_CPY, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______,
  89. _______, TD(TD_GUI_ML), _______, _______, _______, _______, TG(_ML), _______, _______, _______, _______
  90. ),
  91. /*
  92. [X] = LAYOUT(
  93. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  94. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  95. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  96. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  97. _______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______,
  98. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
  99. ),
  100. [RGB] = LAYOUT(
  101. ESC: 0, F1: 1, F2: 2, F3: 3, F4: 4, F5: 5, F6: 6, F7: 7, F8: 8, F9: 9, F10: 10, F11: 11, F12: 12, PSCR: 13, SLCK: 14, PAUS: 15,
  102. GRV: 16, 1: 17, 2: 18, 3: 19, 4: 20, 5: 21, 6: 22, 7: 23, 8: 24, 9: 25, 0: 26, MINS: 27, EQL: 28, BSPC: 29, INS: 30, HOME: 31, PGUP: 32,
  103. TAB: 33, Q: 34, W: 35, E: 36, R: 37, T: 38, Y: 39, U: 40, I: 41, O: 42, P: 43, LBRC: 44, RBRC: 45, BSLS: 46, DEL: 47, END: 48, PGDN: 49,
  104. CAPS: 50, A: 51, S: 52, D: 53, F: 54, G: 55, H: 56, J: 57, K: 58, L: 59, SCLN: 60, QUOT: 61, ENT: 62,
  105. LSFT: 63, Z: 64, X: 65, C: 66, V: 67, B: 68, N: 69, M: 70, COMM: 71, DOT: 72, SLSH: 73, RSFT: 74, UP: 75,
  106. LCTL: 76, LGUI: 77, LALT: 78, SPC: 79, RALT: 80, Fn: 81, APP: 82, RCTL: 83, LEFT: 84, DOWN: 85, RGHT: 86
  107. ),
  108. [MATRIX] = LAYOUT(
  109. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  110. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
  111. 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
  112. 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
  113. 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
  114. 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86
  115. ),
  116. */
  117. };
  118. // Runs just one time when the keyboard initializes.
  119. void matrix_init_user(void) {
  120. // Enable or disable debugging
  121. debug_enable=true;
  122. debug_matrix=true;
  123. debug_keyboard=true;
  124. debug_mouse=true;
  125. idle_second_counter = 0;
  126. rgb_time_out_seconds = RGB_DEFAULT_TIME_OUT;
  127. rgb_time_out_enable = true;
  128. rgb_enabled_flag = true;
  129. rgb_time_out_user_value = true;
  130. rgb_time_out_fast_mode_enabled = false;
  131. rgb_time_out_saved_flag = rgb_matrix_get_flags();
  132. };
  133. // Runs constantly in the background, in a loop.
  134. void matrix_scan_user(void) {
  135. if(rgb_time_out_enable && rgb_enabled_flag) {
  136. if (timer_elapsed(idle_timer) > MILLISECONDS_IN_SECOND) {
  137. idle_second_counter++;
  138. idle_timer = timer_read();
  139. }
  140. if (idle_second_counter >= rgb_time_out_seconds) {
  141. rgb_time_out_saved_flag = rgb_matrix_get_flags();
  142. rgb_matrix_set_flags(LED_FLAG_NONE);
  143. rgb_matrix_disable_noeeprom();
  144. rgb_enabled_flag = false;
  145. idle_second_counter = 0;
  146. }
  147. }
  148. };
  149. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  150. static uint32_t key_timer;
  151. if (rgb_time_out_enable) {
  152. idle_timer = timer_read();
  153. // Reset the seconds counter. Without this, something like press> leave x seconds> press, would be x seconds on the effective counter not 0 as it should.
  154. idle_second_counter = 0;
  155. if (!rgb_enabled_flag) {
  156. rgb_matrix_enable_noeeprom();
  157. rgb_matrix_set_flags(rgb_time_out_saved_flag);
  158. rgb_enabled_flag = true;
  159. }
  160. }
  161. switch (keycode) {
  162. case U_T_AUTO:
  163. if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
  164. TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode");
  165. }
  166. return false;
  167. case U_T_AGCR:
  168. if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
  169. TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
  170. }
  171. return false;
  172. case DBG_TOG:
  173. if (record->event.pressed) {
  174. TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");
  175. }
  176. return false;
  177. case DBG_MTRX:
  178. if (record->event.pressed) {
  179. TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix");
  180. }
  181. return false;
  182. case DBG_KBD:
  183. if (record->event.pressed) {
  184. TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard");
  185. }
  186. return false;
  187. case DBG_MOU:
  188. if (record->event.pressed) {
  189. TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse");
  190. }
  191. return false;
  192. case MD_BOOT:
  193. if (record->event.pressed) {
  194. key_timer = timer_read32();
  195. } else {
  196. if (timer_elapsed32(key_timer) >= 500) {
  197. reset_keyboard();
  198. }
  199. }
  200. return false;
  201. case RGB_TOG:
  202. if (record->event.pressed) {
  203. rgb_time_out_enable = rgb_time_out_user_value;
  204. switch (rgb_matrix_get_flags()) {
  205. case LED_FLAG_ALL: {
  206. rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER);
  207. rgb_matrix_set_color_all(0, 0, 0);
  208. }
  209. break;
  210. case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: {
  211. rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
  212. rgb_matrix_set_color_all(0, 0, 0);
  213. }
  214. break;
  215. case LED_FLAG_UNDERGLOW: {
  216. // This line is for LED idle timer. It disables the toggle so you can turn off LED completely if you like
  217. rgb_time_out_enable = false;
  218. rgb_matrix_set_flags(LED_FLAG_NONE);
  219. rgb_matrix_disable_noeeprom();
  220. }
  221. break;
  222. default: {
  223. rgb_matrix_set_flags(LED_FLAG_ALL);
  224. rgb_matrix_enable_noeeprom();
  225. }
  226. break;
  227. }
  228. }
  229. return false;
  230. // ======================================================== CUSTOM KEYCOADS BELOW ========================================================
  231. case COPY_ALL:
  232. if (record->event.pressed) {
  233. // Selects all and text and copy
  234. SEND_STRING(SS_LCTRL("ac"));
  235. }
  236. return false;
  237. case SEL_CPY:
  238. // Select word under cursor and copy. Double mouse click then ctrl+c
  239. if (record->event.pressed) {
  240. tap_code16(KC_BTN1);
  241. tap_code16(KC_BTN1);
  242. tap_code16(C(KC_C));
  243. }
  244. return false;
  245. case ROUT_TG:
  246. // Toggle idle LED timeout on or off
  247. if (record->event.pressed) {
  248. rgb_time_out_enable = !rgb_time_out_enable;
  249. rgb_time_out_user_value = rgb_time_out_enable;
  250. }
  251. return false;
  252. case ROUT_VI:
  253. // Increase idle LED timeout value in seconds
  254. if (record->event.pressed) {
  255. // Only increase if current value is lower than RGB_TIME_OUT_MAX. Don't care what value the result will be
  256. // Modity RGB_TIME_OUT_STEP for bigger or smaller increments
  257. if (!rgb_time_out_fast_mode_enabled && rgb_time_out_seconds <= RGB_TIME_OUT_MAX) {
  258. rgb_time_out_seconds += RGB_TIME_OUT_STEP;
  259. }
  260. }
  261. return false;
  262. case ROUT_VD:
  263. // Decrease idle LED timeout value in seconds
  264. if (record->event.pressed) {
  265. // Only decrease if current value is higher than minimum value and the result is larger than zero
  266. // Modity RGB_TIME_OUT_STEP for bigger or smaller decrements
  267. if (!rgb_time_out_fast_mode_enabled && rgb_time_out_seconds > RGB_TIME_OUT_MIN) {
  268. rgb_time_out_seconds -= RGB_TIME_OUT_STEP;
  269. }
  270. }
  271. return false;
  272. case ROUT_FM:
  273. if (record->event.pressed) {
  274. if (rgb_time_out_fast_mode_enabled) {
  275. rgb_time_out_seconds = rgb_time_out_saved_seconds;
  276. } else {
  277. rgb_time_out_saved_seconds = rgb_time_out_seconds;
  278. rgb_time_out_seconds = RGB_FAST_MODE_TIME_OUT;
  279. }
  280. rgb_time_out_fast_mode_enabled = !rgb_time_out_fast_mode_enabled;
  281. }
  282. return false;
  283. default:
  284. return true; //Process all other keycodes normally
  285. }
  286. }
  287. void rgb_matrix_indicators_user(void) {
  288. /*
  289. [RGB] = LAYOUT(
  290. ESC: 0, F1: 1, F2: 2, F3: 3, F4: 4, F5: 5, F6: 6, F7: 7, F8: 8, F9: 9, F10: 10, F11: 11, F12: 12, PSCR: 13, SLCK: 14, PAUS: 15,
  291. GRV: 16, 1: 17, 2: 18, 3: 19, 4: 20, 5: 21, 6: 22, 7: 23, 8: 24, 9: 25, 0: 26, MINS: 27, EQL: 28, BSPC: 29, INS: 30, HOME: 31, PGUP: 32,
  292. TAB: 33, Q: 34, W: 35, E: 36, R: 37, T: 38, Y: 39, U: 40, I: 41, O: 42, P: 43, LBRC: 44, RBRC: 45, BSLS: 46, DEL: 47, END: 48, PGDN: 49,
  293. CAPS: 50, A: 51, S: 52, D: 53, F: 54, G: 55, H: 56, J: 57, K: 58, L: 59, SCLN: 60, QUOT: 61, ENT: 62,
  294. LSFT: 63, Z: 64, X: 65, C: 66, V: 67, B: 68, N: 69, M: 70, COMM: 71, DOT: 72, SLSH: 73, RSFT: 74, UP: 75,
  295. LCTL: 76, LGUI: 77, LALT: 78, SPC: 79, RALT: 80, Fn: 81, APP: 82, RCTL: 83, LEFT: 84, DOWN: 85, RGHT: 86
  296. )
  297. */
  298. if (!g_suspend_state && rgb_matrix_config.enable) {
  299. switch (biton32(layer_state)) {
  300. case _FL: {
  301. /*
  302. [_FL] = LAYOUT(
  303. _______, DM_PLY1, DM_PLY2, _______, _______, DM_REC1, DM_REC2, _______, _______, DM_RSTP, _______, KC_WAKE, KC_SLEP, KC_MUTE, _______, _______,
  304. _______, RGB_M_P, _______, _______, _______, _______, _______, _______, _______, ROUT_FM, ROUT_TG, ROUT_VD, ROUT_VI, _______, KC_MSTP, KC_MPLY, KC_VOLU,
  305. _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO, U_T_AGCR, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD,
  306. _______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______,
  307. _______, RGB_TOG, _______, COPY_ALL, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, KC_BRIU,
  308. _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BRID, _______
  309. )
  310. */
  311. // Function key. Color code #ffc100
  312. rgb_matrix_set_color(81, 0xff, 0xc1, 0x00);
  313. // Sleep and Wake. Color code #aeb0b0
  314. rgb_matrix_set_color(11, 0xae, 0xb0, 0xb0);
  315. rgb_matrix_set_color(12, 0xae, 0xb0, 0xb0);
  316. // Power Control Keys. Color code #cb2f2a
  317. rgb_matrix_set_color(40, 0xcb, 0x2f, 0x2a);
  318. rgb_matrix_set_color(41, 0xcb, 0x2f, 0x2a);
  319. rgb_matrix_set_color(74, 0xcb, 0x2f, 0x2a);
  320. rgb_matrix_set_color(83, 0xcb, 0x2f, 0x2a);
  321. // Keyboard Control Keys. Color code #f4791e
  322. rgb_matrix_set_color(68, 0xf4, 0x79, 0x1e);
  323. rgb_matrix_set_color(69, 0xf4, 0x79, 0x1e);
  324. // Copy All Key. Color Code #45b866
  325. rgb_matrix_set_color(66, 0x45, 0xb8, 0x66);
  326. // Brightness Keys. Color code #aeb0b0
  327. rgb_matrix_set_color(75, 0xae, 0xb0, 0xb0);
  328. rgb_matrix_set_color(85, 0xae, 0xb0, 0xb0);
  329. // RGB Timeout Keys. Color code #34a4b9
  330. rgb_matrix_set_color(25, 0x34, 0xa3, 0xb9);
  331. rgb_matrix_set_color(26, 0x34, 0xa3, 0xb9);
  332. rgb_matrix_set_color(27, 0x34, 0xa3, 0xb9);
  333. rgb_matrix_set_color(28, 0x34, 0xa3, 0xb9);
  334. // Media Keys. Color code #51c0dd
  335. rgb_matrix_set_color(13, 0x51, 0xc0, 0xdd);
  336. rgb_matrix_set_color(30, 0x51, 0xc0, 0xdd);
  337. rgb_matrix_set_color(31, 0x51, 0xc0, 0xdd);
  338. rgb_matrix_set_color(32, 0x51, 0xc0, 0xdd);
  339. rgb_matrix_set_color(47, 0x51, 0xc0, 0xdd);
  340. rgb_matrix_set_color(48, 0x51, 0xc0, 0xdd);
  341. rgb_matrix_set_color(49, 0x51, 0xc0, 0xdd);
  342. // RBG Control Keys. Color code #2790c2
  343. rgb_matrix_set_color(17, 0x27, 0x90, 0xc2);
  344. rgb_matrix_set_color(34, 0x27, 0x90, 0xc2);
  345. rgb_matrix_set_color(35, 0x27, 0x90, 0xc2);
  346. rgb_matrix_set_color(36, 0x27, 0x90, 0xc2);
  347. rgb_matrix_set_color(37, 0x27, 0x90, 0xc2);
  348. rgb_matrix_set_color(38, 0x27, 0x90, 0xc2);
  349. rgb_matrix_set_color(51, 0x27, 0x90, 0xc2);
  350. rgb_matrix_set_color(52, 0x27, 0x90, 0xc2);
  351. rgb_matrix_set_color(53, 0x27, 0x90, 0xc2);
  352. rgb_matrix_set_color(54, 0x27, 0x90, 0xc2);
  353. rgb_matrix_set_color(55, 0x27, 0x90, 0xc2);
  354. rgb_matrix_set_color(64, 0x27, 0x90, 0xc2);
  355. // Dynamic Macro Keys. Color code #45b866
  356. rgb_matrix_set_color(1, 0x45, 0xb8, 0x66);
  357. rgb_matrix_set_color(2, 0x45, 0xb8, 0x66);
  358. rgb_matrix_set_color(5, 0x45, 0xb8, 0x66);
  359. rgb_matrix_set_color(6, 0x45, 0xb8, 0x66);
  360. rgb_matrix_set_color(9, 0x45, 0xb8, 0x66);
  361. }
  362. break;
  363. case _ML: {
  364. /*
  365. [_ML] = LAYOUT(
  366. _______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN4, KC_BTN3, KC_BTN5, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
  367. _______, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  368. _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, _______, _______, _______, _______, _______, _______, _______, _______,
  369. _______, _______, _______, SEL_CPY, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______,
  370. _______, TD(TD_GUI_ML), _______, _______, _______, _______, TG(_ML), _______, _______, _______, _______
  371. )
  372. */
  373. // Mouse movement keys. Color code #51c0dd
  374. rgb_matrix_set_color(35, 0x51, 0xc0, 0xdd);
  375. rgb_matrix_set_color(51, 0x51, 0xc0, 0xdd);
  376. rgb_matrix_set_color(52, 0x51, 0xc0, 0xdd);
  377. rgb_matrix_set_color(53, 0x51, 0xc0, 0xdd);
  378. rgb_matrix_set_color(54, 0x51, 0xc0, 0xdd);
  379. rgb_matrix_set_color(37, 0x51, 0xc0, 0xdd);
  380. // Mouse Button keys. Color code #009bca
  381. rgb_matrix_set_color(17, 0x00, 0x9b, 0xca);
  382. rgb_matrix_set_color(18, 0x00, 0x9b, 0xca);
  383. rgb_matrix_set_color(19, 0x00, 0x9b, 0xca);
  384. rgb_matrix_set_color(34, 0x00, 0x9b, 0xca);
  385. rgb_matrix_set_color(36, 0x00, 0x9b, 0xca);
  386. // Mouse acceleration control. Color code #5dcde3
  387. rgb_matrix_set_color(1, 0x5d, 0xcd, 0xe3);
  388. rgb_matrix_set_color(2, 0x5d, 0xcd, 0xe3);
  389. rgb_matrix_set_color(3, 0x5d, 0xcd, 0xe3);
  390. // Layer toggle keys. Color code #ffc100
  391. rgb_matrix_set_color(77, 0xff, 0xc1, 0x00);
  392. rgb_matrix_set_color(82, 0xff, 0xc1, 0x00);
  393. // Select copy key. Color code #45b866
  394. rgb_matrix_set_color(66, 0x45, 0xb8, 0x66);
  395. // NKRO key. Color code #f4791e
  396. rgb_matrix_set_color(69, 0xf4, 0x79, 0x1e);
  397. }
  398. break;
  399. }
  400. }
  401. }