]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/staryu/keymaps/krusli/keymap.c
c0fcd00d5d836588160a2377e741650fb71bd38a
[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 #define _______ KC_TRNS
62 #define XXXXXXX KC_NO
63
64 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
65   [_LAYER0] = LAYOUT(                 \
66              KC_ESC,     TO(_LAYER1), \
67     KC_Z,    KC_X,       KC_ENT       \
68   ),
69   [_LAYER1] = LAYOUT(                 \
70              MUTE,       TO(_LAYER2), \
71     GIT_ADD, GIT_COMMIT, GIT_PUSH     \
72   ),
73   [_LAYER2] = LAYOUT(                 \
74              RGB_MOD,    TO(_LAYER3), \
75     RGB_TOG, RGB_HUD,    RGB_HUI      \
76   ),
77   [_LAYER3] = LAYOUT(                 \
78              RGB_VAI,    TO(_LAYER0), \
79     RGB_SAD, RGB_VAD,    RGB_SAI      \
80   )
81 };
82
83 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
84   return MACRO_NONE ;
85 }
86
87 void matrix_init_user(void) {
88   for (int i=0; i<5; i++) {
89     backlight_led_on(i);
90   }
91 }
92
93 void matrix_scan_user(void) {
94 }
95
96 void led_set_user(uint8_t usb_led) {
97 }