[Keyboard] Update DogTag Macro Pad (#16446)

Co-authored-by: Drashna Jaelre <drashna@live.com>
This commit is contained in:
takashicompany 2022-03-07 16:02:52 +09:00 committed by GitHub
parent 6e61126e08
commit 41fb9120d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 74 additions and 34 deletions

View File

@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define PRODUCT DogTag #define PRODUCT DogTag
/* key matrix size */ /* key matrix size */
#define MATRIX_ROWS 2 * 2 #define MATRIX_ROWS 6
#define MATRIX_COLS 5 #define MATRIX_COLS 5
/* /*
@ -40,9 +40,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
* *
*/ */
#define MATRIX_ROW_PINS { B2, B6 } #define MATRIX_ROW_PINS { B2, B6, B3 }
#define MATRIX_COL_PINS { F4, F5, F6, F7, B1 } #define MATRIX_COL_PINS { F4, F5, F6, F7, B1 }
#define MATRIX_ROW_PINS_RIGHT { B2, B6 } #define MATRIX_ROW_PINS_RIGHT { B2, B6, B3 }
#define MATRIX_COL_PINS_RIGHT { B1, F7, F6, F5, F4 } #define MATRIX_COL_PINS_RIGHT { B1, F7, F6, F5, F4 }
#define UNUSED_PINS #define UNUSED_PINS
@ -50,7 +50,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* COL2ROW, ROW2COL */ /* COL2ROW, ROW2COL */
#define DIODE_DIRECTION COL2ROW #define DIODE_DIRECTION COL2ROW
#define ENCODER_RESOLUTION 1 #define ENCODER_RESOLUTION 4
#define ENCODERS_PAD_A { D4 } #define ENCODERS_PAD_A { D4 }
#define ENCODERS_PAD_B { C6 } #define ENCODERS_PAD_B { C6 }
@ -71,8 +71,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGB_DI_PIN D3 #define RGB_DI_PIN D3
#ifdef RGB_DI_PIN #ifdef RGB_DI_PIN
# define RGBLED_NUM 3 * 2 # define RGBLED_NUM 4 * 2
# define RGBLED_SPLIT {3, 3} # define RGBLED_SPLIT { 4, 4 }
# define RGBLIGHT_HUE_STEP 8 # define RGBLIGHT_HUE_STEP 8
# define RGBLIGHT_SAT_STEP 8 # define RGBLIGHT_SAT_STEP 8
# define RGBLIGHT_VAL_STEP 8 # define RGBLIGHT_VAL_STEP 8

View File

@ -17,11 +17,31 @@
#include "dogtag.h" #include "dogtag.h"
bool encoder_update_kb(uint8_t index, bool clockwise) { bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) { return false; } keypos_t key;
if (clockwise) { if (index == 0) {
tap_code(KC_MS_WH_DOWN); if (clockwise) {
key.row = 2;
key.col = 1;
} else {
key.row = 2;
key.col = 0;
}
uint8_t layer = layer_switch_get_layer(key);
uint16_t keycode = keymap_key_to_keycode(layer, key);
tap_code16(keycode);
} else { } else {
tap_code(KC_MS_WH_UP); if (clockwise) {
key.row = 5;
key.col = 0;
} else {
key.row = 5;
key.col = 1;
}
uint8_t layer = layer_switch_get_layer(key);
uint16_t keycode = keymap_key_to_keycode(layer, key);
tap_code16(keycode);
} }
return true; return true;

View File

@ -27,11 +27,14 @@
* represents the switch matrix. * represents the switch matrix.
*/ */
#define LAYOUT( \ #define LAYOUT( \
l01, l02, l03, l04, r01, r02, r03, r04,\ l01, l02, l03, l04, r01, r02, r03, r04, \
l05, l06, l07, l08, l09, r05, r06, r07, r08, r09 \ l05, l06, l07, l08, l09, r05, r06, r07, r08, r09, \
l10, l11, r10, r11 \
) { \ ) { \
{ l01, l02, l03, l04, KC_NO }, \ { l01, l02, l03, l04, KC_NO }, \
{ l05, l06, l07, l08, l09 }, \ { l05, l06, l07, l08, l09 }, \
{ KC_NO, r01, r02, r03, r04,}, \ { l10, l11, KC_NO, KC_NO, KC_NO }, \
{ r05, r06, r07, r08, r09 } \ { KC_NO, r01, r02, r03, r04}, \
{ r05, r06, r07, r08, r09 }, \
{ r10, r11, KC_NO, KC_NO, KC_NO } \
} }

View File

@ -21,10 +21,6 @@
"x": 3, "x": 3,
"y": 0 "y": 0
}, },
{
"x": 7,
"y": 0
},
{ {
"x": 8, "x": 8,
"y": 0 "y": 0
@ -37,6 +33,10 @@
"x": 10, "x": 10,
"y": 0 "y": 0
}, },
{
"x": 11,
"y": 0
},
{ {
"x": 0, "x": 0,
"y": 1 "y": 1
@ -53,10 +53,6 @@
"x": 3, "x": 3,
"y": 1 "y": 1
}, },
{
"x": 7,
"y": 1
},
{ {
"x": 8, "x": 8,
"y": 1 "y": 1
@ -69,13 +65,33 @@
"x": 10, "x": 10,
"y": 1 "y": 1
}, },
{
"x": 11,
"y": 1
},
{ {
"x": 4, "x": 4,
"y": 2 "y": 2
}, },
{ {
"x": 6, "x": 7,
"y": 2 "y": 2
},
{
"x": 3.5,
"y": 3.25
},
{
"x": 4.5,
"y": 3.25
},
{
"x": 6.5,
"y": 3.25
},
{
"x": 7.5,
"y": 3.25
} }
] ]
} }

View File

@ -16,15 +16,15 @@
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LAYOUT( LAYOUT(
LT(1, KC_ESC), KC_Q, KC_W, KC_E, KC_Y, KC_U, KC_I, KC_O, LT(1, KC_ESC), KC_Q, KC_W, KC_E, KC_Y, KC_U, KC_I, KC_O,
KC_LSFT, KC_A, KC_S, KC_D, KC_SPC, KC_TAB, KC_H, KC_J, KC_K, KC_L KC_LSFT, KC_A, KC_S, KC_D, KC_SPC, KC_TAB, KC_H, KC_J, KC_K, KC_L,
KC_WH_U, KC_WH_D, KC_WH_U, KC_WH_D
), ),
LAYOUT( LAYOUT(
KC_TRNS, RGB_MOD, RGB_HUI, RGB_SAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_MOD, RGB_HUI, RGB_SAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, RGB_M_P, RGB_M_K, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS KC_TRNS, RGB_M_P, RGB_M_K, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_WH_L, KC_WH_R, KC_WH_L, KC_WH_R
) )
}; };

View File

@ -17,4 +17,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once #pragma once
#define DYNAMIC_KEYMAP_LAYER_COUNT 16 #define DYNAMIC_KEYMAP_LAYER_COUNT 12

View File

@ -16,15 +16,15 @@
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LAYOUT( LAYOUT(
LT(1, KC_ESC), KC_Q, KC_W, KC_E, KC_Y, KC_U, KC_I, KC_O, LT(1, KC_ESC), KC_Q, KC_W, KC_E, KC_Y, KC_U, KC_I, KC_O,
KC_LSFT, KC_A, KC_S, KC_D, KC_SPC, KC_TAB, KC_H, KC_J, KC_K, KC_L KC_LSFT, KC_A, KC_S, KC_D, KC_SPC, KC_TAB, KC_H, KC_J, KC_K, KC_L,
KC_WH_U, KC_WH_D, KC_WH_U, KC_WH_D
), ),
LAYOUT( LAYOUT(
KC_TRNS, RGB_MOD, RGB_HUI, RGB_SAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_MOD, RGB_HUI, RGB_SAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, RGB_M_P, RGB_M_K, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS KC_TRNS, RGB_M_P, RGB_M_K, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_WH_L, KC_WH_R, KC_WH_L, KC_WH_R
) )
}; };

View File

@ -19,3 +19,4 @@ AUDIO_ENABLE = no # Audio output
ENCODER_ENABLE = yes ENCODER_ENABLE = yes
SPLIT_KEYBOARD = yes SPLIT_KEYBOARD = yes
MOUSEKEY_ENABLE = yes