logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

keymap.c (2444B)


  1. /* Copyright 2019 T.Shinohara
  2. *
  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. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include QMK_KEYBOARD_H
  17. // Defines the keycodes used by our macros in process_record_user
  18. enum custom_keycodes {
  19. TEST_A1 = SAFE_RANGE,
  20. TEST_A2,
  21. TEST_A3,
  22. TEST_B1,
  23. TEST_B2,
  24. TEST_B3,
  25. TEST_C1,
  26. TEST_C2,
  27. TEST_C3,
  28. TEST_D1,
  29. TEST_D2,
  30. TEST_D3,
  31. TEST_E1,
  32. TEST_E2,
  33. TEST_E3
  34. };
  35. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  36. [0] = LAYOUT( /* Base */
  37. TEST_A1, TEST_A2, TEST_A3,
  38. TEST_B1, TEST_B2, TEST_B3,
  39. TEST_C1, TEST_C2, TEST_C3,
  40. TEST_D1, TEST_D2, TEST_D3,
  41. TEST_E1, TEST_E2, TEST_E3
  42. )
  43. };
  44. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  45. switch (keycode) {
  46. case TEST_A1: if(record->event.pressed){ SEND_STRING("A1"); } break;
  47. case TEST_A2: if(record->event.pressed){ SEND_STRING("A2"); } break;
  48. case TEST_A3: if(record->event.pressed){ SEND_STRING("A3"); } break;
  49. case TEST_B1: if(record->event.pressed){ SEND_STRING("B1"); } break;
  50. case TEST_B2: if(record->event.pressed){ SEND_STRING("B2"); } break;
  51. case TEST_B3: if(record->event.pressed){ SEND_STRING("B3"); } break;
  52. case TEST_C1: if(record->event.pressed){ SEND_STRING("C1"); } break;
  53. case TEST_C2: if(record->event.pressed){ SEND_STRING("C2"); } break;
  54. case TEST_C3: if(record->event.pressed){ SEND_STRING("C3"); } break;
  55. case TEST_D1: if(record->event.pressed){ SEND_STRING("D1"); } break;
  56. case TEST_D2: if(record->event.pressed){ SEND_STRING("D2"); } break;
  57. case TEST_D3: if(record->event.pressed){ SEND_STRING("D3"); } break;
  58. case TEST_E1: if(record->event.pressed){ SEND_STRING("E1"); } break;
  59. case TEST_E2: if(record->event.pressed){ SEND_STRING("E2"); } break;
  60. case TEST_E3: if(record->event.pressed){ SEND_STRING("E3"); } break;
  61. }
  62. return true;
  63. }