aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/dumbpad/config.h207
-rw-r--r--keyboards/dumbpad/dumbpad.c83
-rw-r--r--keyboards/dumbpad/info.json30
-rw-r--r--keyboards/dumbpad/keymaps/default/config.h2
-rw-r--r--keyboards/dumbpad/keymaps/default/keymap.c121
-rw-r--r--keyboards/dumbpad/keymaps/imchipwood/config.h2
-rw-r--r--keyboards/dumbpad/keymaps/imchipwood/keymap.c163
-rw-r--r--keyboards/dumbpad/readme.md38
-rw-r--r--keyboards/dumbpad/rules.mk36
-rw-r--r--keyboards/dumbpad/v0x/config.h41
-rw-r--r--keyboards/dumbpad/v0x/info.json18
-rw-r--r--keyboards/dumbpad/v0x/keymaps/default/keymap.c106
-rw-r--r--keyboards/dumbpad/v0x/readme.md15
-rw-r--r--keyboards/dumbpad/v0x/rules.mk25
-rw-r--r--keyboards/dumbpad/v0x/templates/keymap.c25
-rw-r--r--keyboards/dumbpad/v0x/v0x.c59
-rw-r--r--keyboards/dumbpad/v0x/v0x.h (renamed from keyboards/dumbpad/dumbpad.h)19
-rw-r--r--keyboards/dumbpad/v0x_dualencoder/config.h40
-rw-r--r--keyboards/dumbpad/v0x_dualencoder/info.json18
-rw-r--r--keyboards/dumbpad/v0x_dualencoder/keymaps/default/keymap.c134
-rw-r--r--keyboards/dumbpad/v0x_dualencoder/readme.md15
-rw-r--r--keyboards/dumbpad/v0x_dualencoder/rules.mk25
-rw-r--r--keyboards/dumbpad/v0x_dualencoder/templates/keymap.c43
-rw-r--r--keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c59
-rw-r--r--keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.h30
-rw-r--r--keyboards/dumbpad/v0x_right/config.h39
-rw-r--r--keyboards/dumbpad/v0x_right/info.json18
-rw-r--r--keyboards/dumbpad/v0x_right/keymaps/default/keymap.c106
-rw-r--r--keyboards/dumbpad/v0x_right/readme.md15
-rw-r--r--keyboards/dumbpad/v0x_right/rules.mk25
-rw-r--r--keyboards/dumbpad/v0x_right/templates/keymap.c25
-rw-r--r--keyboards/dumbpad/v0x_right/v0x_right.c59
-rw-r--r--keyboards/dumbpad/v0x_right/v0x_right.h30
-rw-r--r--keyboards/dumbpad/v1x/config.h42
-rw-r--r--keyboards/dumbpad/v1x/info.json18
-rw-r--r--keyboards/dumbpad/v1x/keymaps/default/keymap.c106
-rw-r--r--keyboards/dumbpad/v1x/readme.md15
-rw-r--r--keyboards/dumbpad/v1x/rules.mk25
-rw-r--r--keyboards/dumbpad/v1x/templates/keymap.c25
-rw-r--r--keyboards/dumbpad/v1x/v1x.c69
-rw-r--r--keyboards/dumbpad/v1x/v1x.h30
-rw-r--r--keyboards/dumbpad/v1x_dualencoder/config.h42
-rw-r--r--keyboards/dumbpad/v1x_dualencoder/info.json18
-rw-r--r--keyboards/dumbpad/v1x_dualencoder/keymaps/default/keymap.c134
-rw-r--r--keyboards/dumbpad/v1x_dualencoder/readme.md87
-rw-r--r--keyboards/dumbpad/v1x_dualencoder/rules.mk25
-rw-r--r--keyboards/dumbpad/v1x_dualencoder/templates/keymap.c43
-rw-r--r--keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c69
-rw-r--r--keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.h30
-rw-r--r--keyboards/dumbpad/v1x_right/config.h42
-rw-r--r--keyboards/dumbpad/v1x_right/info.json18
-rw-r--r--keyboards/dumbpad/v1x_right/keymaps/default/keymap.c106
-rw-r--r--keyboards/dumbpad/v1x_right/readme.md15
-rw-r--r--keyboards/dumbpad/v1x_right/rules.mk25
-rw-r--r--keyboards/dumbpad/v1x_right/templates/keymap.c25
-rw-r--r--keyboards/dumbpad/v1x_right/v1x_right.c69
-rw-r--r--keyboards/dumbpad/v1x_right/v1x_right.h30
57 files changed, 2110 insertions, 669 deletions
diff --git a/keyboards/dumbpad/config.h b/keyboards/dumbpad/config.h
index d1fa9aa4b..5a1a1c92b 100644
--- a/keyboards/dumbpad/config.h
+++ b/keyboards/dumbpad/config.h
@@ -1,5 +1,5 @@
1/* 1/*
2Copyright 2019 imchipwood 2Copyright 2020 imchipwood
3 3
4This program is free software: you can redistribute it and/or modify 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 5it under the terms of the GNU General Public License as published by
@@ -14,218 +14,21 @@ GNU General Public License for more details.
14You should have received a copy of the GNU General Public License 14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17
18#pragma once 17#pragma once
19 18
20#include "config_common.h" 19#include "config_common.h"
21 20
22/* USB Device descriptor parameter */ 21/* USB Device descriptor parameter */
23#define VENDOR_ID 0xDEAF 22#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x0913 23#define PRODUCT_ID 0x0913
25#define DEVICE_VER 0x0001
26#define MANUFACTURER imchipwood 24#define MANUFACTURER imchipwood
27#define PRODUCT dumbpad 25#define PRODUCT dumbpad
28 26
29 27/* Column/Row IO definitions */
30/*
31 * Keyboard Matrix Assignments
32 *
33 * Change this to how you wired your keyboard
34 * COLS: AVR pins used for columns, left to right
35 * ROWS: AVR pins used for rows, top to bottom
36 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
37 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
38 *
39*/
40#define MATRIX_ROWS 4
41#define MATRIX_COLS 5
42#define MATRIX_ROW_PINS { F4, F5, F6, F7 }
43#define MATRIX_COL_PINS { C6, D7, E6, B4, B5 }
44#define UNUSED_PINS
45
46/* COL2ROW, ROW2COL*/
47#define DIODE_DIRECTION COL2ROW 28#define DIODE_DIRECTION COL2ROW
48 29
49/* Rotary encoder */
50#define ENCODERS_PAD_A { D0 }
51#define ENCODERS_PAD_B { D4 }
52
53/* LED layer indicators */
54#define LAYER_INDICATOR_LED_0 B3
55#define LAYER_INDICATOR_LED_1 B1
56
57/* Bootmagic - hold down rotary encoder pushbutton while plugging in to enter bootloader */
58#define BOOTMAGIC_LITE_ROW 3
59#define BOOTMAGIC_LITE_COLUMN 0
60
61
62/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ 30/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
63#define DEBOUNCE 5 31#define DEBOUNCE 5
64 32
65/* define if matrix has ghost (lacks anti-ghosting diodes) */ 33/* Reduce tapdance required taps from 5 to 2 */
66//#define MATRIX_HAS_GHOST 34#define TAPPING_TOGGLE 2
67
68/* number of backlight levels */
69
70/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
71//#define LOCKING_SUPPORT_ENABLE
72/* Locking resynchronize hack */
73//#define LOCKING_RESYNC_ENABLE
74
75/*
76 * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
77 */
78//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
79
80// #define BACKLIGHT_PIN B7
81// #define BACKLIGHT_BREATHING
82// #define BACKLIGHT_LEVELS 3
83
84// #define RGB_DI_PIN E2
85// #ifdef RGB_DI_PIN
86// #define RGBLED_NUM 16
87// #define RGBLIGHT_HUE_STEP 8
88// #define RGBLIGHT_SAT_STEP 8
89// #define RGBLIGHT_VAL_STEP 8
90// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
91// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
92// /*== all animations enable ==*/
93// #define RGBLIGHT_ANIMATIONS
94// /*== or choose animations ==*/
95// #define RGBLIGHT_EFFECT_BREATHING
96// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
97// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
98// #define RGBLIGHT_EFFECT_SNAKE
99// #define RGBLIGHT_EFFECT_KNIGHT
100// #define RGBLIGHT_EFFECT_CHRISTMAS
101// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
102// #define RGBLIGHT_EFFECT_RGB_TEST
103// #define RGBLIGHT_EFFECT_ALTERNATING
104// /*== customize breathing effect ==*/
105// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
106// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
107// /*==== use exp() and sin() ====*/
108// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
109// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
110// #endif
111
112/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
113 * This is userful for the Windows task manager shortcut (ctrl+shift+esc).
114 */
115// #define GRAVE_ESC_CTRL_OVERRIDE
116
117/*
118 * Force NKRO
119 *
120 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
121 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
122 * makefile for this to work.)
123 *
124 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
125 * until the next keyboard reset.
126 *
127 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
128 * fully operational during normal computer usage.
129 *
130 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
131 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
132 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
133 * power-up.
134 *
135 */
136//#define FORCE_NKRO
137
138/*
139 * Magic Key Options
140 *
141 * Magic keys are hotkey commands that allow control over firmware functions of
142 * the keyboard. They are best used in combination with the HID Listen program,
143 * found here: https://www.pjrc.com/teensy/hid_listen.html
144 *
145 * The options below allow the magic key functionality to be changed. This is
146 * useful if your keyboard/keypad is missing keys and you want magic key support.
147 *
148 */
149
150/* key combination for magic key command */
151/* defined by default; to change, uncomment and set to the combination you want */
152// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
153
154/* control how magic key switches layers */
155//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
156//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
157//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
158
159/* override magic key keymap */
160//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
161//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
162//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
163//#define MAGIC_KEY_HELP H
164//#define MAGIC_KEY_HELP_ALT SLASH
165//#define MAGIC_KEY_DEBUG D
166//#define MAGIC_KEY_DEBUG_MATRIX X
167//#define MAGIC_KEY_DEBUG_KBD K
168//#define MAGIC_KEY_DEBUG_MOUSE M
169//#define MAGIC_KEY_VERSION V
170//#define MAGIC_KEY_STATUS S
171//#define MAGIC_KEY_CONSOLE C
172//#define MAGIC_KEY_LAYER0 0
173//#define MAGIC_KEY_LAYER0_ALT GRAVE
174//#define MAGIC_KEY_LAYER1 1
175//#define MAGIC_KEY_LAYER2 2
176//#define MAGIC_KEY_LAYER3 3
177//#define MAGIC_KEY_LAYER4 4
178//#define MAGIC_KEY_LAYER5 5
179//#define MAGIC_KEY_LAYER6 6
180//#define MAGIC_KEY_LAYER7 7
181//#define MAGIC_KEY_LAYER8 8
182//#define MAGIC_KEY_LAYER9 9
183//#define MAGIC_KEY_BOOTLOADER B
184//#define MAGIC_KEY_BOOTLOADER_ALT ESC
185//#define MAGIC_KEY_LOCK CAPS
186//#define MAGIC_KEY_EEPROM E
187//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
188//#define MAGIC_KEY_NKRO N
189//#define MAGIC_KEY_SLEEP_LED Z
190
191/*
192 * Feature disable options
193 * These options are also useful to firmware size reduction.
194 */
195
196/* disable debug print */
197//#define NO_DEBUG
198
199/* disable print */
200//#define NO_PRINT
201
202/* disable action features */
203//#define NO_ACTION_LAYER
204//#define NO_ACTION_TAPPING
205//#define NO_ACTION_ONESHOT
206//#define NO_ACTION_MACRO
207//#define NO_ACTION_FUNCTION
208
209/*
210 * MIDI options
211 */
212
213/* enable basic MIDI features:
214 - MIDI notes can be sent when in Music mode is on
215*/
216//#define MIDI_BASIC
217
218/* enable advanced MIDI features:
219 - MIDI notes can be added to the keymap
220 - Octave shift and transpose
221 - Virtual sustain, portamento, and modulation wheel
222 - etc.
223*/
224//#define MIDI_ADVANCED
225
226/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
227//#define MIDI_TONE_KEYCODE_OCTAVES 1
228
229/* Bootmagic Lite key configuration */
230// #define BOOTMAGIC_LITE_ROW 0
231// #define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/dumbpad/dumbpad.c b/keyboards/dumbpad/dumbpad.c
deleted file mode 100644
index d9b649c71..000000000
--- a/keyboards/dumbpad/dumbpad.c
+++ /dev/null
@@ -1,83 +0,0 @@
1/* Copyright 2019 Chip
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#include "dumbpad.h"
17
18void keyboard_pre_init_kb(void) {
19 // Set the layer LED IO as outputs
20 setPinOutput(LAYER_INDICATOR_LED_0);
21 setPinOutput(LAYER_INDICATOR_LED_1);
22
23 keyboard_pre_init_user();
24}
25
26void shutdown_user() {
27 // Shutdown the layer LEDs
28 writePinLow(LAYER_INDICATOR_LED_0);
29 writePinLow(LAYER_INDICATOR_LED_1);
30}
31
32layer_state_t layer_state_set_kb(layer_state_t state) {
33 // Layer LEDs act as binary indication of current layer
34 uint8_t layer = biton32(state);
35 writePin(LAYER_INDICATOR_LED_0, layer & 0b1);
36 writePin(LAYER_INDICATOR_LED_1, (layer >> 1) & 0b1);
37 return layer_state_set_user(state);
38}
39
40// Optional override functions below.
41// You can leave any or all of these undefined.
42// These are only required if you want to perform custom actions.
43
44void matrix_init_kb(void) {
45 // put your keyboard start-up code here
46 // runs once when the firmware starts up
47 for (int i = 0; i < 2; i++) {
48 writePin(LAYER_INDICATOR_LED_0, true);
49 writePin(LAYER_INDICATOR_LED_1, false);
50 wait_ms(100);
51 writePin(LAYER_INDICATOR_LED_0, true);
52 writePin(LAYER_INDICATOR_LED_1, true);
53 wait_ms(100);
54 writePin(LAYER_INDICATOR_LED_0, false);
55 writePin(LAYER_INDICATOR_LED_1, true);
56 wait_ms(100);
57 writePin(LAYER_INDICATOR_LED_0, false);
58 writePin(LAYER_INDICATOR_LED_1, false);
59 wait_ms(100);
60 }
61
62 matrix_init_user();
63}
64
65void matrix_scan_kb(void) {
66 // put your looping keyboard code here
67 // runs every cycle (a lot)
68
69 matrix_scan_user();
70}
71
72bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
73 // put your per-action keyboard code here
74 // runs for every action, just before processing by the firmware
75
76 return process_record_user(keycode, record);
77}
78
79void led_set_kb(uint8_t usb_led) {
80 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
81
82 led_set_user(usb_led);
83}
diff --git a/keyboards/dumbpad/info.json b/keyboards/dumbpad/info.json
deleted file mode 100644
index 8b6a8116e..000000000
--- a/keyboards/dumbpad/info.json
+++ /dev/null
@@ -1,30 +0,0 @@
1{
2 "keyboard_name": "dumbpad",
3 "url": "",
4 "maintainer": "qmk",
5 "width": 5,
6 "height": 4,
7 "layouts": {
8 "LAYOUT": {
9 "layout": [
10 {"label":"7", "x":1, "y":0},
11 {"label":"8", "x":2, "y":0},
12 {"label":"9", "x":3, "y":0},
13 {"label":"BSPC", "x":4, "y":0},
14 {"label":"4", "x":1, "y":1},
15 {"label":"5", "x":2, "y":1},
16 {"label":"6", "x":3, "y":1},
17 {"label":"ESC", "x":4, "y":1},
18 {"label":"1", "x":1, "y":2},
19 {"label":"2", "x":2, "y":2},
20 {"label":"3", "x":3, "y":2},
21 {"label":"TAB", "x":4, "y":2},
22 {"label":"LMOUSE", "x":0, "y":3},
23 {"label":"TT(2)", "x":1, "y":3},
24 {"label":"0", "x":2, "y":3},
25 {"label":".", "x":3, "y":3},
26 {"label":"ENT", "x":4, "y":3}
27 ]
28 }
29 }
30} \ No newline at end of file
diff --git a/keyboards/dumbpad/keymaps/default/config.h b/keyboards/dumbpad/keymaps/default/config.h
deleted file mode 100644
index 838088559..000000000
--- a/keyboards/dumbpad/keymaps/default/config.h
+++ /dev/null
@@ -1,2 +0,0 @@
1#pragma once
2#define TAPPING_TOGGLE 2
diff --git a/keyboards/dumbpad/keymaps/default/keymap.c b/keyboards/dumbpad/keymaps/default/keymap.c
deleted file mode 100644
index c0d4a7c07..000000000
--- a/keyboards/dumbpad/keymaps/default/keymap.c
+++ /dev/null
@@ -1,121 +0,0 @@
1/* Copyright 2019 imchipwood
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#include QMK_KEYBOARD_H
17
18#define _BASE 0
19#define _SUB 1
20
21const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
22 /*
23 BASE LAYER
24 /-----------------------------------------------------`
25 | | 7 | 8 | 9 | Bkspc |
26 | |---------|---------|---------|---------|
27 | | 4 | 5 | 6 | Esc |
28 | |---------|---------|---------|---------|
29 | | 1 | 2 | 3 | Tab |
30 |-------------|---------|---------|---------|---------|
31 | Left mouse | TT(SUB) | 0 | . | Enter |
32 \-----------------------------------------------------'
33 */
34 [_BASE] = LAYOUT(
35 KC_7, KC_8, KC_9, KC_BSPC,
36 KC_4, KC_5, KC_6, KC_ESC,
37 KC_1, KC_2, KC_3, KC_TAB,
38 KC_BTN1, TT(_SUB), KC_0, KC_DOT, KC_ENTER
39 ),
40 /*
41 SUB LAYER
42 /-----------------------------------------------------`
43 | | | | | Reset |
44 | |---------|---------|---------|---------|
45 | | | | | + |
46 | |---------|---------|---------|---------|
47 | | | | | - |
48 |-------------|---------|---------|---------|---------|
49 | LOCK | | | | = |
50 \-----------------------------------------------------'
51 */
52 [_SUB] = LAYOUT(
53 _______, _______, _______, RESET,
54 _______, _______, _______, KC_KP_PLUS,
55 _______, _______, _______, KC_KP_MINUS,
56 KC_LOCK, _______, _______, _______, KC_EQL
57 ),
58};
59
60bool process_record_user(uint16_t keycode, keyrecord_t *record) {
61 // If console is enabled, it will print the matrix position and status of each key pressed
62/*
63#ifdef CONSOLE_ENABLE
64 uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
65#endif
66*/
67 return true;
68}
69
70void keyboard_post_init_user(void) {
71 // Customise these values to desired behaviour
72 //debug_enable = true;
73 //debug_matrix = true;
74 //debug_keyboard = true;
75 //debug_mouse = true;
76}
77
78void matrix_init_user(void) {
79
80}
81
82void matrix_scan_user(void) {
83
84}
85
86void led_set_user(uint8_t usb_led) {
87
88}
89
90void encoder_update_user(uint8_t index, bool clockwise) {
91 /* Custom encoder control - handles CW/CCW turning of encoder
92 * Default behavior:
93 * main layer:
94 * CW: move mouse right
95 * CCW: move mouse left
96 * other layers:
97 * CW: = (equals/plus - increase slider in Adobe products)
98 * CCW: - (minus/underscore - decrease slider in adobe products)
99 */
100 if (index == 0) {
101 switch (biton32(layer_state)) {
102 case _BASE:
103 // main layer - move mouse right (CW) and left (CCW)
104 if (clockwise) {
105 tap_code(KC_MS_R);
106 } else {
107 tap_code(KC_MS_L);
108 }
109 break;
110
111 default:
112 // other layers - =/+ (quals/plus) (CW) and -/_ (minus/underscore) (CCW)
113 if (clockwise) {
114 tap_code(KC_EQL);
115 } else {
116 tap_code(KC_MINS);
117 }
118 break;
119 }
120 }
121}
diff --git a/keyboards/dumbpad/keymaps/imchipwood/config.h b/keyboards/dumbpad/keymaps/imchipwood/config.h
deleted file mode 100644
index 838088559..000000000
--- a/keyboards/dumbpad/keymaps/imchipwood/config.h
+++ /dev/null
@@ -1,2 +0,0 @@
1#pragma once
2#define TAPPING_TOGGLE 2
diff --git a/keyboards/dumbpad/keymaps/imchipwood/keymap.c b/keyboards/dumbpad/keymaps/imchipwood/keymap.c
deleted file mode 100644
index 73a8e824c..000000000
--- a/keyboards/dumbpad/keymaps/imchipwood/keymap.c
+++ /dev/null
@@ -1,163 +0,0 @@
1/* Copyright 2019 imchipwood
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#include QMK_KEYBOARD_H
17
18#define _BASE 0
19#define _SUB 1
20#define _DBG 2
21
22
23const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
24 /*
25 BASE LAYER
26 /-----------------------------------------------------`
27 | | 7 | 8 | 9 | Bkspc |
28 | |---------|---------|---------|---------|
29 | | 4 | 5 | 6 | + |
30 | |---------|---------|---------|---------|
31 | | 1 | 2 | 3 | * |
32 |-------------|---------|---------|---------|---------|
33 | Play/Pause | TT(SUB) | 0 | . | Enter |
34 \-----------------------------------------------------'
35 */
36 [_BASE] = LAYOUT(
37 KC_P7, KC_P8, KC_P9, KC_BSPC,
38 KC_P4, KC_P5, KC_P6, KC_KP_PLUS,
39 KC_P1, KC_P2, KC_P3, KC_KP_ASTERISK,
40 KC_MPLY, TT(_SUB), KC_P0, KC_PDOT, KC_KP_ENTER
41 ),
42 /*
43 SUB LAYER
44 /-----------------------------------------------------`
45 | | | | | Numlock |
46 | |---------|---------|---------|---------|
47 | | | | | - |
48 | |---------|---------|---------|---------|
49 | | | | | / |
50 |-------------|---------|---------|---------|---------|
51 | MO(_DBG) | | | | = |
52 \-----------------------------------------------------'
53 */
54 [_SUB] = LAYOUT(
55 _______, _______, _______, KC_NLCK,
56 _______, _______, _______, KC_KP_MINUS,
57 _______, _______, _______, KC_KP_SLASH,
58 MO(_DBG), _______, _______, _______, KC_KP_EQUAL
59 ),
60 /*
61 DEBUG LAYER
62 /-----------------------------------------------------`
63 | | | | | Reset |
64 | |---------|---------|---------|---------|
65 | | | | | |
66 | |---------|---------|---------|---------|
67 | | | | | |
68 |-------------|---------|---------|---------|---------|
69 | | | | | |
70 \-----------------------------------------------------'
71 */
72 [_DBG] = LAYOUT(
73 _______, _______, _______, RESET,
74 _______, _______, _______, _______,
75 _______, _______, _______, _______,
76 _______, _______, _______, _______, _______
77 ),
78};
79
80bool process_record_user(uint16_t keycode, keyrecord_t *record) {
81 // If console is enabled, it will print the matrix position and status of each key pressed
82/*
83#ifdef CONSOLE_ENABLE
84 uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
85#endif
86*/
87 return true;
88}
89
90void keyboard_post_init_user(void) {
91 // Customise these values to desired behaviour
92 //debug_enable = true;
93 //debug_matrix = true;
94 //debug_keyboard = true;
95 //debug_mouse = true;
96}
97
98void matrix_init_user(void) {
99
100}
101
102void matrix_scan_user(void) {
103
104}
105
106void led_set_user(uint8_t usb_led) {
107
108}
109
110
111void encoder_update_user(uint8_t index, bool clockwise) {
112 /* Custom encoder control - handles CW/CCW turning of encoder
113 * Cusotom behavior:
114 * main layer:
115 * CW: volume up
116 * CCW: volume down
117 * sub layer:
118 * CW: next media track
119 * CCW: prev media track
120 * debug layer:
121 * CW: brightness up
122 * CCW: brightness down
123 */
124 if (index == 0) {
125 switch (biton32(layer_state)) {
126 case _BASE:
127 // main layer - volume up (CW) and down (CCW)
128 if (clockwise) {
129 tap_code(KC_VOLU);
130 } else {
131 tap_code(KC_VOLD);
132 }
133 break;
134
135 case _SUB:
136 // sub layer - next track (CW) and previous track (CCW)
137 if (clockwise) {
138 tap_code(KC_MNXT);
139 } else {
140 tap_code(KC_MPRV);
141 }
142 break;
143
144 case _DBG:
145 // debug layer - brightness up (CW) and brightness down (CCW)
146 if (clockwise) {
147 tap_code(KC_BRIU);
148 } else {
149 tap_code(KC_BRID);
150 }
151 break;
152
153 default:
154 // any other layer (shouldn't exist..) - volume up (CW) and down (CCW)
155 if (clockwise) {
156 tap_code(KC_VOLU);
157 } else {
158 tap_code(KC_VOLD);
159 }
160 break;
161 }
162 }
163}
diff --git a/keyboards/dumbpad/readme.md b/keyboards/dumbpad/readme.md
index 8f3789bcb..ad72ed58d 100644
--- a/keyboards/dumbpad/readme.md
+++ b/keyboards/dumbpad/readme.md
@@ -1,19 +1,23 @@
1# dumbpad 1# dumbpad
2 2
3![dumbpad](https://i.imgur.com/sS3fq1Z.jpg) 3![dumbpad](https://i.imgur.com/1T7ciLZl.jpg)
4 4
5A 4x4 macro/numpad with rotary encoder. 5dumbpad is a num/macro pad available in two major form factors - single- and dual-rotary encoder.
6 6
7Keyboard Maintainer: [imchipwood](https://github.com/imchipwood) 7* Single-encoder PCBs are reversible - components can be soldered to either side to allow
8 8the encoder to be on either the left or right side.
9PCB repository: https://github.com/imchipwood/dumbpad 9* Dual-encoder PCBs come in two versions - one with the encoders in the bottom corners, the otherin the top corners
10 10
11Make example for this keyboard (after setting up your build environment): 11Support for dumbpad all PCB revisions can be found in this directory.
12 12
13 make dumbpad:default 13* Maintainer: [imchipwood](https://github.com/imchipwood)
14 14* PCB repository: [dumbpad on github](https://github.com/imchipwood/dumbpad)
15Program with: 15 * PCB revisions:
16 16 * v0.x - these revisions have two LEDs for layer indication
17 make dumbpad:default:avrdude 17 * ['v0x'](v0x/): Default setup for single rotary encoder v0.x PCBs
18 18 * ['v0x_right'](v0x_right/): Same as v0x but with rotary encoder on right side (components on bottom of PCB)
19See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). 19 * ['v0x_dualencoder'](v0x_dualencoder/): Dual-encoder PCBs
20 * v1.x - these revisions have three LEDs - two for layer indication, one for numlock indication
21 * ['v1x'](v1x/): Default setup for v1.x PCBs with a single rotary encoder on the left side
22 * ['v1x_right'](v1x_right/): Same as v1x but with rotary encoder on right side (components on bottom of PCB)
23 * ['v1x_dualencoder'](v1x_dualencoder/): v1x PCB with two rotary encoders
diff --git a/keyboards/dumbpad/rules.mk b/keyboards/dumbpad/rules.mk
index 2ccf3e822..87ec1ab01 100644
--- a/keyboards/dumbpad/rules.mk
+++ b/keyboards/dumbpad/rules.mk
@@ -1,35 +1 @@
1# MCU name DEFAULT_FOLDER = dumbpad/v0x
2MCU = atmega32u4
3
4# Bootloader selection
5# Teensy halfkay
6# Pro Micro caterina
7# Atmel DFU atmel-dfu
8# LUFA DFU lufa-dfu
9# QMK DFU qmk-dfu
10# ATmega32A bootloadHID
11# ATmega328P USBasp
12BOOTLOADER = caterina
13
14# Build Options
15# change yes to no to disable
16#
17BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = yes # Mouse keys
19EXTRAKEY_ENABLE = yes # Audio control and System control
20CONSOLE_ENABLE = yes # Console for debug
21COMMAND_ENABLE = yes # Commands for debug and configuration
22# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
23SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
24# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
25NKRO_ENABLE = no # USB Nkey Rollover
26BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
27RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
28MIDI_ENABLE = no # MIDI support
29UNICODE_ENABLE = no # Unicode
30BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
31AUDIO_ENABLE = no # Audio output on port C6
32
33ENCODER_ENABLE = yes
34MOUSEKEY_ENABLE = yes
35KEY_LOCK_ENABLE = yes
diff --git a/keyboards/dumbpad/v0x/config.h b/keyboards/dumbpad/v0x/config.h
new file mode 100644
index 000000000..6d503c9ab
--- /dev/null
+++ b/keyboards/dumbpad/v0x/config.h
@@ -0,0 +1,41 @@
1/*
2Copyright 2020 imchipwood
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#pragma once
18
19#include "config_common.h"
20
21/* USB Device descriptor parameter */
22#define DEVICE_VER 0x0007
23
24/* Column/Row IO definitions */
25#define MATRIX_ROWS 4
26#define MATRIX_COLS 5
27#define MATRIX_ROW_PINS { F4, F5, F6, F7 }
28#define MATRIX_COL_PINS { C6, D7, E6, B4, B5 }
29#define UNUSED_PINS
30
31/* Single rotary encoder */
32#define ENCODERS_PAD_A { D0 }
33#define ENCODERS_PAD_B { D4 }
34
35/* Onboard LEDs */
36#define LED_00 B3
37#define LED_01 B1
38
39/* Bootmagic - hold down rotary encoder pushbutton while plugging in to enter bootloader */
40#define BOOTMAGIC_LITE_ROW 3
41#define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/dumbpad/v0x/info.json b/keyboards/dumbpad/v0x/info.json
new file mode 100644
index 000000000..7ac64ee68
--- /dev/null
+++ b/keyboards/dumbpad/v0x/info.json
@@ -0,0 +1,18 @@
1{
2 "keyboard_name": "dumbpad/v0x",
3 "keyboard_folder": "dumbpad/v0x",
4 "url": "https://www.github.com/imchipwood/dumbpad",
5 "maintainer": "imchipwood",
6 "width": 5,
7 "height": 4,
8 "layouts": {
9 "LAYOUT": {
10 "layout": [
11 {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0},
12 {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1},
13 {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2},
14 {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}
15 ]
16 }
17 }
18}
diff --git a/keyboards/dumbpad/v0x/keymaps/default/keymap.c b/keyboards/dumbpad/v0x/keymaps/default/keymap.c
new file mode 100644
index 000000000..7ded9f74e
--- /dev/null
+++ b/keyboards/dumbpad/v0x/keymaps/default/keymap.c
@@ -0,0 +1,106 @@
1/* Copyright 2020 imchipwood
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#include QMK_KEYBOARD_H
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 /*
20 BASE LAYER
21 /-----------------------------------------------------`
22 | | 7 | 8 | 9 | Bkspc |
23 | |---------|---------|---------|---------|
24 | | 4 | 5 | 6 | Esc |
25 | |---------|---------|---------|---------|
26 | | 1 | 2 | 3 | Tab |
27 |-------------|---------|---------|---------|---------|
28 | Left mouse | TT(1) | 0 | . | Enter |
29 \-----------------------------------------------------'
30 */
31 [0] = LAYOUT(
32 KC_7, KC_8, KC_9, KC_BSPC,
33 KC_4, KC_5, KC_6, KC_ESC,
34 KC_1, KC_2, KC_3, KC_TAB,
35 KC_BTN1, TT(1), KC_0, LSFT_T(KC_DOT), KC_ENTER
36 ),
37 /*
38 SUB LAYER
39 /-----------------------------------------------------`
40 | | | | | Reset |
41 | |---------|---------|---------|---------|
42 | | | | | + |
43 | |---------|---------|---------|---------|
44 | | | | | - |
45 |-------------|---------|---------|---------|---------|
46 | LOCK | | | | = |
47 \-----------------------------------------------------'
48 */
49 [1] = LAYOUT(
50 _______, _______, _______, RESET,
51 _______, _______, _______, KC_KP_PLUS,
52 _______, _______, _______, KC_KP_MINUS,
53 KC_LOCK, _______, _______, _______, KC_EQL
54 ),
55};
56
57bool process_record_user(uint16_t keycode, keyrecord_t *record) {
58 // If console is enabled, it will print the matrix position and status of each key pressed
59/*
60#ifdef CONSOLE_ENABLE
61 uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
62#endif
63*/
64 return true;
65}
66
67void keyboard_post_init_user(void) {
68 // Customise these values to desired behaviour
69 //debug_enable = true;
70 //debug_matrix = true;
71 //debug_keyboard = true;
72 //debug_mouse = true;
73}
74
75void encoder_update_user(uint8_t index, bool clockwise) {
76 /* Custom encoder control - handles CW/CCW turning of encoder
77 * Default behavior:
78 * main layer:
79 * CW: move mouse right
80 * CCW: move mouse left
81 * other layers:
82 * CW: = (equals/plus - increase slider in Adobe products)
83 * CCW: - (minus/underscore - decrease slider in adobe products)
84 */
85 if (index == 0) {
86 switch (get_highest_layer(layer_state)) {
87 case 0:
88 // main layer - move mouse right (CW) and left (CCW)
89 if (clockwise) {
90 tap_code(KC_MS_R);
91 } else {
92 tap_code(KC_MS_L);
93 }
94 break;
95
96 default:
97 // other layers - =/+ (quals/plus) (CW) and -/_ (minus/underscore) (CCW)
98 if (clockwise) {
99 tap_code(KC_EQL);
100 } else {
101 tap_code(KC_MINS);
102 }
103 break;
104 }
105 }
106}
diff --git a/keyboards/dumbpad/v0x/readme.md b/keyboards/dumbpad/v0x/readme.md
new file mode 100644
index 000000000..ff302de3f
--- /dev/null
+++ b/keyboards/dumbpad/v0x/readme.md
@@ -0,0 +1,15 @@
1# dumbpad v0.x
2
3![dumbpad](https://i.imgur.com/c3YBNp0l.jpg)
4
5A 4x4 numpad/macropad with a rotary encoder to the left of the bottom row of keys.
6
7* Keyboard Maintainer: [imchipwood](https://github.com/imchipwood)
8* Hardware repository: [dumbpad on github](https://github.com/imchipwood/dumbpad)
9* PCB Revisions Supported: v0.2, v0.6, v0.7
10
11Make example for this keyboard (after setting up your build environment):
12
13 make dumbpad/v0x:default
14
15See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/dumbpad/v0x/rules.mk b/keyboards/dumbpad/v0x/rules.mk
new file mode 100644
index 000000000..309e3d48c
--- /dev/null
+++ b/keyboards/dumbpad/v0x/rules.mk
@@ -0,0 +1,25 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = caterina
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = yes # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = no # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
23
24ENCODER_ENABLE = yes
25KEY_LOCK_ENABLE = yes
diff --git a/keyboards/dumbpad/v0x/templates/keymap.c b/keyboards/dumbpad/v0x/templates/keymap.c
new file mode 100644
index 000000000..11ed74518
--- /dev/null
+++ b/keyboards/dumbpad/v0x/templates/keymap.c
@@ -0,0 +1,25 @@
1#include QMK_KEYBOARD_H
2const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};
3
4
5void encoder_update_user(uint8_t index, bool clockwise) {
6 if (index == 0) {
7 switch (get_highest_layer(layer_state)) {
8 case 0:
9 if (clockwise) {
10 tap_code(KC_MS_R);
11 } else {
12 tap_code(KC_MS_L);
13 }
14 break;
15
16 default:
17 if (clockwise) {
18 tap_code(KC_EQL);
19 } else {
20 tap_code(KC_MINS);
21 }
22 break;
23 }
24 }
25}
diff --git a/keyboards/dumbpad/v0x/v0x.c b/keyboards/dumbpad/v0x/v0x.c
new file mode 100644
index 000000000..b981c3769
--- /dev/null
+++ b/keyboards/dumbpad/v0x/v0x.c
@@ -0,0 +1,59 @@
1/* Copyright 2020 imchipwood
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#include "v0x.h"
17
18void keyboard_pre_init_kb(void) {
19 // Set LED IO as outputs
20 setPinOutput(LED_00);
21 setPinOutput(LED_01);
22 keyboard_pre_init_user();
23}
24
25void shutdown_user() {
26 // Shutdown LEDs
27 writePinLow(LED_00);
28 writePinLow(LED_01);
29}
30
31layer_state_t layer_state_set_kb(layer_state_t state) {
32 // Layer LEDs act as binary indication of current layer
33 uint8_t layer = get_highest_layer(state);
34 writePin(LED_00, layer & 0b1);
35 writePin(LED_01, (layer >> 1) & 0b1);
36 return layer_state_set_user(state);
37}
38
39// Optional override functions below.
40// You can leave any or all of these undefined.
41// These are only required if you want to perform custom actions.
42
43void matrix_init_kb(void) {
44 // put your keyboard start-up code here
45 // runs once when the firmware starts up
46 uint8_t led_delay_ms = 80;
47 for (int i = 0; i < 2; i++) {
48 writePinHigh(LED_00);
49 writePinHigh(LED_01);
50 wait_ms(led_delay_ms);
51 writePinLow(LED_00);
52 writePinLow(LED_01);
53 if (i < 1) {
54 wait_ms(led_delay_ms);
55 }
56 }
57
58 matrix_init_user();
59}
diff --git a/keyboards/dumbpad/dumbpad.h b/keyboards/dumbpad/v0x/v0x.h
index b7c7694e3..578250f91 100644
--- a/keyboards/dumbpad/dumbpad.h
+++ b/keyboards/dumbpad/v0x/v0x.h
@@ -1,4 +1,4 @@
1/* Copyright 2019 Chip 1/* Copyright 2020 imchipwood
2 * 2 *
3 * This program is free software: you can redistribute it and/or modify 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 4 * it under the terms of the GNU General Public License as published by
@@ -14,22 +14,13 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16#pragma once 16#pragma once
17
18#include "quantum.h" 17#include "quantum.h"
19 18
20/* This a shortcut to help you visually see your layout.
21 *
22 * The first section contains all of the arguments representing the physical
23 * layout of the board and position of the keys.
24 *
25 * The second converts the arguments into a two-dimensional array which
26 * represents the switch matrix.
27 */
28#define LAYOUT( \ 19#define LAYOUT( \
29 k01, k02, k03, k04, \ 20 k01, k02, k03, k04, \
30 k11, k12, k13, k14, \ 21 k11, k12, k13, k14, \
31 k21, k22, k23, k24, \ 22 k21, k22, k23, k24, \
32 k30, k31, k32, k33, k34 \ 23 k30, k31, k32, k33, k34 \
33) \ 24) \
34{ \ 25{ \
35 { KC_NO, k01, k02, k03, k04 }, \ 26 { KC_NO, k01, k02, k03, k04 }, \
diff --git a/keyboards/dumbpad/v0x_dualencoder/config.h b/keyboards/dumbpad/v0x_dualencoder/config.h
new file mode 100644
index 000000000..586e55056
--- /dev/null
+++ b/keyboards/dumbpad/v0x_dualencoder/config.h
@@ -0,0 +1,40 @@
1/*
2Copyright 2020 imchipwood
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#pragma once
18
19#include "config_common.h"
20
21/* USB Device descriptor parameter */
22#define DEVICE_VER 0x0006
23
24/* Column/Row IO definitions - dualencoder version is true 4x4 */
25#define MATRIX_ROWS 4
26#define MATRIX_COLS 4
27#define MATRIX_ROW_PINS { F4, F5, F6, F7 }
28#define MATRIX_COL_PINS { D7, E6, B4, B5 }
29
30/* Dual rotary encoders */
31#define ENCODERS_PAD_A { C6, D0 }
32#define ENCODERS_PAD_B { D4, D1 }
33
34/* Onboard LEDs */
35#define LED_00 B3
36#define LED_01 B1
37
38/* Bootmagic - hold down rotary encoder pushbutton while plugging in to enter bootloader */
39#define BOOTMAGIC_LITE_ROW 3
40#define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/dumbpad/v0x_dualencoder/info.json b/keyboards/dumbpad/v0x_dualencoder/info.json
new file mode 100644
index 000000000..09a7d14b9
--- /dev/null
+++ b/keyboards/dumbpad/v0x_dualencoder/info.json
@@ -0,0 +1,18 @@
1{
2 "keyboard_name": "dumbpad/v0x_dualencoder",
3 "keyboard_folder": "dumbpad/v0x_dualencoder",
4 "url": "https://www.github.com/imchipwood/dumbpad",
5 "maintainer": "imchipwood",
6 "width": 4,
7 "height": 4,
8 "layouts": {
9 "LAYOUT": {
10 "layout": [
11 {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0},
12 {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1},
13 {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2},
14 {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}
15 ]
16 }
17 }
18}
diff --git a/keyboards/dumbpad/v0x_dualencoder/keymaps/default/keymap.c b/keyboards/dumbpad/v0x_dualencoder/keymaps/default/keymap.c
new file mode 100644
index 000000000..59f36a1a9
--- /dev/null
+++ b/keyboards/dumbpad/v0x_dualencoder/keymaps/default/keymap.c
@@ -0,0 +1,134 @@
1/* Copyright 2020 imchipwood
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#include QMK_KEYBOARD_H
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 /*
20 BASE LAYER
21 /---------------------------------------`
22 | 7 | 8 | 9 | Bkspc |
23 |---------|---------|---------|---------|
24 | 4 | 5 | 6 | Esc |
25 |---------|---------|---------|---------|
26 | 1 | 2 | 3 | Tab |
27 |---------|---------|---------|---------|
28 | TT(1) | 0 | . | Enter |
29 \---------------------------------------'
30 */
31 [0] = LAYOUT(
32 KC_7, KC_8, KC_9, KC_BSPC,
33 KC_4, KC_5, KC_6, KC_ESC,
34 KC_1, KC_2, KC_3, KC_TAB,
35 TT(1), KC_0, KC_DOT, KC_ENTER
36 ),
37 /*
38 SUB LAYER
39 /---------------------------------------`
40 | | | | Reset |
41 |---------|---------|---------|---------|
42 | | | | + |
43 |---------|---------|---------|---------|
44 | | | | - |
45 |---------|---------|---------|---------|
46 | | | | = |
47 \---------------------------------------'
48 */
49 [1] = LAYOUT(
50 _______, _______, _______, RESET,
51 _______, _______, _______, KC_KP_PLUS,
52 _______, _______, _______, KC_KP_MINUS,
53 _______, _______, _______, KC_EQL
54 ),
55};
56
57bool process_record_user(uint16_t keycode, keyrecord_t *record) {
58 // If console is enabled, it will print the matrix position and status of each key pressed
59/*
60#ifdef CONSOLE_ENABLE
61 uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
62#endif
63*/
64 return true;
65}
66
67void keyboard_post_init_user(void) {
68 // Customise these values to desired behaviour
69 // debug_enable = true;
70 // debug_matrix = true;
71 // debug_keyboard = true;
72 // debug_mouse = true;
73}
74
75void encoder_update_user(uint8_t index, bool clockwise) {
76 /* Custom encoder control - handles CW/CCW turning of encoder
77 * Default behavior:
78 * left encoder:
79 * main layer:
80 * CW: move mouse right
81 * CCW: move mouse left
82 * other layers:
83 * CW: = (equals/plus - increase slider in Adobe products)
84 * CCW: - (minus/underscore - decrease slider in adobe products)
85 * right encoder:
86 * main layer:
87 * CW: colume up
88 * CCW: volume down
89 * other layers:
90 * CW: right arrow
91 * CCW: left arrow
92 */
93 if (index == 0) {
94 switch (get_highest_layer(layer_state)) {
95 case 0:
96 // main layer - move mouse right (CW) and left (CCW)
97 if (clockwise) {
98 tap_code(KC_MS_R);
99 } else {
100 tap_code(KC_MS_L);
101 }
102 break;
103
104 default:
105 // other layers - =/+ (quals/plus) (CW) and -/_ (minus/underscore) (CCW)
106 if (clockwise) {
107 tap_code(KC_EQL);
108 } else {
109 tap_code(KC_MINS);
110 }
111 break;
112 }
113 } else if (index == 1) {
114 switch (get_highest_layer(layer_state)) {
115 case 0:
116 // main layer - volume up (CW) and down (CCW)
117 if (clockwise) {
118 tap_code(KC_VOLU);
119 } else {
120 tap_code(KC_VOLD);
121 }
122 break;
123
124 default:
125 // other layers - right (CW) and left (CCW)
126 if (clockwise) {
127 tap_code(KC_RIGHT);
128 } else {
129 tap_code(KC_LEFT);
130 }
131 break;
132 }
133 }
134}
diff --git a/keyboards/dumbpad/v0x_dualencoder/readme.md b/keyboards/dumbpad/v0x_dualencoder/readme.md
new file mode 100644
index 000000000..a4aedb582
--- /dev/null
+++ b/keyboards/dumbpad/v0x_dualencoder/readme.md
@@ -0,0 +1,15 @@
1# dumbpad v0.x dual-encoder
2
3![dumbpad](https://i.imgur.com/OkSRXWTl.jpg)
4
5A 4x4 numpad/macropad with two rotary encoders
6
7* Keyboard Maintainer: [imchipwood](https://github.com/imchipwood)
8* Hardware repository: [dumbpad on github](https://github.com/imchipwood/dumbpad)
9* PCB Revisions Supported: v0.6_dualencoder, v0.6_dualencoder_top
10
11Make example for this keyboard (after setting up your build environment):
12
13 make dumbpad/v0x_dualencoder:default
14
15See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/dumbpad/v0x_dualencoder/rules.mk b/keyboards/dumbpad/v0x_dualencoder/rules.mk
new file mode 100644
index 000000000..309e3d48c
--- /dev/null
+++ b/keyboards/dumbpad/v0x_dualencoder/rules.mk
@@ -0,0 +1,25 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = caterina
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = yes # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = no # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
23
24ENCODER_ENABLE = yes
25KEY_LOCK_ENABLE = yes
diff --git a/keyboards/dumbpad/v0x_dualencoder/templates/keymap.c b/keyboards/dumbpad/v0x_dualencoder/templates/keymap.c
new file mode 100644
index 000000000..0c2be0aad
--- /dev/null
+++ b/keyboards/dumbpad/v0x_dualencoder/templates/keymap.c
@@ -0,0 +1,43 @@
1#include QMK_KEYBOARD_H
2const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};
3
4
5void encoder_update_user(uint8_t index, bool clockwise) {
6 if (index == 0) {
7 switch (get_highest_layer(layer_state)) {
8 case 0:
9 if (clockwise) {
10 tap_code(KC_MS_R);
11 } else {
12 tap_code(KC_MS_L);
13 }
14 break;
15
16 default:
17 if (clockwise) {
18 tap_code(KC_EQL);
19 } else {
20 tap_code(KC_MINS);
21 }
22 break;
23 }
24 } else if (index == 1) {
25 switch (get_highest_layer(layer_state)) {
26 case 0:
27 if (clockwise) {
28 tap_code(KC_VOLU);
29 } else {
30 tap_code(KC_VOLD);
31 }
32 break;
33
34 default:
35 if (clockwise) {
36 tap_code(KC_RIGHT);
37 } else {
38 tap_code(KC_LEFT);
39 }
40 break;
41 }
42 }
43}
diff --git a/keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c b/keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c
new file mode 100644
index 000000000..9b2a2cd24
--- /dev/null
+++ b/keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.c
@@ -0,0 +1,59 @@
1/* Copyright 2020 imchipwood
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#include "v0x_dualencoder.h"
17
18void keyboard_pre_init_kb(void) {
19 // Set LED IO as outputs
20 setPinOutput(LED_00);
21 setPinOutput(LED_01);
22 keyboard_pre_init_user();
23}
24
25void shutdown_user() {
26 // Shutdown LEDs
27 writePinLow(LED_00);
28 writePinLow(LED_01);
29}
30
31layer_state_t layer_state_set_kb(layer_state_t state) {
32 // Layer LEDs act as binary indication of current layer
33 uint8_t layer = get_highest_layer(state);
34 writePin(LED_00, layer & 0b1);
35 writePin(LED_01, (layer >> 1) & 0b1);
36 return layer_state_set_user(state);
37}
38
39// Optional override functions below.
40// You can leave any or all of these undefined.
41// These are only required if you want to perform custom actions.
42
43void matrix_init_kb(void) {
44 // put your keyboard start-up code here
45 // runs once when the firmware starts up
46 uint8_t led_delay_ms = 80;
47 for (int i = 0; i < 2; i++) {
48 writePinHigh(LED_00);
49 writePinHigh(LED_01);
50 wait_ms(led_delay_ms);
51 writePinLow(LED_00);
52 writePinLow(LED_01);
53 if (i < 1) {
54 wait_ms(led_delay_ms);
55 }
56 }
57
58 matrix_init_user();
59}
diff --git a/keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.h b/keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.h
new file mode 100644
index 000000000..f38d39885
--- /dev/null
+++ b/keyboards/dumbpad/v0x_dualencoder/v0x_dualencoder.h
@@ -0,0 +1,30 @@
1/* Copyright 2020 imchipwood
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#pragma once
17#include "quantum.h"
18
19#define LAYOUT( \
20 k00, k01, k02, k03, \
21 k10, k11, k12, k13, \
22 k20, k21, k22, k23, \
23 k30, k31, k32, k33 \
24) \
25{ \
26 { k00, k01, k02, k03 }, \
27 { k10, k11, k12, k13 }, \
28 { k20, k21, k22, k23 }, \
29 { k30, k31, k32, k33 }, \
30}
diff --git a/keyboards/dumbpad/v0x_right/config.h b/keyboards/dumbpad/v0x_right/config.h
new file mode 100644
index 000000000..0380203fd
--- /dev/null
+++ b/keyboards/dumbpad/v0x_right/config.h
@@ -0,0 +1,39 @@
1/*
2Copyright 2020 imchipwood
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#pragma once
18
19/* USB Device descriptor parameter */
20#define DEVICE_VER 0x0007
21
22/* Column/Row IO definitions */
23#define MATRIX_ROWS 4
24#define MATRIX_COLS 5
25#define MATRIX_ROW_PINS { F4, F5, F6, F7 }
26#define MATRIX_COL_PINS { B5, B4, E6, D7, C6 }
27#define UNUSED_PINS
28
29/* Single rotary encoder */
30#define ENCODERS_PAD_A { D4 }
31#define ENCODERS_PAD_B { D0 }
32
33/* Onboard LEDs */
34#define LED_00 B1
35#define LED_01 B3
36
37/* Bootmagic - hold down rotary encoder pushbutton while plugging in to enter bootloader */
38#define BOOTMAGIC_LITE_ROW 3
39#define BOOTMAGIC_LITE_COLUMN 4
diff --git a/keyboards/dumbpad/v0x_right/info.json b/keyboards/dumbpad/v0x_right/info.json
new file mode 100644
index 000000000..d8225c6ee
--- /dev/null
+++ b/keyboards/dumbpad/v0x_right/info.json
@@ -0,0 +1,18 @@
1{
2 "keyboard_name": "dumbpad/v0x_right",
3 "keyboard_folder": "dumbpad/v0x_right",
4 "url": "https://www.github.com/imchipwood/dumbpad",
5 "maintainer": "imchipwood",
6 "width": 5,
7 "height": 4,
8 "layouts": {
9 "LAYOUT": {
10 "layout": [
11 {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0},
12 {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1},
13 {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2},
14 {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}
15 ]
16 }
17 }
18}
diff --git a/keyboards/dumbpad/v0x_right/keymaps/default/keymap.c b/keyboards/dumbpad/v0x_right/keymaps/default/keymap.c
new file mode 100644
index 000000000..4050ac942
--- /dev/null
+++ b/keyboards/dumbpad/v0x_right/keymaps/default/keymap.c
@@ -0,0 +1,106 @@
1/* Copyright 2020 imchipwood
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#include QMK_KEYBOARD_H
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 /*
20 BASE LAYER
21 /-----------------------------------------------------`
22 | 7 | 8 | 9 | Bkspc | |
23 |---------|---------|---------|---------| |
24 | 4 | 5 | 6 | Esc | |
25 |---------|---------|---------|---------| |
26 | 1 | 2 | 3 | Tab | |
27 |---------|---------|---------|---------|-------------|
28 | TT(1) | 0 | . | Enter | Left mouse |
29 \-----------------------------------------------------'
30 */
31 [0] = LAYOUT(
32 KC_7, KC_8, KC_9, KC_BSPC,
33 KC_4, KC_5, KC_6, KC_ESC,
34 KC_1, KC_2, KC_3, KC_TAB,
35 TT(1), KC_0, LSFT_T(KC_DOT), KC_ENTER, KC_BTN1
36 ),
37 /*
38 SUB LAYER
39 /-----------------------------------------------------`
40 | | | | Reset | |
41 |---------|---------|---------|---------| |
42 | | | | + | |
43 |---------|---------|---------|---------| |
44 | | | | - | |
45 |---------|---------|---------|---------|-------------|
46 | | | | = | LOCK |
47 \-----------------------------------------------------'
48 */
49 [1] = LAYOUT(
50 _______, _______, _______, RESET,
51 _______, _______, _______, KC_KP_PLUS,
52 _______, _______, _______, KC_KP_MINUS,
53 _______, _______, _______, KC_EQL, KC_LOCK
54 ),
55};
56
57bool process_record_user(uint16_t keycode, keyrecord_t *record) {
58 // If console is enabled, it will print the matrix position and status of each key pressed
59/*
60#ifdef CONSOLE_ENABLE
61 uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
62#endif
63*/
64 return true;
65}
66
67void keyboard_post_init_user(void) {
68 // Customise these values to desired behaviour
69 // debug_enable = true;
70 // debug_matrix = true;
71 // debug_keyboard = true;
72 // debug_mouse = true;
73}
74
75void encoder_update_user(uint8_t index, bool clockwise) {
76 /* Custom encoder control - handles CW/CCW turning of encoder
77 * Default behavior:
78 * main layer:
79 * CW: move mouse right
80 * CCW: move mouse left
81 * other layers:
82 * CW: = (equals/plus - increase slider in Adobe products)
83 * CCW: - (minus/underscore - decrease slider in adobe products)
84 */
85 if (index == 0) {
86 switch (get_highest_layer(layer_state)) {
87 case 0:
88 // main layer - move mouse right (CW) and left (CCW)
89 if (clockwise) {
90 tap_code(KC_MS_R);
91 } else {
92 tap_code(KC_MS_L);
93 }
94 break;
95
96 default:
97 // other layers - =/+ (quals/plus) (CW) and -/_ (minus/underscore) (CCW)
98 if (clockwise) {
99 tap_code(KC_EQL);
100 } else {
101 tap_code(KC_MINS);
102 }
103 break;
104 }
105 }
106}
diff --git a/keyboards/dumbpad/v0x_right/readme.md b/keyboards/dumbpad/v0x_right/readme.md
new file mode 100644
index 000000000..152ed9b10
--- /dev/null
+++ b/keyboards/dumbpad/v0x_right/readme.md
@@ -0,0 +1,15 @@
1# dumbpad v0.x with encoder on right side
2
3![dumbpad](https://i.imgur.com/c3YBNp0l.jpg)
4
5A 4x4 numpad/macropad with a rotary encoder to the right of the bottom row of keys.
6
7* Keyboard Maintainer: [imchipwood](https://github.com/imchipwood)
8* Hardware repository: [dumbpad on github](https://github.com/imchipwood/dumbpad)
9* PCB Revisions Supported: v0.6, v0.7
10
11Make example for this keyboard (after setting up your build environment):
12
13 make dumbpad/v0x_right:default
14
15See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/dumbpad/v0x_right/rules.mk b/keyboards/dumbpad/v0x_right/rules.mk
new file mode 100644
index 000000000..309e3d48c
--- /dev/null
+++ b/keyboards/dumbpad/v0x_right/rules.mk
@@ -0,0 +1,25 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = caterina
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = yes # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = no # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
23
24ENCODER_ENABLE = yes
25KEY_LOCK_ENABLE = yes
diff --git a/keyboards/dumbpad/v0x_right/templates/keymap.c b/keyboards/dumbpad/v0x_right/templates/keymap.c
new file mode 100644
index 000000000..11ed74518
--- /dev/null
+++ b/keyboards/dumbpad/v0x_right/templates/keymap.c
@@ -0,0 +1,25 @@
1#include QMK_KEYBOARD_H
2const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};
3
4
5void encoder_update_user(uint8_t index, bool clockwise) {
6 if (index == 0) {
7 switch (get_highest_layer(layer_state)) {
8 case 0:
9 if (clockwise) {
10 tap_code(KC_MS_R);
11 } else {
12 tap_code(KC_MS_L);
13 }
14 break;
15
16 default:
17 if (clockwise) {
18 tap_code(KC_EQL);
19 } else {
20 tap_code(KC_MINS);
21 }
22 break;
23 }
24 }
25}
diff --git a/keyboards/dumbpad/v0x_right/v0x_right.c b/keyboards/dumbpad/v0x_right/v0x_right.c
new file mode 100644
index 000000000..2a987b2ea
--- /dev/null
+++ b/keyboards/dumbpad/v0x_right/v0x_right.c
@@ -0,0 +1,59 @@
1/* Copyright 2020 imchipwood
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#include "v0x_right.h"
17
18void keyboard_pre_init_kb(void) {
19 // Set LED IO as outputs
20 setPinOutput(LED_00);
21 setPinOutput(LED_01);
22 keyboard_pre_init_user();
23}
24
25void shutdown_user() {
26 // Shutdown LEDs
27 writePinLow(LED_00);
28 writePinLow(LED_01);
29}
30
31layer_state_t layer_state_set_kb(layer_state_t state) {
32 // Layer LEDs act as binary indication of current layer
33 uint8_t layer = get_highest_layer(state);
34 writePin(LED_00, layer & 0b1);
35 writePin(LED_01, (layer >> 1) & 0b1);
36 return layer_state_set_user(state);
37}
38
39// Optional override functions below.
40// You can leave any or all of these undefined.
41// These are only required if you want to perform custom actions.
42
43void matrix_init_kb(void) {
44 // put your keyboard start-up code here
45 // runs once when the firmware starts up
46 uint8_t led_delay_ms = 80;
47 for (int i = 0; i < 2; i++) {
48 writePinHigh(LED_00);
49 writePinHigh(LED_01);
50 wait_ms(led_delay_ms);
51 writePinLow(LED_00);
52 writePinLow(LED_01);
53 if (i < 1) {
54 wait_ms(led_delay_ms);
55 }
56 }
57
58 matrix_init_user();
59}
diff --git a/keyboards/dumbpad/v0x_right/v0x_right.h b/keyboards/dumbpad/v0x_right/v0x_right.h
new file mode 100644
index 000000000..169f391e8
--- /dev/null
+++ b/keyboards/dumbpad/v0x_right/v0x_right.h
@@ -0,0 +1,30 @@
1/* Copyright 2020 imchipwood
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#pragma once
17#include "quantum.h"
18
19#define LAYOUT( \
20 k00, k01, k02, k03, \
21 k10, k11, k12, k13, \
22 k20, k21, k22, k23, \
23 k30, k31, k32, k33, k34 \
24) \
25{ \
26 { k00, k01, k02, k03, KC_NO }, \
27 { k10, k11, k12, k13, KC_NO }, \
28 { k20, k21, k22, k23, KC_NO }, \
29 { k30, k31, k32, k33, k34 }, \
30}
diff --git a/keyboards/dumbpad/v1x/config.h b/keyboards/dumbpad/v1x/config.h
new file mode 100644
index 000000000..0d967a6a0
--- /dev/null
+++ b/keyboards/dumbpad/v1x/config.h
@@ -0,0 +1,42 @@
1/*
2Copyright 2020 imchipwood
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#pragma once
18
19#include "config_common.h"
20
21/* USB Device descriptor parameter */
22#define DEVICE_VER 0x0010
23
24/* Column/Row IO definitions */
25#define MATRIX_ROWS 4
26#define MATRIX_COLS 5
27#define MATRIX_ROW_PINS { F4, F5, F6, F7 }
28#define MATRIX_COL_PINS { C6, D7, E6, B4, B5 }
29#define UNUSED_PINS
30
31/* Single rotary encoder */
32#define ENCODERS_PAD_A { B2 }
33#define ENCODERS_PAD_B { D4 }
34
35/* Onboard LEDs */
36#define LED_00 B6
37#define LED_01 B1
38#define LED_02 B3
39
40/* Bootmagic - hold down rotary encoder pushbutton while plugging in to enter bootloader */
41#define BOOTMAGIC_LITE_ROW 3
42#define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/dumbpad/v1x/info.json b/keyboards/dumbpad/v1x/info.json
new file mode 100644
index 000000000..3b5739d83
--- /dev/null
+++ b/keyboards/dumbpad/v1x/info.json
@@ -0,0 +1,18 @@
1{
2 "keyboard_name": "dumbpad/v1x",
3 "keyboard_folder": "dumbpad/v1x",
4 "url": "https://www.github.com/imchipwood/dumbpad",
5 "maintainer": "imchipwood",
6 "width": 5,
7 "height": 4,
8 "layouts": {
9 "LAYOUT": {
10 "layout": [
11 {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0},
12 {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1},
13 {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2},
14 {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}
15 ]
16 }
17 }
18}
diff --git a/keyboards/dumbpad/v1x/keymaps/default/keymap.c b/keyboards/dumbpad/v1x/keymaps/default/keymap.c
new file mode 100644
index 000000000..7ded9f74e
--- /dev/null
+++ b/keyboards/dumbpad/v1x/keymaps/default/keymap.c
@@ -0,0 +1,106 @@
1/* Copyright 2020 imchipwood
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#include QMK_KEYBOARD_H
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 /*
20 BASE LAYER
21 /-----------------------------------------------------`
22 | | 7 | 8 | 9 | Bkspc |
23 | |---------|---------|---------|---------|
24 | | 4 | 5 | 6 | Esc |
25 | |---------|---------|---------|---------|
26 | | 1 | 2 | 3 | Tab |
27 |-------------|---------|---------|---------|---------|
28 | Left mouse | TT(1) | 0 | . | Enter |
29 \-----------------------------------------------------'
30 */
31 [0] = LAYOUT(
32 KC_7, KC_8, KC_9, KC_BSPC,
33 KC_4, KC_5, KC_6, KC_ESC,
34 KC_1, KC_2, KC_3, KC_TAB,
35 KC_BTN1, TT(1), KC_0, LSFT_T(KC_DOT), KC_ENTER
36 ),
37 /*
38 SUB LAYER
39 /-----------------------------------------------------`
40 | | | | | Reset |
41 | |---------|---------|---------|---------|
42 | | | | | + |
43 | |---------|---------|---------|---------|
44 | | | | | - |
45 |-------------|---------|---------|---------|---------|
46 | LOCK | | | | = |
47 \-----------------------------------------------------'
48 */
49 [1] = LAYOUT(
50 _______, _______, _______, RESET,
51 _______, _______, _______, KC_KP_PLUS,
52 _______, _______, _______, KC_KP_MINUS,
53 KC_LOCK, _______, _______, _______, KC_EQL
54 ),
55};
56
57bool process_record_user(uint16_t keycode, keyrecord_t *record) {
58 // If console is enabled, it will print the matrix position and status of each key pressed
59/*
60#ifdef CONSOLE_ENABLE
61 uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
62#endif
63*/
64 return true;
65}
66
67void keyboard_post_init_user(void) {
68 // Customise these values to desired behaviour
69 //debug_enable = true;
70 //debug_matrix = true;
71 //debug_keyboard = true;
72 //debug_mouse = true;
73}
74
75void encoder_update_user(uint8_t index, bool clockwise) {
76 /* Custom encoder control - handles CW/CCW turning of encoder
77 * Default behavior:
78 * main layer:
79 * CW: move mouse right
80 * CCW: move mouse left
81 * other layers:
82 * CW: = (equals/plus - increase slider in Adobe products)
83 * CCW: - (minus/underscore - decrease slider in adobe products)
84 */
85 if (index == 0) {
86 switch (get_highest_layer(layer_state)) {
87 case 0:
88 // main layer - move mouse right (CW) and left (CCW)
89 if (clockwise) {
90 tap_code(KC_MS_R);
91 } else {
92 tap_code(KC_MS_L);
93 }
94 break;
95
96 default:
97 // other layers - =/+ (quals/plus) (CW) and -/_ (minus/underscore) (CCW)
98 if (clockwise) {
99 tap_code(KC_EQL);
100 } else {
101 tap_code(KC_MINS);
102 }
103 break;
104 }
105 }
106}
diff --git a/keyboards/dumbpad/v1x/readme.md b/keyboards/dumbpad/v1x/readme.md
new file mode 100644
index 000000000..260a6816a
--- /dev/null
+++ b/keyboards/dumbpad/v1x/readme.md
@@ -0,0 +1,15 @@
1# dumbpad v1.x
2
3![dumbpad](https://i.imgur.com/ND03FiFl.png)
4
5A 4x4 numpad/macropad with a rotary encoder to the left of the bottom row of keys.
6
7* Keyboard Maintainer: [imchipwood](https://github.com/imchipwood)
8* Hardware repository: [dumbpad on github](https://github.com/imchipwood/dumbpad)
9* PCB Revisions Supported: v1.0
10
11Make example for this keyboard (after setting up your build environment):
12
13 make dumbpad/v1x:default
14
15See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/dumbpad/v1x/rules.mk b/keyboards/dumbpad/v1x/rules.mk
new file mode 100644
index 000000000..309e3d48c
--- /dev/null
+++ b/keyboards/dumbpad/v1x/rules.mk
@@ -0,0 +1,25 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = caterina
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = yes # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = no # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
23
24ENCODER_ENABLE = yes
25KEY_LOCK_ENABLE = yes
diff --git a/keyboards/dumbpad/v1x/templates/keymap.c b/keyboards/dumbpad/v1x/templates/keymap.c
new file mode 100644
index 000000000..11ed74518
--- /dev/null
+++ b/keyboards/dumbpad/v1x/templates/keymap.c
@@ -0,0 +1,25 @@
1#include QMK_KEYBOARD_H
2const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};
3
4
5void encoder_update_user(uint8_t index, bool clockwise) {
6 if (index == 0) {
7 switch (get_highest_layer(layer_state)) {
8 case 0:
9 if (clockwise) {
10 tap_code(KC_MS_R);
11 } else {
12 tap_code(KC_MS_L);
13 }
14 break;
15
16 default:
17 if (clockwise) {
18 tap_code(KC_EQL);
19 } else {
20 tap_code(KC_MINS);
21 }
22 break;
23 }
24 }
25}
diff --git a/keyboards/dumbpad/v1x/v1x.c b/keyboards/dumbpad/v1x/v1x.c
new file mode 100644
index 000000000..0adef0f61
--- /dev/null
+++ b/keyboards/dumbpad/v1x/v1x.c
@@ -0,0 +1,69 @@
1/* Copyright 2020 imchipwood
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#include "v1x.h"
17
18void keyboard_pre_init_kb(void) {
19 // Set LED IO as outputs
20 setPinOutput(LED_00);
21 setPinOutput(LED_01);
22 setPinOutput(LED_02);
23 keyboard_pre_init_user();
24}
25
26void shutdown_user() {
27 // Shutdown LEDs
28 writePinLow(LED_00);
29 writePinLow(LED_01);
30 writePinLow(LED_02);
31}
32
33layer_state_t layer_state_set_kb(layer_state_t state) {
34 // Layer LEDs act as binary indication of current layer
35 uint8_t layer = get_highest_layer(state);
36 writePin(LED_00, layer & 0b1);
37 writePin(LED_01, (layer >> 1) & 0b1);
38 return layer_state_set_user(state);
39}
40
41// Optional override functions below.
42// You can leave any or all of these undefined.
43// These are only required if you want to perform custom actions.
44
45void matrix_init_kb(void) {
46 // put your keyboard start-up code here
47 // runs once when the firmware starts up
48 uint8_t led_delay_ms = 80;
49 for (int i = 0; i < 2; i++) {
50 writePinHigh(LED_00);
51 writePinHigh(LED_01);
52 writePinHigh(LED_02);
53 wait_ms(led_delay_ms);
54 writePinLow(LED_00);
55 writePinLow(LED_01);
56 writePinLow(LED_02);
57 if (i < 1) {
58 wait_ms(led_delay_ms);
59 }
60 }
61
62 matrix_init_user();
63}
64
65void led_set_kb(uint8_t usb_led) {
66 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
67 writePin(LED_02, !IS_LED_ON(usb_led, USB_LED_NUM_LOCK));
68 led_set_user(usb_led);
69}
diff --git a/keyboards/dumbpad/v1x/v1x.h b/keyboards/dumbpad/v1x/v1x.h
new file mode 100644
index 000000000..578250f91
--- /dev/null
+++ b/keyboards/dumbpad/v1x/v1x.h
@@ -0,0 +1,30 @@
1/* Copyright 2020 imchipwood
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#pragma once
17#include "quantum.h"
18
19#define LAYOUT( \
20 k01, k02, k03, k04, \
21 k11, k12, k13, k14, \
22 k21, k22, k23, k24, \
23 k30, k31, k32, k33, k34 \
24) \
25{ \
26 { KC_NO, k01, k02, k03, k04 }, \
27 { KC_NO, k11, k12, k13, k14 }, \
28 { KC_NO, k21, k22, k23, k24 }, \
29 { k30, k31, k32, k33, k34 }, \
30}
diff --git a/keyboards/dumbpad/v1x_dualencoder/config.h b/keyboards/dumbpad/v1x_dualencoder/config.h
new file mode 100644
index 000000000..13f4785d8
--- /dev/null
+++ b/keyboards/dumbpad/v1x_dualencoder/config.h
@@ -0,0 +1,42 @@
1/*
2Copyright 2020 imchipwood
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#pragma once
18
19#include "config_common.h"
20
21/* USB Device descriptor parameter */
22#define DEVICE_VER 0x0010
23
24/* Column/Row IO definitions */
25#define MATRIX_ROWS 4
26#define MATRIX_COLS 5
27#define MATRIX_ROW_PINS { F4, F5, F6, F7 }
28#define MATRIX_COL_PINS { C6, D7, E6, B4, B5 }
29#define UNUSED_PINS
30
31/* Dual rotary encoders */
32#define ENCODERS_PAD_A { B2, D0 }
33#define ENCODERS_PAD_B { D4, D1 }
34
35/* Onboard LEDs */
36#define LED_00 B6
37#define LED_01 B1
38#define LED_02 B3
39
40/* Bootmagic - hold down rotary encoder pushbutton while plugging in to enter bootloader */
41#define BOOTMAGIC_LITE_ROW 3
42#define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/dumbpad/v1x_dualencoder/info.json b/keyboards/dumbpad/v1x_dualencoder/info.json
new file mode 100644
index 000000000..60e584193
--- /dev/null
+++ b/keyboards/dumbpad/v1x_dualencoder/info.json
@@ -0,0 +1,18 @@
1{
2 "keyboard_name": "dumbpad/v1x_dualencoder",
3 "keyboard_folder": "dumbpad/v1x_dualencoder",
4 "url": "https://www.github.com/imchipwood/dumbpad",
5 "maintainer": "imchipwood",
6 "width": 5,
7 "height": 4,
8 "layouts": {
9 "LAYOUT": {
10 "layout": [
11 {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0},
12 {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1},
13 {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2},
14 {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}
15 ]
16 }
17 }
18}
diff --git a/keyboards/dumbpad/v1x_dualencoder/keymaps/default/keymap.c b/keyboards/dumbpad/v1x_dualencoder/keymaps/default/keymap.c
new file mode 100644
index 000000000..548b594dd
--- /dev/null
+++ b/keyboards/dumbpad/v1x_dualencoder/keymaps/default/keymap.c
@@ -0,0 +1,134 @@
1/* Copyright 2020 imchipwood
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#include QMK_KEYBOARD_H
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 /*
20 BASE LAYER
21 /-----------------------------------------------------`
22 | | 7 | 8 | 9 | Bkspc |
23 | |---------|---------|---------|---------|
24 | | 4 | 5 | 6 | Esc |
25 | |---------|---------|---------|---------|
26 | | 1 | 2 | 3 | Tab |
27 |-------------|---------|---------|---------|---------|
28 | Left mouse | TT(1) | 0 | . | Enter |
29 \-----------------------------------------------------'
30 */
31 [0] = LAYOUT(
32 KC_7, KC_8, KC_9, KC_BSPC,
33 KC_4, KC_5, KC_6, KC_ESC,
34 KC_1, KC_2, KC_3, KC_TAB,
35 KC_BTN1, TT(1), KC_0, LSFT_T(KC_DOT), KC_ENTER
36 ),
37 /*
38 SUB LAYER
39 /-----------------------------------------------------`
40 | | | | | Reset |
41 | |---------|---------|---------|---------|
42 | | | | | + |
43 | |---------|---------|---------|---------|
44 | | | | | - |
45 |-------------|---------|---------|---------|---------|
46 | LOCK | | | | = |
47 \-----------------------------------------------------'
48 */
49 [1] = LAYOUT(
50 _______, _______, _______, RESET,
51 _______, _______, _______, KC_KP_PLUS,
52 _______, _______, _______, KC_KP_MINUS,
53 KC_LOCK, _______, _______, _______, KC_EQL
54 ),
55};
56
57bool process_record_user(uint16_t keycode, keyrecord_t *record) {
58 // If console is enabled, it will print the matrix position and status of each key pressed
59/*
60#ifdef CONSOLE_ENABLE
61 uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
62#endif
63*/
64 return true;
65}
66
67void keyboard_post_init_user(void) {
68 // Customise these values to desired behaviour
69 // debug_enable = true;
70 // debug_matrix = true;
71 // debug_keyboard = true;
72 // debug_mouse = true;
73}
74
75void encoder_update_user(uint8_t index, bool clockwise) {
76 /* Custom encoder control - handles CW/CCW turning of encoder
77 * Default behavior:
78 * left encoder:
79 * main layer:
80 * CW: move mouse right
81 * CCW: move mouse left
82 * other layers:
83 * CW: = (equals/plus - increase slider in Adobe products)
84 * CCW: - (minus/underscore - decrease slider in adobe products)
85 * right encoder:
86 * main layer:
87 * CW: colume up
88 * CCW: volume down
89 * other layers:
90 * CW: right arrow
91 * CCW: left arrow
92 */
93 if (index == 0) {
94 switch (get_highest_layer(layer_state)) {
95 case 0:
96 // main layer - move mouse right (CW) and left (CCW)
97 if (clockwise) {
98 tap_code(KC_MS_R);
99 } else {
100 tap_code(KC_MS_L);
101 }
102 break;
103
104 default:
105 // other layers - =/+ (quals/plus) (CW) and -/_ (minus/underscore) (CCW)
106 if (clockwise) {
107 tap_code(KC_EQL);
108 } else {
109 tap_code(KC_MINS);
110 }
111 break;
112 }
113 } else if (index == 1) {
114 switch (get_highest_layer(layer_state)) {
115 case 0:
116 // main layer - volume up (CW) and down (CCW)
117 if (clockwise) {
118 tap_code(KC_VOLU);
119 } else {
120 tap_code(KC_VOLD);
121 }
122 break;
123
124 default:
125 // other layers - right (CW) and left (CCW)
126 if (clockwise) {
127 tap_code(KC_RIGHT);
128 } else {
129 tap_code(KC_LEFT);
130 }
131 break;
132 }
133 }
134}
diff --git a/keyboards/dumbpad/v1x_dualencoder/readme.md b/keyboards/dumbpad/v1x_dualencoder/readme.md
new file mode 100644
index 000000000..b568351bf
--- /dev/null
+++ b/keyboards/dumbpad/v1x_dualencoder/readme.md
@@ -0,0 +1,87 @@
1# dumbpad v1.x dual-encoder
2
3![dumbpad](https://i.imgur.com/s69rdfA.png)
4
5## Single- vs Dual-Encoder Support
6
7The combined Cherry MX/encoder sockets allow single- and dual-encoder configurations.
8
9The only rule when using two encoders is that there cannot be two encoders on the left side at once, or two on the right side.
10This table shows where the encoders are in the switch grid ("X" for encoder, "s" for switch):
11
12| C0 | C1 | C2 | C3 | C4 |
13|:---:|:---:|:---:|:---:|:---:|
14| |__X__| s | s |__X__|
15| | s | s | s | s |
16| | s | s | s | s |
17|__X__|__X__| s | s |__X__|
18
19- The three encoders in columns C0 and C1 are connected to each other
20- The two encoders in column C4 are connected to each other
21
22So, if doing dual encoders, one must be in column C4 and the other in either C0 or C1. Three or more encoders will not work.
23
24The following sections describe the configurations that the default keymaps in QMK are designed for.
25
26### Single-Encoder (Default Configuration)
27
28In the default configuration, the encoder is in column 0, the bottom left corner below the Pro Micro. All other sockets are filled with switches.
29
30| C0 | C1 | C2 | C3 | C4 |
31|:---:|:---:|:---:|:---:|:---:|
32| | s | s | s | s |
33| | s | s | s | s |
34| | s | s | s | s |
35|__X__| s | s | s | s |
36
37![single encoder](https://i.imgur.com/8ZPz1gFl.jpg)
38
39### Dual-Encoder Bottom
40
41One dual-encoder configuration has encoders in the bottom two corners of the 4x4 grid, and switches in the rest of the grid. The socket in column 0 is left empty.
42
43| C0 | C1 | C2 | C3 | C4 |
44|:---:|:---:|:---:|:---:|:---:|
45| | s | s | s | s |
46| | s | s | s | s |
47| | s | s | s | s |
48| |__X__| s | s |__X__|
49
50![dual-encoder bottom](https://i.imgur.com/QCqKDMSl.jpg)
51
52### Dual-Encoder Top
53
54Another dual-encoder configuration has encoders in the top two corners of the 4x4 grid, and switches in the rest of the grid. The socket in column 0 is left empty.
55
56| C0 | C1 | C2 | C3 | C4 |
57|:---:|:---:|:---:|:---:|:---:|
58| |__X__| s | s |__X__|
59| | s | s | s | s |
60| | s | s | s | s |
61| | s | s | s | s |
62
63![dual-encoder top](https://i.imgur.com/Rq6ox2Ol.jpg)
64
65### No-Encoder
66
67You may also choose not to use any rotary encoders if you like!
68
69### Bill Of Materials
70
71- Cherry-style mechanical switches
72- EC11 rotary encoder with pushbutton (7-pin) - one or two depending on your desired configuration
73- 1n4148 diodes (thru hole) - one per switch and rotary encoder (if using clickable encoder(s))
74- 1x Arduino Pro Micro or pin-compatible ATmega32u4-based MCU
75- (optional) 3x 3mm LEDs
76- (optional) 3x 330 ohm resistors (for limiting current in LEDs)
77- (optional) 6mm SPST switch for resetting MCU
78
79* Keyboard Maintainer: [imchipwood](https://github.com/imchipwood)
80* Hardware repository: [dumbpad on github](https://github.com/imchipwood/dumbpad)
81* PCB Revisions Supported: v1.0_dual
82
83Make example for this keyboard (after setting up your build environment):
84
85 make dumbpad/v1x_dualencoder:default
86
87See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/dumbpad/v1x_dualencoder/rules.mk b/keyboards/dumbpad/v1x_dualencoder/rules.mk
new file mode 100644
index 000000000..309e3d48c
--- /dev/null
+++ b/keyboards/dumbpad/v1x_dualencoder/rules.mk
@@ -0,0 +1,25 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = caterina
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = yes # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = no # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
23
24ENCODER_ENABLE = yes
25KEY_LOCK_ENABLE = yes
diff --git a/keyboards/dumbpad/v1x_dualencoder/templates/keymap.c b/keyboards/dumbpad/v1x_dualencoder/templates/keymap.c
new file mode 100644
index 000000000..0c2be0aad
--- /dev/null
+++ b/keyboards/dumbpad/v1x_dualencoder/templates/keymap.c
@@ -0,0 +1,43 @@
1#include QMK_KEYBOARD_H
2const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};
3
4
5void encoder_update_user(uint8_t index, bool clockwise) {
6 if (index == 0) {
7 switch (get_highest_layer(layer_state)) {
8 case 0:
9 if (clockwise) {
10 tap_code(KC_MS_R);
11 } else {
12 tap_code(KC_MS_L);
13 }
14 break;
15
16 default:
17 if (clockwise) {
18 tap_code(KC_EQL);
19 } else {
20 tap_code(KC_MINS);
21 }
22 break;
23 }
24 } else if (index == 1) {
25 switch (get_highest_layer(layer_state)) {
26 case 0:
27 if (clockwise) {
28 tap_code(KC_VOLU);
29 } else {
30 tap_code(KC_VOLD);
31 }
32 break;
33
34 default:
35 if (clockwise) {
36 tap_code(KC_RIGHT);
37 } else {
38 tap_code(KC_LEFT);
39 }
40 break;
41 }
42 }
43}
diff --git a/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c b/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c
new file mode 100644
index 000000000..4ea402d80
--- /dev/null
+++ b/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.c
@@ -0,0 +1,69 @@
1/* Copyright 2020 imchipwood
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#include "v1x_dualencoder.h"
17
18void keyboard_pre_init_kb(void) {
19 // Set LED IO as outputs
20 setPinOutput(LED_00);
21 setPinOutput(LED_01);
22 setPinOutput(LED_02);
23 keyboard_pre_init_user();
24}
25
26void shutdown_user() {
27 // Shutdown LEDs
28 writePinLow(LED_00);
29 writePinLow(LED_01);
30 writePinLow(LED_02);
31}
32
33layer_state_t layer_state_set_kb(layer_state_t state) {
34 // Layer LEDs act as binary indication of current layer
35 uint8_t layer = get_highest_layer(state);
36 writePin(LED_00, layer & 0b1);
37 writePin(LED_01, (layer >> 1) & 0b1);
38 return layer_state_set_user(state);
39}
40
41// Optional override functions below.
42// You can leave any or all of these undefined.
43// These are only required if you want to perform custom actions.
44
45void matrix_init_kb(void) {
46 // put your keyboard start-up code here
47 // runs once when the firmware starts up
48 uint8_t led_delay_ms = 80;
49 for (int i = 0; i < 2; i++) {
50 writePinHigh(LED_00);
51 writePinHigh(LED_01);
52 writePinHigh(LED_02);
53 wait_ms(led_delay_ms);
54 writePinLow(LED_00);
55 writePinLow(LED_01);
56 writePinLow(LED_02);
57 if (i < 1) {
58 wait_ms(led_delay_ms);
59 }
60 }
61
62 matrix_init_user();
63}
64
65void led_set_kb(uint8_t usb_led) {
66 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
67 writePin(LED_02, !IS_LED_ON(usb_led, USB_LED_NUM_LOCK));
68 led_set_user(usb_led);
69}
diff --git a/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.h b/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.h
new file mode 100644
index 000000000..b8bb84fe5
--- /dev/null
+++ b/keyboards/dumbpad/v1x_dualencoder/v1x_dualencoder.h
@@ -0,0 +1,30 @@
1/* Copyright 2020 imchipwood
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#pragma once
17#include "quantum.h"
18
19#define LAYOUT( \
20 k01, k02, k03, k04, \
21 k11, k12, k13, k14, \
22 k21, k22, k23, k24, \
23 k30, k31, k32, k33, k34 \
24) \
25{ \
26 { KC_NO, k01, k02, k03, k04 }, \
27 { KC_NO, k11, k12, k13, k14 }, \
28 { KC_NO, k21, k22, k23, k24 }, \
29 { k30, k31, k32, k33, k34 }, \
30}
diff --git a/keyboards/dumbpad/v1x_right/config.h b/keyboards/dumbpad/v1x_right/config.h
new file mode 100644
index 000000000..23c2685dd
--- /dev/null
+++ b/keyboards/dumbpad/v1x_right/config.h
@@ -0,0 +1,42 @@
1/*
2Copyright 2020 imchipwood
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#pragma once
18
19#include "config_common.h"
20
21/* USB Device descriptor parameter */
22#define DEVICE_VER 0x0010
23
24/* Column/Row IO definitions */
25#define MATRIX_ROWS 4
26#define MATRIX_COLS 5
27#define MATRIX_ROW_PINS { F4, F5, F6, F7 }
28#define MATRIX_COL_PINS { B5, B4, E6, D7, C6 }
29#define UNUSED_PINS
30
31/* Single rotary encoder */
32#define ENCODERS_PAD_A { D4 }
33#define ENCODERS_PAD_B { B2 }
34
35/* Onboard LEDs - reversed */
36#define LED_00 B3
37#define LED_01 B1
38#define LED_02 B6
39
40/* Bootmagic - hold down rotary encoder pushbutton while plugging in to enter bootloader */
41#define BOOTMAGIC_LITE_ROW 3
42#define BOOTMAGIC_LITE_COLUMN 4
diff --git a/keyboards/dumbpad/v1x_right/info.json b/keyboards/dumbpad/v1x_right/info.json
new file mode 100644
index 000000000..e812f0bb8
--- /dev/null
+++ b/keyboards/dumbpad/v1x_right/info.json
@@ -0,0 +1,18 @@
1{
2 "keyboard_name": "dumbpad/v1x_right",
3 "keyboard_folder": "dumbpad/v1x_right",
4 "url": "https://www.github.com/imchipwood/dumbpad",
5 "maintainer": "imchipwood",
6 "width": 5,
7 "height": 4,
8 "layouts": {
9 "LAYOUT": {
10 "layout": [
11 {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0},
12 {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1},
13 {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2},
14 {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}
15 ]
16 }
17 }
18}
diff --git a/keyboards/dumbpad/v1x_right/keymaps/default/keymap.c b/keyboards/dumbpad/v1x_right/keymaps/default/keymap.c
new file mode 100644
index 000000000..4050ac942
--- /dev/null
+++ b/keyboards/dumbpad/v1x_right/keymaps/default/keymap.c
@@ -0,0 +1,106 @@
1/* Copyright 2020 imchipwood
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#include QMK_KEYBOARD_H
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 /*
20 BASE LAYER
21 /-----------------------------------------------------`
22 | 7 | 8 | 9 | Bkspc | |
23 |---------|---------|---------|---------| |
24 | 4 | 5 | 6 | Esc | |
25 |---------|---------|---------|---------| |
26 | 1 | 2 | 3 | Tab | |
27 |---------|---------|---------|---------|-------------|
28 | TT(1) | 0 | . | Enter | Left mouse |
29 \-----------------------------------------------------'
30 */
31 [0] = LAYOUT(
32 KC_7, KC_8, KC_9, KC_BSPC,
33 KC_4, KC_5, KC_6, KC_ESC,
34 KC_1, KC_2, KC_3, KC_TAB,
35 TT(1), KC_0, LSFT_T(KC_DOT), KC_ENTER, KC_BTN1
36 ),
37 /*
38 SUB LAYER
39 /-----------------------------------------------------`
40 | | | | Reset | |
41 |---------|---------|---------|---------| |
42 | | | | + | |
43 |---------|---------|---------|---------| |
44 | | | | - | |
45 |---------|---------|---------|---------|-------------|
46 | | | | = | LOCK |
47 \-----------------------------------------------------'
48 */
49 [1] = LAYOUT(
50 _______, _______, _______, RESET,
51 _______, _______, _______, KC_KP_PLUS,
52 _______, _______, _______, KC_KP_MINUS,
53 _______, _______, _______, KC_EQL, KC_LOCK
54 ),
55};
56
57bool process_record_user(uint16_t keycode, keyrecord_t *record) {
58 // If console is enabled, it will print the matrix position and status of each key pressed
59/*
60#ifdef CONSOLE_ENABLE
61 uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
62#endif
63*/
64 return true;
65}
66
67void keyboard_post_init_user(void) {
68 // Customise these values to desired behaviour
69 // debug_enable = true;
70 // debug_matrix = true;
71 // debug_keyboard = true;
72 // debug_mouse = true;
73}
74
75void encoder_update_user(uint8_t index, bool clockwise) {
76 /* Custom encoder control - handles CW/CCW turning of encoder
77 * Default behavior:
78 * main layer:
79 * CW: move mouse right
80 * CCW: move mouse left
81 * other layers:
82 * CW: = (equals/plus - increase slider in Adobe products)
83 * CCW: - (minus/underscore - decrease slider in adobe products)
84 */
85 if (index == 0) {
86 switch (get_highest_layer(layer_state)) {
87 case 0:
88 // main layer - move mouse right (CW) and left (CCW)
89 if (clockwise) {
90 tap_code(KC_MS_R);
91 } else {
92 tap_code(KC_MS_L);
93 }
94 break;
95
96 default:
97 // other layers - =/+ (quals/plus) (CW) and -/_ (minus/underscore) (CCW)
98 if (clockwise) {
99 tap_code(KC_EQL);
100 } else {
101 tap_code(KC_MINS);
102 }
103 break;
104 }
105 }
106}
diff --git a/keyboards/dumbpad/v1x_right/readme.md b/keyboards/dumbpad/v1x_right/readme.md
new file mode 100644
index 000000000..5e983bf40
--- /dev/null
+++ b/keyboards/dumbpad/v1x_right/readme.md
@@ -0,0 +1,15 @@
1# dumbpad v1.x with encoder on right side
2
3![dumbpad](https://i.imgur.com/ND03FiFl.png)
4
5A 4x4 numpad/macropad with a rotary encoder to the right of the bottom row of keys.
6
7* Keyboard Maintainer: [imchipwood](https://github.com/imchipwood)
8* Hardware repository: [dumbpad on github](https://github.com/imchipwood/dumbpad)
9* PCB Revisions Supported: v1.0
10
11Make example for this keyboard (after setting up your build environment):
12
13 make dumbpad/v1x_right:default
14
15See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/dumbpad/v1x_right/rules.mk b/keyboards/dumbpad/v1x_right/rules.mk
new file mode 100644
index 000000000..309e3d48c
--- /dev/null
+++ b/keyboards/dumbpad/v1x_right/rules.mk
@@ -0,0 +1,25 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = caterina
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = yes # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = no # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
23
24ENCODER_ENABLE = yes
25KEY_LOCK_ENABLE = yes
diff --git a/keyboards/dumbpad/v1x_right/templates/keymap.c b/keyboards/dumbpad/v1x_right/templates/keymap.c
new file mode 100644
index 000000000..11ed74518
--- /dev/null
+++ b/keyboards/dumbpad/v1x_right/templates/keymap.c
@@ -0,0 +1,25 @@
1#include QMK_KEYBOARD_H
2const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {__KEYMAP_GOES_HERE__};
3
4
5void encoder_update_user(uint8_t index, bool clockwise) {
6 if (index == 0) {
7 switch (get_highest_layer(layer_state)) {
8 case 0:
9 if (clockwise) {
10 tap_code(KC_MS_R);
11 } else {
12 tap_code(KC_MS_L);
13 }
14 break;
15
16 default:
17 if (clockwise) {
18 tap_code(KC_EQL);
19 } else {
20 tap_code(KC_MINS);
21 }
22 break;
23 }
24 }
25}
diff --git a/keyboards/dumbpad/v1x_right/v1x_right.c b/keyboards/dumbpad/v1x_right/v1x_right.c
new file mode 100644
index 000000000..c2adbaebe
--- /dev/null
+++ b/keyboards/dumbpad/v1x_right/v1x_right.c
@@ -0,0 +1,69 @@
1/* Copyright 2020 imchipwood
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#include "v1x_right.h"
17
18void keyboard_pre_init_kb(void) {
19 // Set LED IO as outputs
20 setPinOutput(LED_00);
21 setPinOutput(LED_01);
22 setPinOutput(LED_02);
23 keyboard_pre_init_user();
24}
25
26void shutdown_user() {
27 // Shutdown LEDs
28 writePinLow(LED_00);
29 writePinLow(LED_01);
30 writePinLow(LED_02);
31}
32
33layer_state_t layer_state_set_kb(layer_state_t state) {
34 // Layer LEDs act as binary indication of current layer
35 uint8_t layer = get_highest_layer(state);
36 writePin(LED_00, layer & 0b1);
37 writePin(LED_01, (layer >> 1) & 0b1);
38 return layer_state_set_user(state);
39}
40
41// Optional override functions below.
42// You can leave any or all of these undefined.
43// These are only required if you want to perform custom actions.
44
45void matrix_init_kb(void) {
46 // put your keyboard start-up code here
47 // runs once when the firmware starts up
48 uint8_t led_delay_ms = 80;
49 for (int i = 0; i < 2; i++) {
50 writePinHigh(LED_00);
51 writePinHigh(LED_01);
52 writePinHigh(LED_02);
53 wait_ms(led_delay_ms);
54 writePinLow(LED_00);
55 writePinLow(LED_01);
56 writePinLow(LED_02);
57 if (i < 1) {
58 wait_ms(led_delay_ms);
59 }
60 }
61
62 matrix_init_user();
63}
64
65void led_set_kb(uint8_t usb_led) {
66 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
67 writePin(LED_02, !IS_LED_ON(usb_led, USB_LED_NUM_LOCK));
68 led_set_user(usb_led);
69}
diff --git a/keyboards/dumbpad/v1x_right/v1x_right.h b/keyboards/dumbpad/v1x_right/v1x_right.h
new file mode 100644
index 000000000..169f391e8
--- /dev/null
+++ b/keyboards/dumbpad/v1x_right/v1x_right.h
@@ -0,0 +1,30 @@
1/* Copyright 2020 imchipwood
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#pragma once
17#include "quantum.h"
18
19#define LAYOUT( \
20 k00, k01, k02, k03, \
21 k10, k11, k12, k13, \
22 k20, k21, k22, k23, \
23 k30, k31, k32, k33, k34 \
24) \
25{ \
26 { k00, k01, k02, k03, KC_NO }, \
27 { k10, k11, k12, k13, KC_NO }, \
28 { k20, k21, k22, k23, KC_NO }, \
29 { k30, k31, k32, k33, k34 }, \
30}