]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/staryu/keymaps/krusli/keymap.c
cdfa9fe8fed46d2ae79c6c33ca9dd597f81fbe11
[qmk_firmware.git] / keyboards / staryu / keymaps / krusli / keymap.c
1 /*
2 Copyright 2018 Kenneth Aloysius
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 */
17 #include QMK_KEYBOARD_H
18 #include "action_layer.h"
19
20 #include "../../backlight_staryu.h"
21
22 enum layers {
23   _LAYER0,
24   _LAYER1,
25   _LAYER2,
26   _LAYER3
27 };
28
29 enum custom_keycodes {
30   GIT_ADD = SAFE_RANGE,
31   GIT_COMMIT,
32   GIT_PUSH,
33   MUTE,
34   DEAFEN
35 };
36
37 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
38         if (record->event.pressed) {
39                 switch(keycode) {
40                         case GIT_ADD:
41                                 SEND_STRING("git add ."SS_TAP(X_ENTER));
42         break;
43       case GIT_COMMIT:
44         SEND_STRING("git commit -m "SS_DOWN(X_LSHIFT)SS_TAP(X_QUOTE)SS_UP(X_LSHIFT));
45         break;
46       case GIT_PUSH:
47         SEND_STRING("git push"SS_TAP(X_ENTER));
48         break;
49       case MUTE:
50         SEND_STRING(SS_LGUI(SS_LSFT("M")));
51         break;
52       case DEAFEN:
53         SEND_STRING(SS_LGUI(SS_LSFT("D")));
54         break;
55       return false;
56                 }
57         }
58         return true;
59 };
60
61 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
62   [_LAYER0] = LAYOUT(                 \
63              KC_ESC,     TO(_LAYER1), \
64     KC_Z,    KC_X,       KC_ENT       \
65   ),
66   [_LAYER1] = LAYOUT(                 \
67              MUTE,       TO(_LAYER2), \
68     GIT_ADD, GIT_COMMIT, GIT_PUSH     \
69   ),
70   [_LAYER2] = LAYOUT(                 \
71              RGB_MOD,    TO(_LAYER3), \
72     RGB_TOG, RGB_HUD,    RGB_HUI      \
73   ),
74   [_LAYER3] = LAYOUT(                 \
75              RGB_VAI,    TO(_LAYER0), \
76     RGB_SAD, RGB_VAD,    RGB_SAI      \
77   )
78 };
79
80 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
81   return MACRO_NONE ;
82 }
83
84 void matrix_init_user(void) {
85   for (int i=0; i<5; i++) {
86     backlight_led_on(i);
87   }
88 }
89
90 void matrix_scan_user(void) {
91 }
92
93 void led_set_user(uint8_t usb_led) {
94 }