aboutsummaryrefslogtreecommitdiff
path: root/keyboards/lizard_trick/tenkey_plusplus/keymaps
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/lizard_trick/tenkey_plusplus/keymaps')
-rw-r--r--keyboards/lizard_trick/tenkey_plusplus/keymaps/default/keymap.c78
-rw-r--r--keyboards/lizard_trick/tenkey_plusplus/keymaps/macro/keymap.c103
2 files changed, 181 insertions, 0 deletions
diff --git a/keyboards/lizard_trick/tenkey_plusplus/keymaps/default/keymap.c b/keyboards/lizard_trick/tenkey_plusplus/keymaps/default/keymap.c
new file mode 100644
index 000000000..f785ed97f
--- /dev/null
+++ b/keyboards/lizard_trick/tenkey_plusplus/keymaps/default/keymap.c
@@ -0,0 +1,78 @@
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};
24
25const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
26 /*
27 *
28 * Left Middle Right
29 * VolDn PgDn Alt+Tab (Rotary Counterclockwise)
30 * VolUp PgUp Tab (Rotary Clockwise)
31 * Mute Play Next (Rotary Click)
32 *
33 *
34 *
35 * ┌───┬───┬───┬───┐
36 * │TG1│ / │ * │ - │
37 * ├───┼───┼───┼───┤
38 * │ 7 │ 8 │ 9 │   │
39 * ├───┼───┼───┤ + │
40 * │ 4 │ 5 │ 6 │   │
41 * ├───┼───┼───┼───┤
42 * │ 1 │ 2 │ 3 │   │
43 * ├───┴───┼───┤Ent│
44 * │   0   │ . │   │
45 * └───────┴───┴───┘
46 */
47
48 [_BASE] = LAYOUT(
49 KC_MUTE, KC_MPLY, KC_MNXT,
50 KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
51 KC_P7, KC_P8, KC_P9, KC_PPLS,
52 KC_P4, KC_P5, KC_P6,
53 KC_P1, KC_P2, KC_P3, KC_PENT,
54 KC_P0, KC_PDOT
55 )
56};
57
58void encoder_update_user(uint8_t index, bool clockwise) {
59 if (index == 0) { /* Left Encoder */
60 if (clockwise) {
61 tap_code16(KC_VOLU);
62 } else {
63 tap_code16(KC_VOLD);
64 }
65 } else if (index == 1) { /* Middle Encoder */
66 if (clockwise) {
67 tap_code16(KC_PGDN);
68 } else {
69 tap_code16(KC_PGUP);
70 }
71 } else if (index == 2) { /* Right Encoder */
72 if (clockwise) {
73 tap_code16(KC_TAB);
74 } else {
75 tap_code16(S(KC_TAB));
76 }
77 }
78}
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}