keymap.c 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* Copyright 2018 Jumail Mundekkat
  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. QMKBEST = SAFE_RANGE,
  20. QMKURL
  21. };
  22. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  23. [0] = LAYOUT_ortho_5x6(
  24. KC_ESC, KC_LPRN, KC_RPRN, KC_PSLS, KC_PAST, LT(2, KC_BSPC),
  25. KC_F1, KC_F2, KC_P7, KC_P8, KC_P9, KC_DEL,
  26. KC_F3, KC_F4, KC_P4, KC_P5, KC_P6, KC_PMNS,
  27. KC_F5, KC_F6, KC_P1, KC_P2, KC_P3, KC_PPLS,
  28. KC_LCTL, KC_LALT, TO(1), KC_P0, KC_PDOT, KC_PENT
  29. ),
  30. [1] = LAYOUT_ortho_5x6(
  31. KC_ESC, KC_1, KC_2, KC_3, KC_4, LT(2, KC_F9),
  32. KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T,
  33. KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G,
  34. KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B,
  35. KC_LCTL, KC_LALT, TO(0), KC_P, KC_H, KC_SPC
  36. ),
  37. [2] = LAYOUT_ortho_5x6(
  38. BL_TOGG, BL_STEP, _______, _______, _______, _______,
  39. _______, _______, _______, _______, _______, _______,
  40. _______, _______, _______, _______, _______, _______,
  41. _______, _______, _______, _______, _______, KC_VOLU,
  42. _______, _______, _______, _______, KC_MUTE, KC_VOLD
  43. )
  44. };
  45. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  46. switch (keycode) {
  47. case QMKBEST:
  48. if (record->event.pressed) {
  49. // when keycode QMKBEST is pressed
  50. SEND_STRING("QMK is the best thing ever!");
  51. } else {
  52. // when keycode QMKBEST is released
  53. }
  54. break;
  55. case QMKURL:
  56. if (record->event.pressed) {
  57. // when keycode QMKURL is pressed
  58. SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER));
  59. } else {
  60. // when keycode QMKURL is released
  61. }
  62. break;
  63. }
  64. return true;
  65. }
  66. void matrix_init_user(void) {
  67. }
  68. void matrix_scan_user(void) {
  69. }
  70. void led_set_user(uint8_t usb_led) {
  71. }