keymap.c 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. #include "planck.h"
  2. #ifdef BACKLIGHT_ENABLE
  3. #include "backlight.h"
  4. #endif
  5. #include "keymap_german.h"
  6. // for intellisense, has to be commented for building
  7. /*
  8. #include "..\..\..\..\quantum\keymap_extras\keymap_german.h"
  9. #include "..\..\..\..\quantum\keymap_common.h"
  10. #include "..\..\..\..\tmk_core\common\keycode.h"
  11. */
  12. #define _______ KC_TRNS
  13. /* This Layout tries to emulate the Bone2 Variant of Neo2, and is intended to be used with a German QWERTZ Softwarelayout.
  14. It has "üäöß" as it is optimized for a mix of German & English.
  15. My favourite features are the placement of the special characters often used for programming right on the home row
  16. and the number & navigation block combo, so you never have to move your hands from their home position.
  17. Bone2 wiki page: http://wiki.neo-layout.org/wiki/Bone
  18. */
  19. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  20. /* Bone2
  21. * ,-----------------------------------------------------------------------------------.
  22. * | Q | J | D | U | A | X | P | H | L | M | W | ẞ |
  23. * |------+------+------+------+------+-------------+------+------+------+------+------|
  24. * |M1/Tab| C | T | I | E | O | B | N | R | S | G |M1/Ent| //hold for M1, tap for Tab/Enter
  25. * |------+------+------+------+------+------|------+------+------+------+------+------|
  26. * | Shift| F | V | Ü | Ä | Ö | Y | Z | , | . | K |Shift |
  27. * |------+------+------+------+------+------+------+------+------+------+------+------|
  28. * | Ctrl | GUI | Alt | M4 | M2 | Space | M2 | M4 | Alt | Esc | Ctrl |
  29. * `-----------------------------------------------------------------------------------'
  30. */
  31. [0] = {
  32. { DE_Q, DE_J, DE_D, DE_U, DE_A, DE_X, DE_P, DE_H, DE_L, DE_M, DE_W, DE_SS },
  33. { LT(1,KC_TAB), DE_C, DE_T, DE_I, DE_E, DE_O, DE_B, DE_N, DE_R, DE_S, DE_G, LT(1,KC_ENT) },
  34. { KC_LSFT, DE_F, DE_V, DE_UE, DE_AE, DE_OE, DE_Y, DE_Z, DE_COMM, DE_DOT, DE_K, KC_LSFT },
  35. { KC_LCTL, KC_RGUI, KC_LALT, MO(4), MO(2), KC_SPC, KC_SPC, MO(2), MO(4), KC_RALT, KC_ESC, KC_RCTL }
  36. },
  37. /* M1 Special Characters
  38. very ergonomic placement for coding
  39. * ,-----------------------------------------------------------------------------------.
  40. * | ° | @ | _ | [ | ] | ^ | ! | < | > | = | & | ´ |
  41. * |------+------+------+------+------+-------------+------+------+------+------+------|
  42. * |M1/Tab| \ | / | { | } | * | ? | ( | ) | - | : |M1/Ent| //hold for M1, tap for Tab/Enter
  43. * |------+------+------+------+------+------|------+------+------+------+------+------|
  44. * | Shift| # | $ | | | ~ | € | + | % | " | ' | ; |Shift |
  45. * |------+------+------+------+------+------+------+------+------+------+------+------|
  46. * | Ctrl | GUI | Alt | M4 | M2 | Space | M2 | M4 | Alt | Esc | Ctrl |
  47. * `-----------------------------------------------------------------------------------'
  48. */
  49. [1] = {
  50. { DE_RING, DE_AT, DE_UNDS, DE_LBRC, DE_RBRC, DE_CIRC, DE_EXLM, DE_LESS, DE_MORE, DE_EQL, DE_AMPR, DE_ACUT },
  51. { _______, DE_BSLS, DE_SLSH, DE_LCBR, DE_RCBR, DE_ASTR, DE_QST, DE_LPRN, DE_RPRN, DE_MINS, DE_COLN, _______ },
  52. { _______, DE_HASH, DE_DLR, DE_PIPE, DE_TILD, DE_EURO, DE_PLUS, DE_PERC, DE_DQOT, DE_QUOT, DE_SCLN, _______ },
  53. { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
  54. },
  55. /* Navigation & Number Blocks
  56. very easy to get used to & intuituve placement
  57. * ,-----------------------------------------------------------------------------------.
  58. * | | PgUp | Bksp | Up | DEL | PgDn | | 7 | 8 | 9 | | Ins |
  59. * |------+------+------+------+------+-------------+------+------+------+------+------|
  60. * | Tab | Home | Lft | Down | Right| End | . | 4 | 5 | 6 | , | Enter|
  61. * |------+------+------+------+------+------|------+------+------+------+------+------|
  62. * | Shift| | Tab | | Enter| | 0 | 1 | 2 | 3 | ; |Shift |
  63. * |------+------+------+------+------+------+------+------+------+------+------+------|
  64. * | Ctrl | GUI | Alt | M3 | M2 | Space | M2 | M3 | Alt | Esc | Ctrl |
  65. * `-----------------------------------------------------------------------------------'
  66. */
  67. [2] = {
  68. { KC_NO, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, KC_NO, DE_7, DE_8, DE_9, KC_NO, KC_INS },
  69. { KC_TAB, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, DE_DOT, DE_4, DE_5, DE_6, DE_COMM, KC_ENT },
  70. { _______, KC_NO, KC_TAB, KC_NO, KC_ENT, KC_NO, DE_0, DE_1, DE_2, DE_3, DE_SCLN, _______ },
  71. { _______, _______, _______, MO(3), _______, _______, _______, _______, MO(3), _______, _______, _______ }
  72. },
  73. /* Flipped Navigation & Number Blocks for one handed use
  74. accessed by sliding from M2 to M3 with thumb
  75. * ,-----------------------------------------------------------------------------------.
  76. * | Ins | | 7 | 8 | 9 | | PgUp | Bksp | Up | DEL | PgDn | |
  77. * |------+------+------+------+------+-------------+------+------+------+------+------|
  78. * | Tab | . | 4 | 5 | 6 | , | Home | Left | Down | Right| End | Enter|
  79. * |------+------+------+------+------+------|------+------+------+------+------+------|
  80. * | Shift| 0 | 1 | 2 | 3 | ; | | Tab | Ins | Enter| |Shift |
  81. * |------+------+------+------+------+------+------+------+------+------+------+------|
  82. * | Ctrl | GUI | Alt | M3 | | Space | | M3 | Alt | Esc | Ctrl |
  83. * `-----------------------------------------------------------------------------------'
  84. */
  85. [3] = {
  86. { KC_INS, KC_NO, DE_7, DE_8, DE_9, KC_NO, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, KC_NO },
  87. { _______, DE_DOT, DE_4, DE_5, DE_6, DE_COMM, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______ },
  88. { _______, DE_0, DE_1, DE_2, DE_3, DE_SCLN, KC_NO, KC_TAB, KC_INS, KC_ENT, KC_NO, _______ },
  89. { _______, _______, _______, _______, KC_NO, _______, _______, KC_NO, _______, _______, _______, _______ }
  90. },
  91. /* Function & Media Keys
  92. slide from m4 to m5 to access flipped version
  93. * ,-----------------------------------------------------------------------------------.
  94. * | | | Print|Scroll|Pause | | | F7 | F8 | F9 | F12 | |
  95. * |------+------+------+------+------+-------------+------+------+------+------+------|
  96. * | | | Mute | Vol- | Vol+ | | ³ | F4 | F5 | F6 | F11 | |
  97. * |------+------+------+------+------+------|------+------+------+------+------+------|
  98. * | Shift| | Prev | Play | Next | | ² | F1 | F2 | F3 | F10 |Shift |
  99. * |------+------+------+------+------+------+------+------+------+------+------+------|
  100. * | Ctrl | GUI | Alt | M4 | M5 | Space | M5 | M4 | Alt | Esc | Ctrl |
  101. * `-----------------------------------------------------------------------------------'
  102. */
  103. [4] = {
  104. { KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO, KC_F7, KC_F8, KC_F9, KC_F12, KC_NO },
  105. { KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO },
  106. { _______, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, _______ },
  107. { _______, _______, _______, _______, MO(5), _______, _______, MO(5), _______, _______, _______, _______ }
  108. },
  109. /* flipped Function & Media Keys
  110. * ,-----------------------------------------------------------------------------------.
  111. * | | | F7 | F8 | F9 | F12 | | Print|Scroll| Pause| | |
  112. * |------+------+------+------+------+-------------+------+------+------+------+------|
  113. * | | ³ | F4 | F5 | F6 | F11 | | Mute | Vol- | Vol+ | | |
  114. * |------+------+------+------+------+------|------+------+------+------+------+------|
  115. * | Shift| ² | F1 | F2 | F3 | F10 | | Prev | Play | Next | |Shift |
  116. * |------+------+------+------+------+------+------+------+------+------+------+------|
  117. * | Ctrl | GUI | Alt | | M5 | Space | M5 | | Alt | Esc | Ctrl |
  118. * `-----------------------------------------------------------------------------------'
  119. */
  120. [5] = {
  121. { KC_NO, KC_NO, KC_F7, KC_F8, KC_F9, KC_F12, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO },
  122. { KC_NO, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO },
  123. { _______, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, _______ },
  124. { _______, _______, _______, KC_NO, _______, _______, _______, _______, KC_NO, _______, _______, _______ }
  125. }
  126. };
  127. const uint16_t PROGMEM fn_actions[] = {
  128. };
  129. const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
  130. {
  131. // MACRODOWN only works in this function
  132. switch (id) {
  133. case 0:
  134. if (record->event.pressed) {
  135. register_code(KC_RSFT);
  136. #ifdef BACKLIGHT_ENABLE
  137. backlight_step();
  138. #endif
  139. }
  140. else {
  141. unregister_code(KC_RSFT);
  142. }
  143. break;
  144. }
  145. return MACRO_NONE;
  146. };