keymap.c 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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_RST RESET
  21. #define KC_DBUG DEBUG
  22. #define KC_LOWR MO(_LOWER)
  23. #define KC_RASE MO(_RAISE)
  24. #define KC_ENTS MT(MOD_LSFT, KC_ENT)
  25. #define KC_ESCC MT(MOD_LCTL, KC_ESC)
  26. #define KC_GRVF LT(_FN3, KC_GRV)
  27. #define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen
  28. #define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen
  29. #define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen
  30. #define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen
  31. #define KC_RTOG RGB_TOG
  32. #define KC_RMOD RGB_MOD
  33. #define KC_RHUI RGB_HUI
  34. #define KC_RHUD RGB_HUD
  35. #define KC_RSAI RGB_SAI
  36. #define KC_RSAD RGB_SAD
  37. #define KC_RVAI RGB_VAI
  38. #define KC_RVAD RGB_VAD
  39. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  40. [_QWERTY] = LAYOUT_kc(
  41. //,----+----+----+----+----+----+----+----+----+----+----+----+----+----.
  42. TAB , Q , W , E , R , T ,LPRN,RPRN, Y , U , I , O , P ,MINS,
  43. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  44. ESCC, A , S , D , F , G ,LBRC,RBRC, H , J , K , L ,SCLN,QUOT,
  45. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  46. LSFT, Z , X , C , V , B ,LCBR,RCBR, N , M ,COMM,DOT ,SLSH,ENTS,
  47. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  48. GRVF,LCTL,LALT,LGUI,LOWR,SPC ,SPC ,BSPC,BSPC,RASE,LEFT,DOWN, UP ,RGHT
  49. //`----+----+----+----+----+----+----+----+----+----+----+----+----+----'
  50. ),
  51. [_LOWER] = LAYOUT_kc(
  52. //,----+----+----+----+----+----+----+----+----+----+----+----+----+----.
  53. , 1 , 2 , 3 , 4 , 5 ,LPRN,RPRN, 6 , 7 , 8 , 9 , 0 , ,
  54. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  55. DEL ,CAPP,LEFT,RGHT, UP ,LBRC,LBRC,RBRC,RBRC, P4 , P5 , P6 ,PLUS,PIPE,
  56. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  57. ,CPYP, , ,DOWN,LCBR,LCBR,RCBR,RCBR, P1 , P2 , P3 ,MINS, ,
  58. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  59. , , , , , , ,DEL ,DEL , , P0 ,PDOT, ,
  60. //`----+----+----+----+----+----+----+----+----+----+----+----+----+----'
  61. ),
  62. [_RAISE] = LAYOUT_kc(
  63. //,----+----+----+----+----+----+----+----+----+----+----+----+----+----.
  64. ,EXLM, AT ,HASH,DLR ,PERC, , ,CIRC,AMPR,ASTR,LPRN,RPRN, ,
  65. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  66. DEL ,MPRV,MNXT,VOLU,PGUP,UNDS, , ,EQL ,HOME, , , ,BSLS,
  67. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  68. MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , , ,
  69. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  70. , , , , , , , , , , , , ,
  71. //`----+----+----+----+----+----+----+----+----+----+----+----+----+----'
  72. ),
  73. [_FN3] = LAYOUT_kc(
  74. //,----+----+----+----+----+----+----+----+----+----+----+----+----+----.
  75. F12 , F1 , F2 , F3 , F4 , F5 , , , F6 , F7 , F8 , F9 ,F10 ,F11 ,
  76. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  77. RTOG,RMOD,RHUI,RSAI,RVAI, , , , , , , , , ,
  78. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  79. RST ,DBUG,RHUD,RSAD,RVAD, , , , , , , , , ,
  80. //|----+----+----+----+----+----+----+----+----+----+----+----+----+----|
  81. , , , , , , , , , , , , ,
  82. //`----+----+----+----+----+----+----+----+----+----+----+----+----+----'
  83. ),
  84. };
  85. void persistant_default_layer_set(uint16_t default_layer) {
  86. eeconfig_update_default_layer(default_layer);
  87. default_layer_set(default_layer);
  88. }
  89. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  90. switch (keycode) {
  91. case QWERTY:
  92. if (record->event.pressed) {
  93. persistant_default_layer_set(1UL<<_QWERTY);
  94. }
  95. return false;
  96. break;
  97. }
  98. return true;
  99. }