You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
3.6 KiB

  1. #include QMK_KEYBOARD_H
  2. // Keymap myee
  3. // Each layer gets a name for readability, which is then used in the keymap matrix below.
  4. // The underscores don't mean anything - you can have a layer called STUFF or any other name.
  5. // Layer names don't all need to be of the same length, obviously, and you can also skip them
  6. // entirely and just use numbers.
  7. #define _QWERTY 0
  8. #define _LOWER 1
  9. #define _RAISE 2
  10. #define _ADJUST 3
  11. enum custom_keycodes {
  12. QWERTY = SAFE_RANGE,
  13. LOWER,
  14. RAISE,
  15. ADJUST,
  16. };
  17. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  18. [_QWERTY] = LAYOUT( \
  19. KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,\
  20. F(2), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, \
  21. KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, \
  22. KC_LCTL, KC_LGUI,KC_LALT, F(0), F(1), KC_RGUI,KC_RALT, KC_RCTL \
  23. ),
  24. [_LOWER] = LAYOUT( \
  25. KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_UP, KC_MINS, KC_EQL, KC_DEL, \
  26. _______, _______, KC_ASTR, KC_LBRC, KC_RBRC, KC_QUOT, KC_DQUO, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSLS, \
  27. _______, _______, _______, KC_LPRN, KC_RPRN, KC_HOME, KC_PGUP, KC_PGDN, KC_END, _______, _______, \
  28. _______, _______, _______, _______, _______, _______, _______, _______ \
  29. ),
  30. [_RAISE] = LAYOUT( \
  31. KC_GRV, KC_LPRN, KC_RPRN, KC_DQUO, KC_QUOT, KC_SCLN, KC_COLON,KC_UNDS, KC_PLUS, _______, _______, KC_BSPC, \
  32. _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \
  33. _______, _______, _______, KC_LCBR, KC_RCBR, _______, _______, _______, _______, _______, _______, \
  34. _______, _______, _______, _______, _______, _______, BL_INC, BL_DEC \
  35. ),
  36. [_ADJUST] = LAYOUT( \
  37. _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
  38. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
  39. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
  40. KC_SYSTEM_SLEEP, _______, _______, _______, _______, _______, _______, _______ \
  41. ),
  42. };
  43. enum function_id {
  44. LAUNCH,
  45. RGBLED_TOGGLE,
  46. };
  47. const uint16_t PROGMEM fn_actions[] = {
  48. [0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC),
  49. [1] = ACTION_LAYER_TAP_KEY(_RAISE, KC_SPC),
  50. [2] = ACTION_LAYER_TAP_KEY(_ADJUST,KC_TAB),
  51. };
  52. const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
  53. {
  54. // MACRODOWN only works in this function
  55. return MACRO_NONE;
  56. };
  57. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  58. switch (keycode) {
  59. case LOWER:
  60. if (record->event.pressed) {
  61. layer_on(_LOWER);
  62. update_tri_layer(_LOWER, _RAISE, _ADJUST);
  63. } else {
  64. layer_off(_LOWER);
  65. update_tri_layer(_LOWER, _RAISE, _ADJUST);
  66. }
  67. return false;
  68. break;
  69. case RAISE:
  70. if (record->event.pressed) {
  71. layer_on(_RAISE);
  72. update_tri_layer(_LOWER, _RAISE, _ADJUST);
  73. } else {
  74. layer_off(_RAISE);
  75. update_tri_layer(_LOWER, _RAISE, _ADJUST);
  76. }
  77. return false;
  78. break;
  79. case ADJUST:
  80. if (record->event.pressed) {
  81. layer_on(_ADJUST);
  82. } else {
  83. layer_off(_ADJUST);
  84. }
  85. return false;
  86. break;
  87. }
  88. return true;
  89. }