aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/anavi/macropad2/keymaps/git/keymap.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/keyboards/anavi/macropad2/keymaps/git/keymap.c b/keyboards/anavi/macropad2/keymaps/git/keymap.c
new file mode 100644
index 000000000..8580af195
--- /dev/null
+++ b/keyboards/anavi/macropad2/keymaps/git/keymap.c
@@ -0,0 +1,48 @@
1/* Copyright 2021 Leon Anavi <leon@anavi.org>
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
17#include QMK_KEYBOARD_H
18
19enum custom_keycodes {
20 GITCOMMIT = SAFE_RANGE,
21 GITPUSH
22};
23
24void keyboard_post_init_user(void) {
25 // Set backlight to the maximum brightness
26 backlight_level(2);
27}
28
29bool process_record_user(uint16_t keycode, keyrecord_t *record) {
30 switch (keycode) {
31 case GITCOMMIT:
32 if (record->event.pressed) {
33 SEND_STRING("git commit -s\n");
34 }
35 break;
36 case GITPUSH:
37 if (record->event.pressed) {
38 SEND_STRING("git push\n");
39 }
40 }
41 return true;
42};
43
44const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
45 [0] = LAYOUT(
46 GITCOMMIT, GITPUSH
47 )
48};