keymap_osx_de.c 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. #include "ergodox_ez.h"
  2. #include "debug.h"
  3. #include "action_layer.h"
  4. #include "keymap_extras/keymap_german.h"
  5. #define BASE 0 // default layer
  6. #define SYMB 1 // symbols
  7. #define MDIA 2 // media keys
  8. #define CRSR 3 // media keys
  9. #define NUMB 4 // number keys
  10. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  11. /* Keymap 0: Basic layer
  12. *
  13. * ,--------------------------------------------------. ,--------------------------------------------------.
  14. * | ESC | 1 | 2 | 3 | 4 | 5 |CMD-V | |CMD-C | 6 | 7 | 8 | 9 | 0 | ß |
  15. * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
  16. * | TAB | Q | W | E | R | T | CMD | | CMD | Z | U | I | O | P | ü |
  17. * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
  18. * | L3 | A | S | D | F | G |------| |------| H | J | K | L | ö | ä/L2 |
  19. * |--------+------+------+------+------+------| LALT | | RALT |------+------+------+------+------+--------|
  20. * | LShift |Y/Ctrl| X | C | V | B | | | | N | M | , | . |-/Ctrl| RShift |
  21. * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
  22. * |</L1| ^° |AltShf| Left | Right| | Up | Down | CMD-SHIFT | + | #/L1 |
  23. * `----------------------------------' `----------------------------------'
  24. * ,-------------. ,---------------.
  25. * | MDIA | Meh | | Hyper| NUM |
  26. * ,------|------|------| |------+--------+------.
  27. * | | | Home | | PgUp | | |
  28. * | Back-| Del |------| |------| Enter | Space|
  29. * | Space| | End | | PgDn | | |
  30. * `--------------------' `----------------------'
  31. */
  32. // If it accepts an argument (i.e, is a function), it doesn't need KC_.
  33. // Otherwise, it needs KC_*
  34. [BASE] = KEYMAP( // layer 0 : default
  35. // left hand
  36. KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(KC_V),
  37. KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LGUI,
  38. TG(3), KC_A, KC_S, KC_D, KC_F, KC_G,
  39. KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_LALT,
  40. LT(SYMB,KC_GRV), DE_LESS, LALT(KC_LSFT), KC_LEFT,KC_RGHT,
  41. TG(2), MEH_T(LSFT(DE_ACUT)),
  42. KC_HOME,
  43. KC_BSPC,KC_DEL,KC_END,
  44. // right hand
  45. LGUI(KC_C), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
  46. KC_RGUI, KC_Y, KC_U, KC_I, KC_O, KC_P, DE_UE,
  47. KC_H, KC_J, KC_K, KC_L, KC_SCLN,LT(MDIA,DE_AE),
  48. KC_RALT,KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
  49. KC_UP, KC_DOWN,LGUI(KC_LSFT),KC_RBRC, LT(SYMB,KC_BSLS),
  50. ALL_T(DE_ACUT), TG(4),
  51. KC_PGUP,
  52. KC_PGDN,KC_ENT, KC_SPC
  53. ),
  54. /* Keymap 1: Symbol Layer
  55. *
  56. * ,--------------------------------------------------. ,--------------------------------------------------.
  57. * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
  58. * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
  59. * | | | | ! | ? | | | | | \ | [ | ] | | | # | F12 |
  60. * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
  61. * | | # | $ | \ | / | . |------| |------| / | ( | ) | { | } | |
  62. * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
  63. * | | | ^ | % | | | ~ | | | | & | < | > | " | ' | ? |
  64. * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
  65. * | | | | | | | | | . | ! | |
  66. * `----------------------------------' `----------------------------------'
  67. * ,-------------. ,-------------.
  68. * | | | | | |
  69. * ,------|------|------| |------+------+------.
  70. * | | | | | | | |
  71. * | | |------| |------| | |
  72. * | | | | | | | |
  73. * `--------------------' `--------------------'
  74. */
  75. // SYMBOLS
  76. [SYMB] = KEYMAP(
  77. // left hand
  78. KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
  79. KC_TRNS,KC_GRV,LSFT(KC_GRV),DE_EXLM,DE_QST,KC_TRNS,KC_TRNS,
  80. KC_TRNS,DE_HASH,DE_DLR, LALT(LSFT(KC_7)),DE_SLSH,KC_DOT,
  81. KC_TRNS,KC_TRNS,DE_LESS,DE_PERC,LALT(KC_7),LALT(KC_N),KC_TRNS,
  82. KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
  83. KC_TRNS,KC_TRNS,
  84. KC_TRNS,
  85. KC_TRNS,KC_DEL,KC_TRNS,
  86. // right hand
  87. KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
  88. KC_TRNS, LALT(LSFT(KC_7)), LALT(KC_5), LALT(KC_6), LALT(KC_7), DE_HASH, KC_F12,
  89. DE_SLSH, DE_LPRN, DE_RPRN, LALT(KC_8), LALT(KC_9), KC_TRNS,
  90. KC_TRNS, DE_AMPR, KC_GRV, LSFT(KC_GRV), DE_DQOT, DE_QUOT, DE_QST,
  91. KC_TRNS,KC_DOT, KC_EXLM, KC_TRNS, KC_TRNS,
  92. KC_TRNS, KC_TRNS,
  93. KC_TRNS,
  94. KC_TRNS, KC_TRNS, KC_TRNS
  95. ),
  96. /* Keymap 2: Media and mouse keys
  97. *
  98. * ,--------------------------------------------------. ,--------------------------------------------------.
  99. * | | | | | | | | | | | | | | | Play |
  100. * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
  101. * | | | | MsUp | | | | | | | | | | | |
  102. * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
  103. * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | |
  104. * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
  105. * | | | | | | | | | | | | Prev | Next | | |
  106. * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
  107. * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
  108. * `----------------------------------' `----------------------------------'
  109. * ,-------------. ,-------------.
  110. * | | | | | |
  111. * ,------|------|------| |------+------+------.
  112. * | | | | | | |Brwser|
  113. * | | |------| |------| |Back |
  114. * | | | | | | | |
  115. * `--------------------' `--------------------'
  116. */
  117. // MEDIA AND MOUSE
  118. KEYMAP(
  119. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  120. KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
  121. KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
  122. KC_TRNS, KC_WH_L, KC_WH_U, KC_WH_D, KC_WH_R, KC_BTN3, KC_TRNS,
  123. KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
  124. KC_TRNS, KC_TRNS,
  125. KC_TRNS,
  126. KC_TRNS, KC_TRNS, KC_TRNS,
  127. // right hand
  128. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
  129. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  130. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  131. KC_TRNS, KC_TRNS, KC_MUTE, KC_MPRV, KC_MNXT, KC_UP, KC_TRNS,
  132. KC_VOLU, KC_VOLD, KC_LEFT, KC_DOWN, KC_RIGHT,
  133. KC_TRNS, KC_TRNS,
  134. KC_TRNS,
  135. KC_TRNS, KC_TRNS, KC_WBAK
  136. ),
  137. // Cursor layer
  138. KEYMAP(
  139. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  140. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  141. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  142. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  143. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  144. KC_TRNS, KC_TRNS,
  145. KC_TRNS,
  146. KC_TRNS, KC_TRNS, KC_TRNS,
  147. // right hand
  148. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  149. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  150. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  151. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS,
  152. KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT,
  153. KC_TRNS, KC_TRNS,
  154. KC_TRNS,
  155. KC_TRNS, KC_TRNS, KC_TRNS
  156. ),
  157. //number pad
  158. KEYMAP(
  159. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  160. KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS,
  161. KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS,
  162. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  163. KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
  164. KC_TRNS, KC_TRNS,
  165. KC_TRNS,
  166. KC_TRNS, KC_TRNS, KC_TRNS,
  167. // right hand
  168. KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
  169. KC_TRNS, KC_UP, KC_7, KC_8, KC_9, LSFT(KC_RBRC), KC_F12,
  170. KC_DOWN, KC_4, KC_5, KC_6, KC_RBRC, KC_TRNS,
  171. KC_TRNS, LSFT(KC_6), KC_1, KC_2, KC_3, LSFT(KC_7), KC_TRNS,
  172. KC_0,KC_DOT, KC_0, KC_EQL, KC_TRNS,
  173. KC_TRNS, KC_TRNS,
  174. KC_TRNS,
  175. KC_TRNS, KC_TRNS, KC_TRNS
  176. ),
  177. };
  178. const uint16_t PROGMEM fn_actions[] = {
  179. [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols)
  180. [2] = ACTION_LAYER_TAP_TOGGLE(CRSR) // FN2 - Momentary Layer 2 (Cursors)
  181. };
  182. const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
  183. {
  184. // MACRODOWN only works in this function
  185. switch(id) {
  186. case 0:
  187. if (record->event.pressed) {
  188. register_code(KC_RSFT);
  189. } else {
  190. unregister_code(KC_RSFT);
  191. }
  192. break;
  193. }
  194. return MACRO_NONE;
  195. };
  196. // Runs just one time when the keyboard initializes.
  197. void * matrix_init_user(void) {
  198. };
  199. // Runs constantly in the background, in a loop.
  200. void * matrix_scan_user(void) {
  201. uint8_t layer = biton32(layer_state);
  202. ergodox_board_led_off();
  203. ergodox_right_led_1_off();
  204. ergodox_right_led_2_off();
  205. ergodox_right_led_3_off();
  206. switch (layer) {
  207. // TODO: Make this relevant to the ErgoDox EZ.
  208. case 1:
  209. ergodox_right_led_1_on();
  210. break;
  211. case 2:
  212. ergodox_right_led_2_on();
  213. break;
  214. case 3:
  215. ergodox_right_led_3_on();
  216. break;
  217. case 4:
  218. ergodox_right_led_1_on();
  219. ergodox_right_led_3_on();
  220. //ergodox_board_led_on();
  221. break;
  222. default:
  223. // none
  224. break;
  225. }
  226. };