keymap.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. #include QMK_KEYBOARD_H
  2. /*
  3. Let's Split physical layout
  4. 1u == 8chars
  5. * == Homing keys
  6. LEFT RIGHT
  7. ,-----------------------------------------------------. ,-----------------------------------------------------.
  8. | | | | | | | | | | | | | |
  9. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  10. | | | | | * | | | | * | | | | |
  11. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  12. | | | | | | | | | | | | | |
  13. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  14. | | | | | | | | | | | | | |
  15. `-----------------------------------------------------´ `-----------------------------------------------------'
  16. */
  17. // Layers
  18. enum layer_names {
  19. _DEFAULT,
  20. _DEFAULT_MAC,
  21. _DEFAULT_WIN,
  22. _RAISE_MAC,
  23. _RAISE_WIN,
  24. _LOWER,
  25. _SPECIAL,
  26. };
  27. #define TO_MAC TO(_DEFAULT)
  28. #define TO_WIN TO(_DEFAULT_WIN)
  29. #define RAISE_M MO(_RAISE_MAC)
  30. #define RAISE_W MO(_RAISE_WIN)
  31. #define LOWER MO(_LOWER)
  32. #define SPECIAL MO(_SPECIAL)
  33. // Modifiers
  34. #define SFTENT KC_SFTENT // Enter => Shift when held
  35. #define CTLTAB LCTL_T(KC_TAB) // Tab => Ctrl when held
  36. // ISO keycodes with Swedish layout names
  37. #define SE_PLUS KC_MINS // +
  38. #define SE_QSTM S(SE_PLUS) // Question mark
  39. #define SE_TCK KC_EQL // Fronttick (´)
  40. #define SE_BTCK S(SE_TCK) // Backtick (`)
  41. #define SE_UML KC_RBRC // Umlaut (¨)
  42. #define SE_TAK S(SE_UML) // Caret (^)
  43. #define SE_TILD RALT(SE_UML) // Tilde (~)
  44. #define SE_QUT KC_NUHS // Singlequote (')
  45. #define SE_DQUT S(KC_2) // Doublequote (")
  46. #define SE_AST S(SE_QUT) // Asterisk
  47. #define SE_AUML KC_QUOT // Ä
  48. #define SE_ARNG KC_LBRC // Å
  49. #define SE_OUML KC_SCLN // Ö
  50. #define SE_LT KC_NUBS // <
  51. #define SE_GT S(SE_LT) // >
  52. #define SE_DASH KC_SLSH // -
  53. #define SE_USCR S(SE_DASH) // _
  54. #define SE_AT RALT(KC_2) // @
  55. #define SE_EXCL S(KC_1) // !
  56. #define SE_HASH S(KC_3) // #
  57. #define SE_USD RALT(KC_4) // $
  58. #define SE_PCNT S(KC_5) // %
  59. #define SE_AMP S(KC_6) // &
  60. #define SE_EQLS S(KC_0) // =
  61. // Apple-specific layout keys
  62. #define AP_SLS S(KC_7) // /
  63. #define AP_PIPE LALT(KC_7) // |
  64. #define AP_BSLS A(AP_SLS) // Backslash
  65. #define AP_LCBR A(AP_LPAR) // {
  66. #define AP_RCBR A(AP_RPAR) // }
  67. #define AP_LBR A(KC_8) // [
  68. #define AP_RBR A(KC_9) // ]
  69. #define AP_LPAR S(KC_8) // (
  70. #define AP_RPAR S(KC_9) // )
  71. // Windows-specific layout keys
  72. #define MS_SLS S(KC_7) // /
  73. #define MS_PIPE RALT(SE_LT) // |
  74. #define MS_BSLS RALT(SE_PLUS) // Backslash
  75. #define MS_LCBR RALT(KC_7) // {
  76. #define MS_RCBR RALT(KC_0) // }
  77. #define MS_LBR RALT(KC_8) // [
  78. #define MS_RBR RALT(KC_9) // ]
  79. #define MS_LPAR S(KC_8) // (
  80. #define MS_RPAR S(KC_9) // )
  81. // My common shortcuts
  82. #define MY_PREV KC_MRWD // Media: Previous
  83. #define MY_NEXT KC_MFFD // Media: Next
  84. #define MY_PLAY KC_MPLY // Media: Play/Pause
  85. #define MY_LOCK C(A(KC_L)) // Mac: Lock
  86. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  87. /*
  88. DEFAULT
  89. Main layout for alphas and modifiers
  90. Tab => Ctrl when held
  91. Esc => MOVEMENT layer when held
  92. Enter => Shift when held
  93. LEFT RIGHT
  94. ,-----------------------------------------------------. ,-----------------------------------------------------.
  95. | Esc | Q | W | E | R | T | | Y | U | I | O | P | Å |
  96. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  97. |Ctrl/Tab| A | S | D | F *| G | | H |* J | K | L | Ö | Ä |
  98. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  99. | Shift | Z | X | C | V | B | | N | M | , | . | - | Enter |
  100. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  101. | SPECIAL| Ctrl | Alt | Cmd | LOWER | Space | | Backspc| RAISE | Left | Down | Up | Right |
  102. `-----------------------------------------------------´ `-----------------------------------------------------'
  103. */
  104. [_DEFAULT] = LAYOUT_ortho_4x12(
  105. KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, SE_ARNG,
  106. CTLTAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SE_OUML, SE_AUML,
  107. KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, SE_DASH, SFTENT,
  108. SPECIAL, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_BSPC, RAISE_M, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
  109. ),
  110. /*
  111. DEFAULT - Windows
  112. LEFT RIGHT
  113. ,-----------------------------------------------------. ,-----------------------------------------------------.
  114. | | | | | | | | | | | | | |
  115. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  116. | | | | | * | | | | * | | | | |
  117. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  118. | | | | | | | | | | | | | |
  119. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  120. | | | | | | | | | RAISE | | | | |
  121. `-----------------------------------------------------´ `-----------------------------------------------------'
  122. */
  123. [_DEFAULT_WIN] = LAYOUT_ortho_4x12(
  124. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  125. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  126. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  127. _______, _______, _______, _______, _______, _______, _______, RAISE_W, _______, _______, _______, _______
  128. ),
  129. /*
  130. RAISE - Mac
  131. This layer focuses on symbols and special characters.
  132. LEFT RIGHT
  133. ,-----------------------------------------------------. ,-----------------------------------------------------.
  134. | | ! | ? | { | } | & | | ^ | | | ` | ´ | | Del |
  135. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  136. | | # | $ | ( | ) *| " | | ~ |* / | \ | ¨ | | |
  137. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  138. | | @ | % | [ | ] | ' | | | < | > | | | |
  139. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  140. | | | | | | | | |XXXXXXXX| | | | |
  141. `-----------------------------------------------------´ `-----------------------------------------------------'
  142. */
  143. [_RAISE_MAC] = LAYOUT_ortho_4x12(
  144. _______, SE_EXCL, SE_QSTM, AP_LCBR, AP_RCBR, SE_AMP, SE_TAK, AP_PIPE, SE_BTCK, SE_TCK, _______, KC_DEL,
  145. _______, SE_HASH, SE_USD, AP_LPAR, AP_RPAR, SE_DQUT, SE_TILD, AP_SLS, AP_BSLS, SE_UML, _______, _______,
  146. _______, SE_AT, SE_PCNT, AP_LBR, AP_RBR, SE_QUT, _______, SE_LT, SE_GT, _______, _______, _______,
  147. _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  148. ),
  149. /*
  150. RAISE - Windows
  151. This layer focuses on symbols and special characters.
  152. LEFT RIGHT
  153. ,-----------------------------------------------------. ,-----------------------------------------------------.
  154. | | ! | ? | { | } | & | | ^ | | | ` | ´ | | Del |
  155. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  156. | | # | $ | ( | ) *| " | | ~ |* / | \ | ¨ | | |
  157. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  158. | | @ | % | [ | ] | ' | | | < | > | | | |
  159. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  160. | | | | | | | | |XXXXXXXX| | | | |
  161. `-----------------------------------------------------´ `-----------------------------------------------------'
  162. */
  163. [_RAISE_WIN] = LAYOUT_ortho_4x12(
  164. _______, SE_EXCL, SE_QSTM, MS_LCBR, MS_RCBR, SE_AMP, SE_TAK, MS_PIPE, SE_BTCK, SE_TCK, _______, KC_DEL,
  165. _______, SE_HASH, SE_USD, MS_LPAR, MS_RPAR, SE_DQUT, SE_TILD, MS_SLS, MS_BSLS, SE_UML, _______, _______,
  166. _______, SE_AT, SE_PCNT, MS_LBR, MS_RBR, SE_QUT, _______, SE_LT, SE_GT, _______, _______, _______,
  167. _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
  168. ),
  169. /*
  170. LOWER
  171. This layer focuses on numbers and math.
  172. LEFT RIGHT
  173. ,-----------------------------------------------------. ,-----------------------------------------------------.
  174. | | F1 | F2 | F3 | F4 | | | * | 7 | 8 | 9 | - | Del |
  175. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  176. | | F5 | F6 | F7 | F8 *| | | / |* 4 | 5 | 6 | + | |
  177. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  178. | | F9 | F10 | F11 | F12 | | | / | 1 | 2 | 3 | = | |
  179. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  180. | | | | |XXXXXXXX| | | | | 0 | . | | |
  181. `-----------------------------------------------------´ `-----------------------------------------------------'
  182. */
  183. [_LOWER] = LAYOUT_ortho_4x12(
  184. _______, KC_F1, KC_F2, KC_F3, KC_F4, _______, SE_AST, KC_7, KC_8, KC_9, SE_DASH, KC_DEL,
  185. _______, KC_F5, KC_F6, KC_F7, KC_F8, _______, AP_SLS, KC_4, KC_5, KC_6, SE_PLUS, _______,
  186. _______, KC_F9, KC_F10, KC_F11, KC_F12, _______, MS_SLS, KC_1, KC_2, KC_3, SE_EQLS, _______,
  187. _______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, _______, _______
  188. ),
  189. /*
  190. SPECIAL
  191. This layer focuses on special functions, media controls and movement keys.
  192. LEFT RIGHT
  193. ,-----------------------------------------------------. ,-----------------------------------------------------.
  194. | Reset | | WIN | VolUp | | | | Ins | Home | Up | End | PgUp | Del |
  195. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  196. |EEPReset| | Prev | VolDn | Next *| | | |* Left | Down | Right | PgDn | |
  197. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  198. | | | | Mute | | | | Lock | MAC | | | | |
  199. |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
  200. |XXXXXXXX| | | | | Play | | | | | | | Sleep |
  201. `-----------------------------------------------------´ `-----------------------------------------------------'
  202. */
  203. [_SPECIAL] = LAYOUT_ortho_4x12(
  204. QK_BOOT, _______, TO_WIN, KC_VOLU, _______, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_DEL,
  205. EEP_RST, _______, MY_PREV, KC_VOLD, MY_NEXT, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______,
  206. _______, _______, _______, KC_MUTE, _______, _______, MY_LOCK, TO_MAC, _______, _______, _______, _______,
  207. _______, _______, _______, _______, _______, MY_PLAY, _______, _______, _______, _______, _______, KC_SLEP
  208. )
  209. };