logo

qmk_firmware

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

keymap.c (3570B)


  1. /* Copyright 2021 James Sa
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include QMK_KEYBOARD_H
  17. // Defines names for use in layer keycodes and the keymap
  18. enum layer_names {
  19. _BASE, // Colemak mod DH
  20. _KAI, // beginner, no modifier on home row
  21. _PUNC, // puncuation
  22. _FN // function
  23. };
  24. #define _C(X) CTL_T(X)
  25. #define _A(X) ALT_T(X)
  26. #define _S(X) SFT_T(X)
  27. #define _G(X) GUI_T(X)
  28. #define FN_TAB LT(_FN, KC_TAB)
  29. #define PN_BS LT(_PUNC, KC_BSPC)
  30. // macOS shortcut
  31. #define _MSNCTL C(KC_UP)
  32. #define _APPWIN C(KC_DOWN)
  33. #define WKSPLF C(KC_LEFT)
  34. #define WKSPRT C(KC_RGHT)
  35. #define COPY G(KC_C)
  36. #define PSTE G(KC_V)
  37. #define CUT G(KC_X)
  38. #define UNDO G(KC_Z)
  39. #define REDO G(S(KC_Z))
  40. #define SCNSHOT S(G(KC_4))
  41. // window management utility
  42. #define DIVVY G(KC_G)
  43. // puncuation
  44. #define KC_DQOT S(KC_QUOT) // "
  45. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  46. [_BASE] LAYOUT(
  47. KC_Q, KC_W, KC_F, KC_P, KC_B, KC_QUOT, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,
  48. _C(KC_A),_A(KC_R),_S(KC_S),_G(KC_T),KC_G, KC_LBRC, KC_RBRC, KC_M, _G(KC_N),_S(KC_E),_A(KC_I),_C(KC_O),
  49. KC_Z, KC_X, KC_C, KC_D, KC_V, KC_MINS, KC_GRV, KC_EQL, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH,
  50. KC_ESC, KC_UP, KC_DOWN, PN_BS, FN_TAB, KC_ENT, KC_CAPS, KC_SPC, KC_LEFT, KC_RGHT, KC_BSLS
  51. ),
  52. [_KAI] LAYOUT(
  53. KC_Q, KC_W, KC_F, KC_P, KC_B, KC_QUOT, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,
  54. KC_A, KC_R, KC_S, KC_T, KC_G, KC_LBRC, KC_RBRC, KC_M, KC_N, KC_E, KC_I, KC_O,
  55. _S(KC_Z),KC_X, KC_C, KC_D, KC_V, KC_MINS,TO(_BASE),KC_EQL, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH,
  56. _C(KC_ESC), _A(KC_UP), _G(KC_DOWN), PN_BS, FN_TAB, KC_ENT, KC_CAPS, KC_SPC, KC_LEFT, KC_RGHT, KC_BSLS
  57. ),
  58. [_PUNC] LAYOUT(
  59. KC_PERC, KC_CIRC, KC_AMPR, KC_DLR, _______, _______, _______, KC_7, KC_8, KC_9, KC_PLUS,
  60. KC_EXLM, KC_AT, KC_HASH, KC_DQOT, KC_LPRN, _______, _______, KC_RPRN, KC_4, KC_5, KC_6, KC_MINS,
  61. _______, _______, _______, KC_QUOT, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_ASTR,
  62. _______, _______, _______, _______, _______, _______, _______, KC_0, KC_COMM, KC_DOT, KC_SLSH
  63. ),
  64. [_FN] LAYOUT(
  65. _______, SCNSHOT, DIVVY, _______, _______, _______, _______, _______, KC_UP, KC_VOLD, KC_VOLU,
  66. UNDO, CUT, COPY, PSTE, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______,
  67. REDO, WKSPLF, _MSNCTL, WKSPRT, _______, _______,TO(_KAI), _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END,
  68. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
  69. )
  70. };