aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Anavi <leon@anavi.org>2021-03-25 14:01:45 +0200
committerGitHub <noreply@github.com>2021-03-25 23:01:45 +1100
commitb5a12fa6d35b0304c457569854f2e7ff8a2200f1 (patch)
tree70e78e338db257bdcbfa09d319c5afae5e2ecf5f
parent29c82cfb33bda7fecc58fa9eadfe56bd10af2c56 (diff)
downloadqmk_firmware-b5a12fa6d35b0304c457569854f2e7ff8a2200f1.tar.gz
qmk_firmware-b5a12fa6d35b0304c457569854f2e7ff8a2200f1.zip
[Keymap] ANAVI Macro Pad 2 add git keymap (#12212)
This keymap for ANAVI Macro Pad 2 contains popular git commands typed out and executed with a single key: - left key: git commit -s - right key: git push Signed-off-by: Leon Anavi <leon@anavi.org>
-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};