keymap.c 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /* Copyright 2021 Jesper Nellemann Jakobsen
  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. enum layers {
  18. _BASE,
  19. _ARROWS,
  20. _HDUE, /* Home, pgDown, pgUp, End */
  21. _MOUSE,
  22. _FN
  23. };
  24. /* Custom keys */
  25. /* Word movement/deletetion */
  26. #define WORD_BK A(KC_LEFT)
  27. #define WORD_FW A(KC_RIGHT)
  28. #define D_WORD_BK A(KC_BACKSPACE)
  29. #define D_WORD_FW A(KC_DELETE)
  30. /* Fine volume control */
  31. #define FVOLU S(A(KC_VOLU))
  32. #define F_VOLD S(A(KC_VOLD))
  33. /* Multi-purpose keys */
  34. #define HYPR_CAPS ALL_T(KC_CAPS)
  35. #define CTL_ESC LCTL_T(KC_ESC)
  36. /* Layer keys */
  37. #define ARROWS LT(_ARROWS, KC_D)
  38. #define HDUE MO(_HDUE)
  39. #define MOUSP LT(_MOUSE, KC_SPC)
  40. #define FN MO(_FN)
  41. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  42. /* Default layer:
  43. * Space Cadet shifts (parentheses on tap)
  44. * Caps Lock is Control on hold, Esc on tap
  45. * Hyper/Caps Lock on Control keys
  46. * Hold D to activate layer 1 (Arrows)
  47. * Hold Space to activate layer 3 (Mouse keys)
  48. * Hold FN to activate layer 4 (FN layer)
  49. */
  50. [_BASE] = LAYOUT_60_ansi(
  51. 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,
  52. 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,
  53. CTL_ESC, KC_A, KC_S, ARROWS, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
  54. SC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SC_RSPC,
  55. HYPR_CAPS, KC_LALT, KC_LGUI, MOUSP, KC_RGUI, KC_RALT, FN, HYPR_CAPS
  56. ),
  57. /* Layer 1:
  58. * Vim arrows (HJKL)
  59. * Vim-like move across words with W(ord), and B(eginning)
  60. * Media controls (fine volume controls using Option+Shift)
  61. * Backspace/Del on N/M
  62. * Hold F to activate layer 2 (HDUE: Home, Down, Up, End)
  63. */
  64. [_ARROWS] = LAYOUT_60_ansi(
  65. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  66. _______, _______, WORD_FW, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, F_VOLD, FVOLU, _______,
  67. _______, _______, _______, _______, HDUE, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______,
  68. _______, _______, _______, _______, _______, WORD_BK, KC_BSPC, KC_DEL, _______, _______, _______, _______,
  69. _______, _______, _______, _______, _______, _______, _______, _______
  70. ),
  71. /* Layer 2:
  72. * Home, Page Down, Page Up, End
  73. * Delete word forward/back on W/B
  74. */
  75. [_HDUE] = LAYOUT_60_ansi(
  76. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  77. _______, _______, D_WORD_FW, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  78. _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______,
  79. _______, _______, _______, _______, _______, D_WORD_BK, _______, _______, _______, _______, _______, _______,
  80. _______, _______, _______, _______, _______, _______, _______, _______
  81. ),
  82. /* Layer 3:
  83. * Mouse keys
  84. * Cursor movement: HJKL
  85. * MB 1, 2, and 3 on F, D, and S, respectively
  86. * Mouse wheel: up (V), down (R) (reversed because of Natural Scrolling)
  87. * Change mouse acceleration on U, I, O (0, 1, 2)
  88. */
  89. [_MOUSE] = LAYOUT_60_ansi(
  90. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  91. _______, _______, _______, _______, KC_WH_D, _______, _______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______,
  92. _______, _______, KC_BTN3, KC_BTN2, KC_BTN1, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______, _______,
  93. _______, _______, _______, _______, KC_WH_U, _______, _______, _______, _______, _______, _______, _______,
  94. _______, _______, _______, _______, _______, _______, _______, _______
  95. ),
  96. /* Layer 4:
  97. * F1-12
  98. * Del on backspace
  99. * Lots of RGB controls
  100. * QK_BOOT firmware on backslash
  101. * Screen brightness: Z (decrease), X (increase)
  102. */
  103. [_FN] = LAYOUT_60_ansi(
  104. _______, 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_DEL,
  105. _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, RGB_M_P, RGB_M_B, RGB_M_R, _______, _______, _______, QK_BOOT,
  106. _______, _______, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, RGB_M_SW, RGB_M_SN, RGB_M_K, _______, _______, _______,
  107. _______, KC_BRID, KC_BRIU, _______, _______, _______, _______, RGB_M_X, RGB_M_G, RGB_M_T, _______, _______,
  108. _______, _______, _______, _______, _______, _______, _______, _______
  109. )
  110. // TEMPLATE
  111. // LAYOUT_60_ansi(
  112. // _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  113. // _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  114. // _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  115. // _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  116. // _______, _______, _______, _______, _______, _______, _______, _______,
  117. // ),
  118. };