keymap.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #include QMK_KEYBOARD_H
  2. // Macro keys for some apps
  3. #define SLACKUP LALT(LSFT(KC_UP))
  4. #define SLACKDN LALT(LSFT(KC_DOWN))
  5. #define RELOAD LGUI(KC_R)
  6. enum custom_keycodes {
  7. PAWFIVE = SAFE_RANGE
  8. };
  9. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  10. [0] = LAYOUT(
  11. QK_BOOT, PAWFIVE, RELOAD ,
  12. SLACKUP, KC_UP , KC_PGUP,
  13. SLACKDN, KC_DOWN, KC_PGDN
  14. ),
  15. };
  16. void keyboard_post_init_user(void) {
  17. // Call the post init code.
  18. rgblight_enable_noeeprom(); // enables Rgb, without saving settings
  19. rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL); // sets mode to Slow breathing without saving
  20. }
  21. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  22. switch (keycode) {
  23. case PAWFIVE:
  24. if (record->event.pressed) {
  25. SEND_STRING("+:pawfive:\n");
  26. return false;
  27. }
  28. }
  29. return true;
  30. }
  31. bool encoder_update_user(uint8_t index, bool clockwise) {
  32. if (index == 0) {
  33. if (clockwise) {
  34. // Tab right
  35. tap_code16(LSFT(LGUI(KC_RBRC)));
  36. } else {
  37. // Tab left
  38. tap_code16(LSFT(LGUI(KC_LBRC)));
  39. }
  40. }
  41. else if (index == 1) {
  42. if (clockwise) {
  43. // History forward
  44. tap_code16(LGUI(KC_RBRC));
  45. } else {
  46. // History back
  47. tap_code16(LGUI(KC_LBRC));
  48. }
  49. }
  50. return true;
  51. }