aboutsummaryrefslogtreecommitdiff
path: root/keyboards/emi20/keymaps/default/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/emi20/keymaps/default/keymap.c')
-rw-r--r--keyboards/emi20/keymaps/default/keymap.c92
1 files changed, 92 insertions, 0 deletions
diff --git a/keyboards/emi20/keymaps/default/keymap.c b/keyboards/emi20/keymaps/default/keymap.c
new file mode 100644
index 000000000..4c33ee85e
--- /dev/null
+++ b/keyboards/emi20/keymaps/default/keymap.c
@@ -0,0 +1,92 @@
1/* Copyright 2021 Aquacylinder
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
18bool is_ERESET_active = false;
19uint16_t ERESET_timer = 0;
20
21enum custom_keycodes {
22 MACRO1 = SAFE_RANGE, //MACRO1 can be anything you want see the qmk documentation
23 MACRO2, //MACRO2 Same thing, you can add as many as you like
24};
25
26//Reset combo key naming
27enum combo_events {
28 ENLCK_reset,
29};
30
31//Reset combo key setting the keys
32const uint16_t PROGMEM reset_combo[] = {KC_NLCK, KC_MPLY, COMBO_END};
33
34
35const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
36 //Macro's are mentioned here allong with the keycodes
37 LAYOUT_ortho_5x4( //Base layer (0)
38 TG(1), KC_VOLD, KC_VOLU, KC_BSPC,
39 KC_P7, KC_P8, KC_P9, KC_PSLS,
40 KC_P4, KC_P5, KC_P6, KC_PAST,
41 KC_P1, KC_P2, KC_P3, KC_PMNS,
42 KC_P0, KC_PDOT, KC_PENT, KC_PPLS),
43
44 LAYOUT_ortho_5x4( //Layer 1
45 KC_TRNS, KC_VOLD, KC_VOLU, KC_CALC,
46 KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT,
47 KC_NO, KC_NO, KC_NO, KC_NO,
48 KC_NO, KC_NO, KC_UP, KC_NO,
49 KC_NLCK, KC_LEFT, KC_DOWN, KC_RGHT),
50 //Copy any layer and edit it for more layers, be sure to add a key to go to that layer
51};
52
53//Reset combo key setting
54combo_t key_combos[COMBO_COUNT] = {
55 [ENLCK_reset] = COMBO_ACTION(reset_combo),
56};
57
58bool process_record_user(uint16_t keycode, keyrecord_t *record) {
59 switch (keycode) {
60 case MACRO1: //This is where the macro's are located
61 if (record->event.pressed) {
62 // when keycode MACRO1 is pressed
63 SEND_STRING("Thank you");
64 } else {
65 // when keycode MACRO1 is released
66 SEND_STRING("for being you <3");
67 }
68 break;
69
70 case MACRO2:
71 if (record->event.pressed) {
72 // when keycode MACRO2 is pressed
73 SEND_STRING("Pizza is");
74 } else {
75 // when keycode MACRO2 is released
76 SEND_STRING("delicious ;)");
77 }
78 break;
79 }
80 return true;
81}
82
83//Reset key combo and a example to make our own, more complex, macro's
84void process_combo_event(uint16_t combo_index, bool pressed) {
85 switch(combo_index) {
86 case ENLCK_reset:
87 if (pressed) {
88 reset_keyboard();
89 }
90 break;
91 }
92}