keymap.c 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /* This is the Atreus62 keyboard layout by Xyverz aka u/Zrevyx on r/mk
  2. I've blatantly stolen what works for me from the Planck and Preonic
  3. layouts and modified this file to fit me. Initial credet goes to
  4. u/profet23 for the doing all the work and adding this keyboard to
  5. QMK in the first place.
  6. I've got Dvorak, Qwerty, and Colemak layouts at this time, with the
  7. possibility of adding more in the future.
  8. The bottom row is fairly Kinesis-ish since the Contour and Advantage
  9. keyboards have been my daily drivers for the last 17 years. I hope
  10. You can get some enjoyment out of this layout should you chose it!
  11. CHANGELOG:
  12. 0.1 - Initial commit. Based off of Profet's default keymap.
  13. 0.2 - Converted to a more Planck/Preonic keymap style file with
  14. persistent layers enabled. Renamed layers to reflect OLKB maps.
  15. Added a TODO list.
  16. 0.3 - Moved location of media & volume keys. Added Print Screen,
  17. Scroll Lock and Pause keys. Added a WOW gaming layer that
  18. changes the location of Ctrl & Alt to the thumb keys. Added
  19. readme.
  20. 0.4 - After more useage, I realized that the ESC key was in the way
  21. of my muscle memory (gee, thanks, Planck!) so I moved it to
  22. the normal Caps Lock position, and moved Caps Lock to the same
  23. position on the RAISE and LOWER layers. Added code to turn off
  24. the Pro Micro LEDs after flashing.
  25. 0.5 - Converted keymap to LAYOUT standard.
  26. 0.6 - Swapped ESC and GRV in all layers.
  27. 0.7 - Brought code up to current standards.
  28. 0.8 - Added MACLOCK macro.
  29. 0.9 - Updated code to correspond to new setPinInput behaviour
  30. TODO:
  31. * Make the layout more efficient, even if it means changing the RAISE
  32. and LOWER functionality.
  33. * Add legends in comments for each layer. Maybe.
  34. */
  35. // this is the style you want to emulate.
  36. // This is the canonical layout file for the Quantum project. If you want to add another keyboard,
  37. #include QMK_KEYBOARD_H
  38. enum layer_names { _DVORAK, _QWERTY, _COLEMAK, _WOW, _DESTINY, _LOWER, _RAISE, _ADJUST };
  39. enum atreus52_keycodes { DVORAK = SAFE_RANGE, QWERTY, COLEMAK, WOW, DESTINY, LOWER, RAISE, ADJUST };
  40. // Aliases to make the keymap clearer.
  41. #define CTL_ENT CTL_T(KC_ENT)
  42. #define LOWER MO(_LOWER)
  43. #define RAISE MO(_RAISE)
  44. #define ADJUST MO(_ADJUST)
  45. #define MACLOCK LGUI(LCTL(KC_Q))
  46. // clang-format off
  47. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  48. [_DVORAK] = LAYOUT ( /* dvorak */
  49. KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
  50. KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,
  51. KC_GRV, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS,
  52. KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT,
  53. KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL
  54. ),
  55. [_QWERTY] = LAYOUT ( /* qwerty */
  56. KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
  57. KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL,
  58. KC_GRV, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
  59. KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
  60. KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL
  61. ),
  62. [_COLEMAK] = LAYOUT ( /* colemak */
  63. KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
  64. KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL,
  65. KC_GRV, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
  66. KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
  67. KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL
  68. ),
  69. [_WOW] = LAYOUT ( /* Dvorak with minor modifications for playing World of Warcraft */
  70. KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
  71. KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,
  72. KC_GRV, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS,
  73. KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT,
  74. KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, KC_LALT, CTL_ENT, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL
  75. ),
  76. [_DESTINY] = LAYOUT ( /* Dvorak with minor modifications for playing Destiny 2 and other FPS Looters */
  77. KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
  78. KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,
  79. KC_GRV, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS,
  80. KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT,
  81. KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, KC_DEL, KC_ENT, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL
  82. ),
  83. [_LOWER] = LAYOUT (
  84. KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12,
  85. KC_TILD, KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE,
  86. KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_PLUS, KC_LCBR, KC_RCBR, _______,
  87. _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______,
  88. _______, _______, KC_HOME, KC_END, _______, KC_DEL, MACLOCK, _______, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______
  89. ),
  90. [_RAISE] = LAYOUT (
  91. KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12,
  92. KC_TILD, KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSLS,
  93. KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_EQL, KC_LBRC, KC_RBRC, _______,
  94. _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______,
  95. _______, _______, KC_HOME, KC_END, _______, KC_DEL, MACLOCK, _______, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______
  96. ),
  97. [_ADJUST] = LAYOUT (
  98. _______, _______, _______, KC_F13, KC_F14, KC_F15, _______, _______, _______, _______, _______, _______,
  99. _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  100. _______, _______, _______, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, DESTINY, WOW,
  101. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  102. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
  103. ),
  104. };
  105. //clang-format on
  106. void matrix_init_user(void) {
  107. #ifdef BOOTLOADER_CATERINA
  108. // This will disable the red LEDs on the ProMicros
  109. setPinInput(D5);
  110. setPinInput(B0);
  111. #endif
  112. };
  113. layer_state_t layer_state_set_user(layer_state_t state) {
  114. return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
  115. };
  116. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  117. if (record->event.pressed) {
  118. switch (keycode) {
  119. case DVORAK:
  120. set_single_persistent_default_layer(_DVORAK);
  121. return false;
  122. case QWERTY:
  123. set_single_persistent_default_layer(_QWERTY);
  124. return false;
  125. case COLEMAK:
  126. set_single_persistent_default_layer(_COLEMAK);
  127. return false;
  128. case WOW:
  129. set_single_persistent_default_layer(_WOW);
  130. return false;
  131. case DESTINY:
  132. set_single_persistent_default_layer(_DESTINY);
  133. return false;
  134. }
  135. }
  136. return true;
  137. };