aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy <andys8@users.noreply.github.com>2021-01-14 20:29:22 +0100
committerGitHub <noreply@github.com>2021-01-14 11:29:22 -0800
commitf1b06d0ae782996e90b2dba03044cc39f079581d (patch)
tree2e717420ef5c3fd3db20bd305a0fbd578b4622a6
parent345a041cf54d93cb35eabf429a6d99ae603760c4 (diff)
downloadqmk_firmware-f1b06d0ae782996e90b2dba03044cc39f079581d.tar.gz
qmk_firmware-f1b06d0ae782996e90b2dba03044cc39f079581d.zip
[Keymap] Adds ymdk/ymd09 andys8 layout (#11320)
Custom layout for macropad. It shows the usage of macros with unicode, and other layouts (ISO-DE) with unicode, emojis, and git commands.
-rw-r--r--keyboards/ymdk/ymd09/keymaps/andys8/keymap.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/keyboards/ymdk/ymd09/keymaps/andys8/keymap.c b/keyboards/ymdk/ymd09/keymaps/andys8/keymap.c
new file mode 100644
index 000000000..130db7e4e
--- /dev/null
+++ b/keyboards/ymdk/ymd09/keymaps/andys8/keymap.c
@@ -0,0 +1,65 @@
1/*
2Copyright 2021 andys8 <andys8@users.noreply.github.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17#include QMK_KEYBOARD_H
18#include "sendstring_german.h"
19
20enum custom_keycodes {
21 GIT_STASH = SAFE_RANGE,
22 GIT_STASH_POP,
23 GIT_COMMIT,
24 COPY_PASTE,
25};
26
27bool process_record_user(uint16_t keycode, keyrecord_t *record) {
28 switch (keycode) {
29 case GIT_STASH:
30 if (record->event.pressed) {
31 SEND_STRING("git stash\n");
32 }
33 break;
34 case GIT_STASH_POP:
35 if (record->event.pressed) {
36 SEND_STRING("git stash pop\n");
37 }
38 break;
39 case GIT_COMMIT:
40 if (record->event.pressed) {
41 SEND_STRING("git add -A && git commit -a\n");
42 }
43 break;
44 case COPY_PASTE:
45 if (record->event.pressed) {
46 tap_code16(C(KC_C));
47 } else {
48 tap_code16(C(KC_V));
49 }
50 break;
51 }
52 return true;
53};
54
55const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
56
57 [0] = LAYOUT(GIT_STASH, GIT_STASH_POP, GIT_COMMIT,
58 LCTL(KC_F4), LT(1, KC_SPACE), LCTL(KC_F6),
59 COPY_PASTE, LCTL(KC_F2), LCTL(KC_F3)),
60
61 [1] = LAYOUT(RGB_RMOD, RGB_TOG, RGB_MOD,
62 RGB_HUI, KC_TRNS, RGB_SAI,
63 RGB_HUD, RGB_M_P, RGB_SAD),
64
65};