logo

qmk_firmware

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

keymap.c (3356B)


  1. /* Copyright 2020 Tom Swartz
  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 names for use in layer keycodes and the keymap
  18. enum layer_names {
  19. _NP,
  20. _FN
  21. };
  22. // Defines the keycodes used by our macros in process_record_user
  23. enum custom_keycodes {
  24. KC_00 = SAFE_RANGE,
  25. };
  26. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  27. /* NumberPad Layer
  28. ,---------------------------------------.
  29. | Back | Num | / | * | - |
  30. | Space | Lock | | | |
  31. |-------+-------+-------+-------+-------|
  32. | Tab | 7 | 8 | 9 | + |
  33. | | Home | Up | PgUp | |
  34. |-------+-------+-------+-------| |
  35. | Layer | 4 | 5 | 6 | |
  36. | Toggle| Left | | Right | |
  37. |-------+-------+-------+-------+-------|
  38. | Page | 1 | 2 | 3 | Enter |
  39. | Up | End | Down | PgDn | |
  40. |-------+-------+-------+-------| |
  41. | Page | 00 | 0 | . | |
  42. | Down | | | | |
  43. `---------------------------------------'
  44. */
  45. [_NP] = LAYOUT(
  46. KC_BSPC, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS,
  47. KC_TAB, KC_7, KC_8, KC_9,
  48. TG(_NP), KC_4, KC_5, KC_6, KC_PPLS,
  49. KC_PGUP, KC_1, KC_2, KC_3,
  50. KC_PGDN, KC_00, KC_0, KC_PDOT, KC_PENT
  51. ),
  52. /* Macropad/Function Layer
  53. ,---------------------------------------.
  54. | `~ | Play | F13 | Prev | Next |
  55. | | Pause | | | |
  56. |-------+-------+-------+-------+-------|
  57. | Tab | F14 | F15 | 9 | + |
  58. | | | | PgUp | |
  59. |-------+-------+-------+-------| |
  60. | Layer | 4 | 5 | 6 | |
  61. | Toggle| Left | | Right | |
  62. |-------+-------+-------+-------+-------|
  63. | U | B | 2 | 3 | Enter |
  64. | | | Down | PgDn | |
  65. |-------+-------+-------+-------| |
  66. | D | F | 0 | . | |
  67. | | | | | |
  68. `---------------------------------------'
  69. */
  70. [_FN] = LAYOUT(
  71. KC_GRV, KC_MPLY, KC_F13, KC_MPRV, KC_MNXT,
  72. _______, KC_F14, KC_F15, _______,
  73. _______, _______, _______, _______, _______,
  74. KC_U, KC_B, _______, _______,
  75. KC_D, KC_F, _______, _______, _______
  76. ),
  77. };
  78. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  79. switch (keycode) {
  80. case KC_00:
  81. if (record->event.pressed) {
  82. // when keycode DOUBLEZERO is pressed
  83. SEND_STRING("00");
  84. }
  85. break;
  86. }
  87. return true;
  88. }