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.

84 lines
2.1 KiB

ps2avrgb: fix incorrect avr ports specified (for numlock and capslock LEDs) (#3453) * Add M6-A keymap * Update XD60 keymap * Update XD60 keymap readme * Update JJ40 and Let's Split keymaps * Add readme for M6-A * Fix typo, update JJ40 README * Update jj40 readme * Cleanup jj40 keymap * Revert Let's Split QWERTY layer to default before #2010 * Update numpad layers * Fix: Let's Split keymap getting stuck mods due to having keycodes assigned on the Raise layer * Keep ASCII art consistent with keymap * Staryu: initial port * Add personal keymap * Added and updated READMEs * Fix: default keymap for staryu * Rudimentary backlight support. * Enabled mousekeys for default keymap * use QMK_KEYBOARD_H and LAYOUT * Update readme.md for NIU mini: flash using avrdude * Fix missing linebreaks for Staryu README * Update readme.md * Update PS2AVRGB boards with new matrix.c * Update canoe matrix.c; untested * Fix canoe.c for building (needs matrix_scan_user and matrix_init_user) * Add personal Iris keymap * Update keymap * Update keymap * Update keymap, disable backlighting and underglow * Move PrintScreen button * Add README * Update personal keymaps * Add INS key * Limit USB max power consumption, change Fn to MENU * Remove Numpad layer (easy to accidentally toggle) * Fix backlighting for ps2avrgb * Update comments to refer to actual pin naming * Possible fix for xyverz ortho keymap: define RGBLED_NUM * Make led_set_user in backlight.c overridable * Add changes to address points raised in code review, untested (don't have build env right now)
5 years ago
  1. /*
  2. Copyright 2018 Kenneth Aloysius
  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. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #include QMK_KEYBOARD_H
  15. #include "action_layer.h"
  16. #include "../../backlight_staryu.h"
  17. enum layers {
  18. _LAYER0,
  19. _LAYER1,
  20. _LAYER2,
  21. _LAYER3
  22. };
  23. enum custom_keycodes {
  24. GIT_ADD = SAFE_RANGE,
  25. GIT_COMMIT,
  26. GIT_PUSH,
  27. MUTE,
  28. DEAFEN
  29. };
  30. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  31. if (record->event.pressed) {
  32. switch(keycode) {
  33. case GIT_ADD:
  34. SEND_STRING("git add ."SS_TAP(X_ENTER));
  35. break;
  36. case GIT_COMMIT:
  37. SEND_STRING("git commit -m "SS_DOWN(X_LSHIFT)SS_TAP(X_QUOTE)SS_UP(X_LSHIFT));
  38. break;
  39. case GIT_PUSH:
  40. SEND_STRING("git push"SS_TAP(X_ENTER));
  41. break;
  42. case MUTE:
  43. SEND_STRING(SS_LGUI(SS_LSFT("M")));
  44. break;
  45. case DEAFEN:
  46. SEND_STRING(SS_LGUI(SS_LSFT("D")));
  47. break;
  48. return false;
  49. }
  50. }
  51. return true;
  52. };
  53. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  54. [_LAYER0] = LAYOUT( \
  55. KC_ESC, TO(_LAYER1), \
  56. KC_Z, KC_X, KC_ENT \
  57. ),
  58. [_LAYER1] = LAYOUT( \
  59. MUTE, TO(_LAYER2), \
  60. GIT_ADD, GIT_COMMIT, GIT_PUSH \
  61. ),
  62. [_LAYER2] = LAYOUT( \
  63. RGB_MOD, TO(_LAYER3), \
  64. RGB_TOG, RGB_HUD, RGB_HUI \
  65. ),
  66. [_LAYER3] = LAYOUT( \
  67. RGB_VAI, TO(_LAYER0), \
  68. RGB_SAD, RGB_VAD, RGB_SAI \
  69. )
  70. };
  71. void matrix_init_user(void) {
  72. for (int i=0; i<5; i++) {
  73. backlight_led_on(i);
  74. }
  75. }