aboutsummaryrefslogtreecommitdiff
path: root/keyboards/lizard_trick/tenkey_plusplus/keymaps/macro
diff options
context:
space:
mode:
authorJonathon Carstens <jon.carstens@gmail.com>2020-12-25 06:42:11 -0800
committerGitHub <noreply@github.com>2020-12-26 01:42:11 +1100
commitb7f640ca764b25e09bd0e60841bfd492bede036f (patch)
tree3eabdac78570d1ae5b3614aeea7e1f9b4bcdc18b /keyboards/lizard_trick/tenkey_plusplus/keymaps/macro
parent436b5394bb370ca2415b5c4cc10b92b7665e4e78 (diff)
downloadqmk_firmware-b7f640ca764b25e09bd0e60841bfd492bede036f.tar.gz
qmk_firmware-b7f640ca764b25e09bd0e60841bfd492bede036f.zip
Adding new keyboard: Tenkey++ (tenkey_plusplus) (#11197)
Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'keyboards/lizard_trick/tenkey_plusplus/keymaps/macro')
-rw-r--r--keyboards/lizard_trick/tenkey_plusplus/keymaps/macro/keymap.c103
1 files changed, 103 insertions, 0 deletions
diff --git a/keyboards/lizard_trick/tenkey_plusplus/keymaps/macro/keymap.c b/keyboards/lizard_trick/tenkey_plusplus/keymaps/macro/keymap.c
new file mode 100644
index 000000000..900bb0a01
--- /dev/null
+++ b/keyboards/lizard_trick/tenkey_plusplus/keymaps/macro/keymap.c
@@ -0,0 +1,103 @@
1/*
2Copyright 2020 Jonathon Carstens jonathon@lizardtrick.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
18#include QMK_KEYBOARD_H
19
20// Defines names for use in layer keycodes and the keymap
21enum layer_names {
22 _BASE,
23 _TG1,
24};
25
26const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
27 /*
28 *
29 * Left Middle Right
30 * VolDn PgDn Alt+Tab (Rotary Counterclockwise)
31 * VolUp PgUp Tab (Rotary Clockwise)
32 * Mute Play Next (Rotary Click)
33 *
34 *
35 *
36 * ┌───┬───┬───┬───┐
37 * │TG1│ / │ * │ - │
38 * ├───┼───┼───┼───┤
39 * │ 7 │ 8 │ 9 │   │
40 * ├───┼───┼───┤ + │
41 * │ 4 │ 5 │ 6 │   │
42 * ├───┼───┼───┼───┤
43 * │ 1 │ 2 │ 3 │   │
44 * ├───┴───┼───┤Ent│
45 * │   0   │ . │   │
46 * └───────┴───┴───┘
47 */
48
49 [_BASE] = LAYOUT(
50 KC_MUTE, KC_MPLY, KC_MNXT,
51 TG(1), KC_SLSH, KC_ASTR, KC_MINS,
52 KC_7, KC_8, KC_9, KC_PLUS,
53 KC_4, KC_5, KC_6,
54 KC_1, KC_2, KC_3, KC_ENT,
55 KC_0, KC_DOT
56 ),
57
58 /*
59 *
60 * ┌─────────┬─────────┬─────────┬─────────┐
61 * │ TG1 │  /  │  *  │  -  │
62 * ├─────────┼─────────┼─────────┼─────────┤
63 * │  Alt 7  │  Alt 8  │  Alt 9  │    │
64 * ├─────────┼─────────┼─────────┤ + │
65 * │  Alt 4  │  Alt 5  │  Alt 6  │    │
66 * ├─────────┼─────────┼─────────┼─────────┤
67 * │  Alt 1  │  Alt 2  │  Alt 3  │    │
68 * ├─────────┴─────────┼─────────┤ Ent │
69 * │ Escape │ Del │    │
70 * └───────────────────┴─────────┴─────────┘
71 */
72
73 [_TG1] = LAYOUT(
74 _______, _______, _______,
75 _______, _______, _______, _______,
76 A(KC_7), A(KC_8), A(KC_9), _______,
77 A(KC_4), A(KC_5), A(KC_6),
78 A(KC_1), A(KC_2), A(KC_3), _______,
79 KC_ESC, KC_DEL
80 )
81};
82
83void encoder_update_user(uint8_t index, bool clockwise) {
84 if (index == 0) { /* Left Encoder */
85 if (clockwise) {
86 tap_code16(KC_VOLU);
87 } else {
88 tap_code16(KC_VOLD);
89 }
90 } else if (index == 1) { /* Middle Encoder */
91 if (clockwise) {
92 tap_code16(KC_PGDN);
93 } else {
94 tap_code16(KC_PGUP);
95 }
96 } else if (index == 2) { /* Right Encoder */
97 if (clockwise) {
98 tap_code16(KC_TAB);
99 } else {
100 tap_code16(S(KC_TAB));
101 }
102 }
103}