keymap.c 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // This is the canonical layout file for the Quantum project. If you want to add another keyboard,
  2. // this is the style you want to emulate.
  3. // Default ECO Layout
  4. // KLE here : http://www.keyboard-layout-editor.com/#/gists/0733eca6b4cb88ff9d7de746803f4039
  5. #include "eco.h"
  6. #include "action_layer.h"
  7. #include "eeconfig.h"
  8. extern keymap_config_t keymap_config;
  9. // Each layer gets a name for readability, which is then used in the keymap matrix below.
  10. // The underscores don't mean anything - you can have a layer called STUFF or any other name.
  11. // Layer names don't all need to be of the same length, obviously, and you can also skip them
  12. // entirely and just use numbers.
  13. #define _QWERTY 0
  14. #define _FN1 2
  15. #define _FN2 3
  16. enum eco_keycodes {
  17. QWERTY = SAFE_RANGE
  18. };
  19. // Fillers to make layering more clear
  20. #define _______ KC_TRNS
  21. #define XXXXXXX KC_NO
  22. // Defines for task manager and such
  23. #define CALTDEL LCTL(LALT(KC_DEL))
  24. #define TSKMGR LCTL(LSFT(KC_ESC))
  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 | [ | ] | Bksp |
  29. * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
  30. * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | Enter| \ |
  31. * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
  32. * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift| Up | Del |
  33. * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
  34. * | Ctrl | GUI | Alt | Del | FN1 | FN1 | Space| Space| FN2 | FN2 | Ctrl | Left | Down | Right|
  35. * `-------------------------------------------------------------------------------------------------'
  36. */
  37. [_QWERTY] = KEYMAP(
  38. KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC,
  39. KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_BSLS,
  40. KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DEL,
  41. KC_LCTL, KC_LGUI,KC_LALT, KC_DEL, MO(_FN1), MO(_FN1), KC_SPC, KC_SPC, MO(_FN2), MO(_FN2), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
  42. ),
  43. /* FN1
  44. * ,-------------------------------------------------------------------------------------------------.
  45. * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | |
  46. * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
  47. * |caltde| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | |
  48. * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
  49. * | | | | | | | | | | | | | | |
  50. * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
  51. * | | | | | | | | | | | | | | RESET|
  52. * `-------------------------------------------------------------------------------------------------'
  53. */
  54. [_FN1] = KEYMAP(
  55. _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, KC_PLUS, _______,
  56. CALTDEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,
  57. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  58. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET
  59. ),
  60. /* Raise
  61. * ,-------------------------------------------------------------------------------------------------.
  62. * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | |
  63. * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
  64. * |Taskmg| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | |
  65. * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
  66. * | | | | | | | | | | | | | | |
  67. * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
  68. * | | | | | | | | | | | | | | |
  69. * `-------------------------------------------------------------------------------------------------'
  70. */
  71. [_FN2] = KEYMAP(
  72. _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______,
  73. TSKMGR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,
  74. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  75. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
  76. )
  77. };
  78. void persistant_default_layer_set(uint16_t default_layer) {
  79. eeconfig_update_default_layer(default_layer);
  80. default_layer_set(default_layer);
  81. }
  82. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  83. switch (keycode) {
  84. case QWERTY:
  85. if (record->event.pressed) {
  86. persistant_default_layer_set(1UL<<_QWERTY);
  87. }
  88. return false;
  89. break;
  90. }
  91. return true;
  92. }