logo

qmk_firmware

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

keymap.c (9764B)


  1. /* Copyright 2022 Alexander (Sasha) Karmanov
  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. _QWERTY,
  20. _CURSORLEFT,
  21. _CURSORRGHT,
  22. _NUMBERS,
  23. _EXTRARIGHT
  24. };
  25. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  26. /* Qwerty
  27. * ,-----------------------------------------+ +-----------------------------------------.
  28. * | Esc | Q | W | E | R | T | | Y | U | I | O | P |BSpc |
  29. * |------+------+------+------+------+------+ +------+------+------+------+------+------|
  30. * | Tab | A | S | D | F | G | | H | J | K | L | ; |Enter |
  31. Hold:
  32. Extra-Rt
  33. * |------+------+------+------+------+------| |------+------+------+------+------+------|
  34. * | Ctrl | Z | X | C | V | B | | N | M | , | . | / |RCtrl |
  35. * +------+------+------+------+------+------+ +------+------+------+------+------+------+
  36. . | GUI | Alt | | | | | | RAlt | Menu | .
  37. | +------+------+ | | | | +------+------+ |
  38. Hold: | | LSft |CursLt| |CursRt| RSft | |
  39. Single hit: | | |Space | |Space | | |
  40. | +------+------| |------+------+ |
  41. +------------------------------> SPACE SPACE <-----------------------------+
  42. */
  43. [_QWERTY] = LAYOUT(
  44. KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
  45. LT(_EXTRARIGHT,KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_PENT,
  46. KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RCTL,
  47. KC_SPC, KC_LGUI, KC_LALT, KC_LSFT, LT(_CURSORLEFT,KC_SPC), LT(_CURSORRGHT ,KC_SPC), KC_RSFT, KC_RALT, KC_APP, KC_SPC
  48. ),
  49. /*
  50. Layers below are used on top of QWERTY layer defined above.
  51. (Except the PLOVER/STENO layers.)
  52. +-------+
  53. The keys which are shown empty, like this: | |, represent a transparent key,
  54. +-------+
  55. meaning the key from the underlaying layer (i.e. QWERTY) will be used.
  56. In the keymaps those keys are defined as "_______".
  57. +-------+ +-------+
  58. The keys which are shown solid, like this: | XXXXX | or this | ... |, represent an opaque/blocking key?
  59. +-------+ +-------+
  60. Such key is not doing anything in that layer nor allowing the key from the underlaying layer
  61. to be invoked.
  62. In the keymaps those keys are defined as "XXXXXXX".
  63. Most of the modifiers are the same in all layers.
  64. So in most layers they are defined as transparent keys,
  65. letting the keys from QWERTY layer to do the work.
  66. With that idea all the layers below leave the unmodified keys as transparent keys.
  67. In the same time - the layers block the keys that have no sense to be used
  68. in that given layer. For instance in the cursor control layers
  69. some of the keys are not used in the layer, but they are blocked to avoid
  70. alpha-keys from QWERTY layer to appear.
  71. For the same reason the keymaps below are shown simplified,
  72. without separate thumbcluster.
  73. */
  74. /* Cursor Control on the right (Right Space)
  75. * ,-----------------------------------------------------------------------------------.
  76. * | Esc |Break |WheelD|MousUp|WheelU| Del | Ins | Home | Up | End | ` | Del |
  77. * |------+------+------+------+------+-------------+------+------+------+------+------|
  78. * | |SelAll|MousLt|MousDn|MousRt| ... | PgUp | Left | Down |Right | ... | |
  79. * |------+------+------+------+------+------|------+------+------+------+------+------|
  80. * | | Undo | Cut | Copy | Paste| ... | PgDn |MsBtLe|MsBtMi|MsBtRt| ... | |
  81. * `------+------+------+------+------+------+------+------+------+------+------+------.
  82. * | | | | | X | | | |
  83. * `-------------------------------------------------------'
  84. */
  85. [_CURSORRGHT] = LAYOUT(
  86. _______, KC_BRK, KC_WH_D, KC_MS_U, KC_WH_U, KC_DEL, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_GRV, KC_DEL,
  87. KC_ENT, LCTL(KC_A), KC_MS_L, KC_MS_D, KC_MS_R, XXXXXXX, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, _______,
  88. _______, LCTL(KC_Z), LSFT(KC_DEL), LCTL(KC_INS), LSFT(KC_INS), XXXXXXX, KC_INS, KC_BTN1, KC_BTN3, KC_BTN2, XXXXXXX, _______,
  89. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
  90. ),
  91. /* Cursor Control on the left (Left Space)
  92. * ,-----------------------------------------------------------------------------------.
  93. * | |Break | Home | Up | End | Ins | Del |WheelU|MousUp|WheelD| ` | Del |
  94. * |------+------+------+------+------+------+-------------+------+------+------+------|
  95. * | Enter|SelAll|Right | Down | Left | PgUp | xxx |MousLt|MousDn|MousRt| xxx |Enter |
  96. * |------+------+------+------+------+------+------|------+------+------+------+------|
  97. * | | xxx |MsBtRt|MsBtMi|MsBtLe| PgDn | xxx | Cut | Copy | Paste| xxx | |
  98. * `------+------+------+------+------+------+------+------+------+------+------+------.
  99. * | | | | X | | | | |
  100. * `-------------------------------------------------------'
  101. */
  102. [_CURSORLEFT] = LAYOUT(
  103. _______, KC_BRK, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_DEL, KC_WH_U, KC_MS_U, KC_WH_D, KC_GRV, KC_DEL,
  104. KC_ENT, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_R, XXXXXXX, _______,
  105. _______, XXXXXXX, KC_BTN2, KC_BTN3, KC_BTN1, KC_INS, XXXXXXX, LCTL(KC_DEL), LCTL(KC_INS), LSFT(KC_INS), XXXXXXX, _______,
  106. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
  107. ),
  108. /* Numbers on the home row, FNs on the top row, symbols in the second row
  109. * (Lower or Raise)
  110. * ,-----------------------------------------------------------------------------------.
  111. * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |BackSp|
  112. * |------+------+------+------+------+------|------+------+------+------+------+------|
  113. * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10| Enter|
  114. * |------+------+------+------+------+-------------+------+------+------+------+------|
  115. * | | F11 | F12 | LAlt |LShift| LAlt | RAlt |RShift| , | . | / | |
  116. * `------+------+------+------+------+------+------+------+------+------+------+------.
  117. * | | | | | | | | |
  118. * `-------------------------------------------------------'
  119. */
  120. [_NUMBERS] = LAYOUT(
  121. _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
  122. LT(_EXTRARIGHT,KC_TAB), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,
  123. _______, KC_F11, KC_F12, KC_LALT, KC_LSFT, KC_LALT, KC_RALT, KC_RSFT, KC_COMM, KC_DOT, KC_SLSH, _______,
  124. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
  125. ),
  126. /* ExtraRightSide (the keys from the right side which did not fit into the matrix)
  127. * ,-----------------------------------------------------------------------------------.
  128. * | Esc |BREAK |PLOVR2|PLOVER|TxBOLT|TxBlt2| ` | = | ( | ) | - | |
  129. * |------+------+------+------+------+-------------+------+------+------+------+------|
  130. * |******| | | | | |PrtScr| | | | ' | |
  131. This is the
  132. key turning
  133. this layer on
  134. * |------+------+------+------+------+------|------+------+------+------+------+------|
  135. * | | | |NumPad|Qwerty| | | | [ | ] | \ | |
  136. * `------+------+------+------+------+------+------+------+------+------+------+------.
  137. * | | | | | | | | |
  138. * `-------------------------------------------------------'
  139. */
  140. [_EXTRARIGHT] = LAYOUT(
  141. _______, KC_BRK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_GRV, KC_EQL, KC_LPRN, KC_RPRN, KC_MINS, _______,
  142. _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, XXXXXXX, XXXXXXX, XXXXXXX, KC_QUOT, _______,
  143. _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LBRC, KC_RBRC, KC_BSLS, _______,
  144. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
  145. )
  146. };
  147. layer_state_t layer_state_set_user(layer_state_t state) {
  148. return update_tri_layer_state(state, _CURSORLEFT, _CURSORRGHT, _NUMBERS);
  149. }