logo

qmk_firmware

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

keymap.c (2659B)


  1. /* Copyright 2020 Erkki Halinen
  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. enum layers {
  18. _QWERTY,
  19. _LOWER,
  20. _RAISE,
  21. };
  22. #define LOWER MO(_LOWER)
  23. #define RAISE MO(_RAISE)
  24. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  25. [_QWERTY] = LAYOUT_7u_space(
  26. KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_BSPC,
  27. KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_NUHS, KC_ENT,
  28. KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, LT(RAISE, KC_PGUP), KC_RSFT,
  29. KC_LSFT, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, LT(LOWER, KC_PGDN), KC_DEL
  30. ),
  31. [_LOWER] = LAYOUT_7u_space(
  32. KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, KC_DEL,
  33. KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, KC_ENT,
  34. _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, KC_RSFT,
  35. _______, _______, _______, _______, _______, _______, _______
  36. ),
  37. [_RAISE] = LAYOUT_7u_space(
  38. KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, KC_DEL,
  39. KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, KC_ENT,
  40. _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, KC_RSFT,
  41. KC_VOLU, KC_MPLY, KC_MNXT, _______, _______, _______, _______
  42. )
  43. };
  44. bool encoder_update_user(uint8_t index, bool clockwise) {
  45. if (clockwise) {
  46. tap_code(KC_PGDN);
  47. } else {
  48. tap_code(KC_PGUP);
  49. }
  50. return true;
  51. }