keymap.c 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. // Default ECO Layout
  2. // KLE here : http://www.keyboard-layout-editor.com/#/gists/0733eca6b4cb88ff9d7de746803f4039
  3. #include QMK_KEYBOARD_H
  4. extern keymap_config_t keymap_config;
  5. // Each layer gets a name for readability, which is then used in the keymap matrix below.
  6. // The underscores don't mean anything - you can have a layer called STUFF or any other name.
  7. // Layer names don't all need to be of the same length, obviously, and you can also skip them
  8. // entirely and just use numbers.
  9. #define _QWERTY 0
  10. #define _LOWER 1
  11. #define _RAISE 2
  12. #define _FN3 3
  13. enum eco_keycodes {
  14. QWERTY = SAFE_RANGE,
  15. LOWER,
  16. RAISE,
  17. };
  18. // Fillers to make layering more clear
  19. #define KC_ KC_TRNS
  20. #define _______ KC_TRNS
  21. #define XXXXXXX KC_NO
  22. #define KC_RST RESET
  23. #define KC_DBUG DEBUG
  24. #define KC_LOWR MO(_LOWER)
  25. #define KC_RASE MO(_RAISE)
  26. #define KC_ENTS MT(MOD_LSFT, KC_ENT)
  27. #define KC_ESCC MT(MOD_LCTL, KC_ESC)
  28. #define KC_GRVF LT(_FN3, KC_GRV)
  29. #define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen
  30. #define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen
  31. #define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen
  32. #define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen
  33. #define KC_RTOG RGB_TOG
  34. #define KC_RMOD RGB_MOD
  35. #define KC_RHUI RGB_HUI
  36. #define KC_RHUD RGB_HUD
  37. #define KC_RSAI RGB_SAI
  38. #define KC_RSAD RGB_SAD
  39. #define KC_RVAI RGB_VAI
  40. #define KC_RVAD RGB_VAD
  41. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  42. [_QWERTY] = LAYOUT_kc(
  43. //,----+----+----+----+----+----+----+----+----+----+----+----+----+----.
  44. TAB , Q , W , E , R , T ,LPRN,RPRN, Y , U , I , O , P ,MINS,
  45. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  46. ESCC, A , S , D , F , G ,LBRC,RBRC, H , J , K , L ,SCLN,QUOT,
  47. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  48. LSFT, Z , X , C , V , B ,LCBR,RCBR, N , M ,COMM,DOT ,SLSH,ENTS,
  49. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  50. GRVF,LCTL,LALT,LGUI,LOWR,SPC ,SPC ,BSPC,BSPC,RASE,LEFT,DOWN, UP ,RGHT
  51. //`----+----+----+----+----+----+----+----+----+----+----+----+----+----'
  52. ),
  53. [_LOWER] = LAYOUT_kc(
  54. //,----+----+----+----+----+----+----+----+----+----+----+----+----+----.
  55. , 1 , 2 , 3 , 4 , 5 ,LPRN,RPRN, 6 , 7 , 8 , 9 , 0 , ,
  56. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  57. DEL ,CAPP,LEFT,RGHT, UP ,LBRC,LBRC,RBRC,RBRC, P4 , P5 , P6 ,PLUS,PIPE,
  58. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  59. ,CPYP, , ,DOWN,LCBR,LCBR,RCBR,RCBR, P1 , P2 , P3 ,MINS, ,
  60. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  61. , , , , , , ,DEL ,DEL , , P0 ,PDOT, ,
  62. //`----+----+----+----+----+----+----+----+----+----+----+----+----+----'
  63. ),
  64. [_RAISE] = LAYOUT_kc(
  65. //,----+----+----+----+----+----+----+----+----+----+----+----+----+----.
  66. ,EXLM, AT ,HASH,DLR ,PERC, , ,CIRC,AMPR,ASTR,LPRN,RPRN, ,
  67. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  68. DEL ,MPRV,MNXT,VOLU,PGUP,UNDS, , ,EQL ,HOME, , , ,BSLS,
  69. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  70. MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , , ,
  71. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  72. , , , , , , , , , , , , ,
  73. //`----+----+----+----+----+----+----+----+----+----+----+----+----+----'
  74. ),
  75. [_FN3] = LAYOUT_kc(
  76. //,----+----+----+----+----+----+----+----+----+----+----+----+----+----.
  77. F12 , F1 , F2 , F3 , F4 , F5 , , , F6 , F7 , F8 , F9 ,F10 ,F11 ,
  78. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  79. RTOG,RMOD,RHUI,RSAI,RVAI, , , , , , , , , ,
  80. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  81. RST ,DBUG,RHUD,RSAD,RVAD, , , , , , , , , ,
  82. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  83. , , , , , , , , , , , , ,
  84. //`----+----+----+----+----+----+----+----+----+----+----+----+----+----'
  85. ),
  86. };
  87. void persistant_default_layer_set(uint16_t default_layer) {
  88. eeconfig_update_default_layer(default_layer);
  89. default_layer_set(default_layer);
  90. }
  91. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  92. switch (keycode) {
  93. case QWERTY:
  94. if (record->event.pressed) {
  95. persistant_default_layer_set(1UL<<_QWERTY);
  96. }
  97. return false;
  98. break;
  99. }
  100. return true;
  101. }