logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

keymap.c (5569B)


  1. #include QMK_KEYBOARD_H
  2. // Used for SHIFT_ESC
  3. #define MODS_SHIFT_MASK (MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT))
  4. // Each layer gets a name for readability, which is then used in the keymap matrix below.
  5. // The underscores don't mean anything - you can have a layer called STUFF or any other name.
  6. // Layer names don't all need to be of the same length, obviously, and you can also skip them
  7. // entirely and just use numbers.
  8. #define _BL 0
  9. #define _FL 1
  10. #define _RL 2
  11. enum custom_keycodes {
  12. SFT_ESC = SAFE_RANGE
  13. };
  14. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  15. /* Keymap _BL: (Base Layer) Default Layer
  16. * ,-----------------------------------------------------------.
  17. * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |
  18. * |-----------------------------------------------------------|
  19. * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |
  20. * |-----------------------------------------------------------|
  21. * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
  22. * |-----------------------------------------------------------|
  23. * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |
  24. * |-----------------------------------------------------------|
  25. * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl |
  26. * `-----------------------------------------------------------'
  27. */
  28. [_BL] = LAYOUT_60_ansi(
  29. SFT_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
  30. KC_TAB, 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_BSLS,
  31. KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
  32. KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
  33. KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_RL), MO(_FL), KC_RCTL
  34. ),
  35. /* Keymap _FL: Function Layer
  36. * ,-----------------------------------------------------------.
  37. * | ~ | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| DEL |
  38. * |-----------------------------------------------------------|
  39. * | | |Up| | | |Cal| |Ins| |PrSc|Sclk|Paus| |
  40. * |-----------------------------------------------------------|
  41. * | |Left|Down|Rig| | | | | | |Home|PgUp| |
  42. * |-----------------------------------------------------------|
  43. * | | |App| | | |Vdn|Vup|Mute|End|PgDn| |
  44. * |-----------------------------------------------------------|
  45. * | | | | | | | | |
  46. * `-----------------------------------------------------------'
  47. */
  48. [_FL] = LAYOUT_60_ansi(
  49. KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
  50. _______, _______, KC_UP, _______, _______, _______, KC_CALC, _______, KC_INS, _______, KC_PSCR, KC_SCRL, KC_PAUS, _______,
  51. _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______,
  52. _______, _______, KC_APP, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, _______,
  53. _______, _______, _______, _______, _______, _______, _______, _______
  54. ),
  55. /* Keymap _RL: Function Layer
  56. * ,-----------------------------------------------------------.
  57. * | | | | | | | | | | | | | | QK_BOOT|
  58. * |-----------------------------------------------------------|
  59. * | | | | | | | | | | | |BL-|BL+|BL |
  60. * |-----------------------------------------------------------|
  61. * | | | | | | | | | | | | |
  62. * |-----------------------------------------------------------|
  63. * | | F1|F2 | F3|F4 | F5| F6| F7| F8| | | |
  64. * |-----------------------------------------------------------|
  65. * | | | | | | | | |
  66. * `-----------------------------------------------------------'
  67. */
  68. [_RL] = LAYOUT_60_ansi(
  69. KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT,
  70. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DOWN, BL_UP, BL_TOGG,
  71. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  72. _______, UG_TOGG, UG_NEXT, UG_HUEU, UG_HUED, UG_SATU, UG_SATD, UG_VALU, UG_VALD, _______, _______, _______,
  73. _______, _______, _______, _______, _______, _______, _______, _______
  74. ),
  75. };
  76. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  77. switch (keycode) {
  78. case SFT_ESC:
  79. if (record->event.pressed) {
  80. if (get_mods() & MODS_SHIFT_MASK) {
  81. add_key(KC_GRV);
  82. send_keyboard_report();
  83. } else {
  84. add_key(KC_ESC);
  85. send_keyboard_report();
  86. }
  87. } else {
  88. if (get_mods() & MODS_SHIFT_MASK) {
  89. del_key(KC_GRV);
  90. send_keyboard_report();
  91. } else {
  92. del_key(KC_ESC);
  93. send_keyboard_report();
  94. }
  95. }
  96. return false;
  97. default:
  98. return true;
  99. }
  100. }