diff options
-rw-r--r-- | keyboards/hub20/config.h | 76 | ||||
-rw-r--r-- | keyboards/hub20/hub20.c | 155 | ||||
-rw-r--r-- | keyboards/hub20/hub20.h | 90 | ||||
-rw-r--r-- | keyboards/hub20/info.json | 50 | ||||
-rw-r--r-- | keyboards/hub20/keymaps/left_hand_numpad/keymap.c | 61 | ||||
-rw-r--r-- | keyboards/hub20/keymaps/right_hand_numpad/keymap.c | 66 | ||||
-rw-r--r-- | keyboards/hub20/rules.mk | 8 |
7 files changed, 478 insertions, 28 deletions
diff --git a/keyboards/hub20/config.h b/keyboards/hub20/config.h index 8ebe1f9e2..f8e5d6be8 100644 --- a/keyboards/hub20/config.h +++ b/keyboards/hub20/config.h | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | Copyright 2020 joshajohnson | 2 | Copyright 2020 joshajohnson |
3 | Copyright 2021 peepeetee | ||
3 | 4 | ||
4 | This program is free software: you can redistribute it and/or modify | 5 | This program is free software: you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
@@ -41,29 +42,56 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
41 | 42 | ||
42 | #define RGB_DI_PIN B15 | 43 | #define RGB_DI_PIN B15 |
43 | #define RGBLED_NUM 27 | 44 | #define RGBLED_NUM 27 |
44 | #define RGBLIGHT_HUE_STEP 8 | 45 | |
45 | #define RGBLIGHT_SAT_STEP 8 | 46 | #define DRIVER_LED_TOTAL 27 |
46 | #define RGBLIGHT_VAL_STEP 8 | 47 | #ifdef RGB_DI_PIN |
47 | #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ | 48 | #define RGBLED_NUM 27 |
48 | #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ | 49 | #endif |
49 | // /*== all animations enable ==*/ | 50 | |
50 | #define RGBLIGHT_ANIMATIONS | 51 | #define RGB_MATRIX_FRAMEBUFFER_EFFECTS |
51 | // /*== or choose animations ==*/ | 52 | #define RGB_MATRIX_KEYPRESSES |
52 | // #define RGBLIGHT_EFFECT_BREATHING | 53 | |
53 | // #define RGBLIGHT_EFFECT_RAINBOW_MOOD | 54 | // This list in in the correct mode order. Next mode is the following line, previous mode is previous line. Loops around. |
54 | // #define RGBLIGHT_EFFECT_RAINBOW_SWIRL | 55 | // #define DISABLE_RGB_MATRIX_SOLID_COLOR // Static single hue, no speed support |
55 | // #define RGBLIGHT_EFFECT_SNAKE | 56 | #define DISABLE_RGB_MATRIX_ALPHAS_MODS // Static dual hue, speed is hue for secondary hue |
56 | // #define RGBLIGHT_EFFECT_KNIGHT | 57 | //#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN // Static gradient top to bottom, speed controls how much gradient changes |
57 | // #define RGBLIGHT_EFFECT_CHRISTMAS | 58 | //#define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT // Static gradient top to bottom, speed controls how much gradient changes |
58 | // #define RGBLIGHT_EFFECT_STATIC_GRADIENT | 59 | //#define DISABLE_RGB_MATRIX_BREATHING // Single hue brightness cycling animation |
59 | // #define RGBLIGHT_EFFECT_RGB_TEST | 60 | #define DISABLE_RGB_MATRIX_BAND_SAT // Single hue band fading saturation scrolling left to right |
60 | // #define RGBLIGHT_EFFECT_ALTERNATING | 61 | #define DISABLE_RGB_MATRIX_BAND_VAL // Single hue band fading brightness scrolling left to right |
61 | // /*== customize breathing effect ==*/ | 62 | #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT // Single hue 3 blade spinning pinwheel fades saturation |
62 | // /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ | 63 | #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL // Single hue 3 blade spinning pinwheel fades brightness |
63 | // #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 | 64 | #define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT // Single hue spinning spiral fades saturation |
64 | // /*==== use exp() and sin() ====*/ | 65 | #define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL // Single hue spinning spiral fades brightness |
65 | // #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 | 66 | #define DISABLE_RGB_MATRIX_CYCLE_ALL // Full keyboard solid hue cycling through full gradient |
66 | // #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 | 67 | //#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT // Full gradient scrolling left to right |
68 | //#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN // Full gradient scrolling top to bottom | ||
69 | #define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Full gradent Chevron shapped scrolling left to right | ||
70 | #define DISABLE_RGB_MATRIX_CYCLE_OUT_IN // Full gradient scrolling out to in | ||
71 | #define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL // Full dual gradients scrolling out to in | ||
72 | #define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL // Full gradient spinning pinwheel around center of keyboard | ||
73 | #define DISABLE_RGB_MATRIX_CYCLE_SPIRAL // Full gradient spinning spiral around center of keyboard | ||
74 | #define DISABLE_RGB_MATRIX_DUAL_BEACON // Full gradient spinning around center of keyboard | ||
75 | #define DISABLE_RGB_MATRIX_RAINBOW_BEACON // Full tighter gradient spinning around center of keyboard | ||
76 | #define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS // Full dual gradients spinning two halfs of keyboard | ||
77 | //#define DISABLE_RGB_MATRIX_RAINDROPS // Randomly changes a single key's hue | ||
78 | //#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS // Randomly changes a single key's hue and saturation | ||
79 | // =================================================== Requires RGB_MATRIX_FRAMEBUFFER_EFFECTS ============================================================= | ||
80 | // #define DISABLE_RGB_MATRIX_TYPING_HEATMAP // How hot is your WPM! | ||
81 | //#define DISABLE_RGB_MATRIX_DIGITAL_RAIN // That famous computer simulation | ||
82 | // =================================================== RGB_MATRIX_KEYPRESSES OR RGB_MATRIX_KEYRELEASES ===================================================== | ||
83 | //#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE // Pulses keys hit to hue & value then fades value out | ||
84 | //#define DISABLE_RGB_MATRIX_SOLID_REACTIVE // Static single hue, pulses keys hit to shifted hue then fades to current hue | ||
85 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse near a single key hit then fades value out | ||
86 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE // Hue & value pulse near multiple key hits then fades value out | ||
87 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS // Hue & value pulse the same column and row of a single key hit then fades value out | ||
88 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS // Hue & value pulse the same column and row of multiple key hits then fades value out | ||
89 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS // Hue & value pulse away on the same column and row of a single key hit then fades value out | ||
90 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS // Hue & value pulse away on the same column and row of multiple key hits then fades value out | ||
91 | #define DISABLE_RGB_MATRIX_SPLASH // Full gradient & value pulse away from a single key hit then fades value out | ||
92 | #define DISABLE_RGB_MATRIX_MULTISPLASH // Full gradient & value pulse away from multiple key hits then fades value out | ||
93 | #define DISABLE_RGB_MATRIX_SOLID_SPLASH // Hue & value pulse away from a single key hit then fades value out | ||
94 | #define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH // Hue & value pulse away from multiple key hits then fades value out | ||
67 | 95 | ||
68 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | 96 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ |
69 | #define DEBOUNCE 5 | 97 | #define DEBOUNCE 5 |
diff --git a/keyboards/hub20/hub20.c b/keyboards/hub20/hub20.c index 306ab788d..f7171c521 100644 --- a/keyboards/hub20/hub20.c +++ b/keyboards/hub20/hub20.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* Copyright 2020 joshajohnson | 1 | /* Copyright 2020 joshajohnson 2021 peepeetee |
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 |
@@ -16,3 +16,156 @@ | |||
16 | 16 | ||
17 | #include "hub20.h" | 17 | #include "hub20.h" |
18 | 18 | ||
19 | |||
20 | #ifdef RGB_MATRIX_ENABLE | ||
21 | led_config_t g_led_config = { { | ||
22 | // Key Matrix to LED Index | ||
23 | {NO_LED,NO_LED,NO_LED,NO_LED}, | ||
24 | { 7, 8, 9, 10}, | ||
25 | { 11, 12, 13, 14}, | ||
26 | { 15, 16, 17, 18}, | ||
27 | { 19, 20, 21, 22}, | ||
28 | { 23, 24, 25, 26} | ||
29 | //todo: assign leds to keys differently for the different layouts | ||
30 | }, { | ||
31 | // LED Index to Physical Position | ||
32 | { 190, 50}, { 111, 50}, { 35, 50}, {38, 0}, {38, 35}, {186, 35}, {186, 0}, // UNDERGLOW | ||
33 | //todo: underglow location needs to be recalculated. The top row is above row 4, and for now they have the same y value 0 | ||
34 | { 0, 0}, {75, 0}, {150, 0}, {225, 0}, // row 4 | ||
35 | { 0, 16}, {75, 16}, {150, 16}, {225, 16}, // row 3 | ||
36 | { 0, 32}, {75, 32}, {150, 32}, {225, 32}, // row 2 | ||
37 | { 0, 48}, {75, 48}, {150, 48}, {225, 48}, // row 1 | ||
38 | { 0, 64}, {75, 64}, {150, 64}, {225, 64} // row 0 | ||
39 | |||
40 | }, { | ||
41 | // LED Index to Flag | ||
42 | LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, // UNDERGLOW | ||
43 | LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // row 4 | ||
44 | LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // row 3 | ||
45 | LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // row 2 | ||
46 | LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // row 1 | ||
47 | LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT // row 0 | ||
48 | |||
49 | } }; | ||
50 | #endif | ||
51 | |||
52 | |||
53 | |||
54 | // #if LED_MERGE_NUMPAD_LEFT_HANDED_ENTER && LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO | ||
55 | // #error lower left enter conflicts with lower left zero | ||
56 | // #endif | ||
57 | |||
58 | // #if LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER && LED_MERGE_NUMPAD_LEFT_HANDED_ZERO | ||
59 | // #error lower right enter conflicts with lower right zero | ||
60 | // #endif | ||
61 | |||
62 | // /* LAYOUT_left_handed | ||
63 | |||
64 | |||
65 | // * ┌───┬───┐ | ||
66 | // * │01 │02 │ | ||
67 | // * ┌───┼───┼───┼───┐ | ||
68 | // * │10 │11 │12 │13 │ | ||
69 | // * ├───┼───┼───┼───┤ | ||
70 | // * │ │21 │22 │23 │ | ||
71 | // * │20 ├───┼───┼───┤ | ||
72 | // * │ │31 │32 │33 │ | ||
73 | // * ├───┼───┼───┼───┤ | ||
74 | // * │ │41 │42 │43 │ | ||
75 | // * │40 ├───┼───┴───┤ | ||
76 | // * │ │51 │ 52 │ | ||
77 | // * └───┴───┴───────┘ | ||
78 | // */ | ||
79 | |||
80 | // #ifndef LED_MERGE_NUMPAD_LEFT_HANDED_PLUS //key 20 | ||
81 | // #define LED_MERGE_NUMPAD_LEFT_HANDED_PLUS FALSE | ||
82 | // #endif // LED_MERGE_NUMPAD_LEFT_HANDED_PLUS | ||
83 | |||
84 | // #ifndef LED_MERGE_NUMPAD_LEFT_HANDED_ENTER //key 40 | ||
85 | // #define LED_MERGE_NUMPAD_LEFT_HANDED_ENTER FALSE | ||
86 | // #endif // LED_MERGE_NUMPAD_LEFT_HANDED_ENTER | ||
87 | |||
88 | // #ifndef LED_MERGE_NUMPAD_LEFT_HANDED_ZERO //key 52 | ||
89 | // #define LED_MERGE_NUMPAD_LEFT_HANDED_ZERO FALSE | ||
90 | // #endif // LED_MERGE_NUMPAD_LEFT_HANDED_ZERO | ||
91 | |||
92 | |||
93 | // /* LAYOUT_right_handed | ||
94 | |||
95 | |||
96 | // * ┌───┬───┐ | ||
97 | // * │01 │02 │ | ||
98 | // * ┌───┼───┼───┼───┐ | ||
99 | // * │10 │11 │12 │13 │ | ||
100 | // * ├───┼───┼───┼───┤ | ||
101 | // * │20 │21 │22 │ │ | ||
102 | // * ├───┼───┼───┤23 │ | ||
103 | // * │30 │31 │32 │ │ | ||
104 | // * ├───┼───┼───┼───┤ | ||
105 | // * │40 │41 │42 │ │ | ||
106 | // * ├───┴───┼───┤43 │ | ||
107 | // * │ 50 │52 │ │ | ||
108 | // * └───────┴───┴───┘ | ||
109 | // */ | ||
110 | // //LOCATION OF bottom row 0 NOT TESTED, WAITING ENDORSEMENT FROM MANUFACTURER | ||
111 | |||
112 | // #ifndef LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS // key 23 | ||
113 | // #define LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS FALSE | ||
114 | // #endif // LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS | ||
115 | |||
116 | // #ifndef LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER // key 43 | ||
117 | // #define LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER FALSE | ||
118 | // #endif // LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER | ||
119 | |||
120 | // #ifndef LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO // key 50 (confirm with manufacturer) | ||
121 | // #define LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO FALSE | ||
122 | // #endif // LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO | ||
123 | |||
124 | // uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { | ||
125 | // // Keys here have 2 leds. Here we add the led that is not bound to the key | ||
126 | // // and the default led would be added | ||
127 | // // by the default code that runs after this in rgb_matrix_map_row_column_to_led | ||
128 | |||
129 | // uint8_t counter = 0; | ||
130 | |||
131 | // #if LED_MERGE_NUMPAD_LEFT_HANDED_PLUS //key 20, leds 7 and 11, 7 already bound | ||
132 | |||
133 | // if (row == 2 && column == 0) { | ||
134 | // led_i[counter] = 11; | ||
135 | // counter ++; | ||
136 | // } | ||
137 | // #endif | ||
138 | // #if LED_MERGE_NUMPAD_LEFT_HANDED_ENTER //key 40, leds 19 and 23, 23 already bound | ||
139 | // if (row == 4 && column == 0) { | ||
140 | // led_i[counter] = 23; | ||
141 | // counter ++; | ||
142 | // } | ||
143 | // #endif | ||
144 | // #if LED_MERGE_NUMPAD_LEFT_HANDED_ZERO //key 52, leds 25 and 26, 26 already bound | ||
145 | // if (row == 5 && column == 2) { | ||
146 | // led_i[counter] = 26; | ||
147 | // counter ++; | ||
148 | // } | ||
149 | // #endif | ||
150 | |||
151 | // #if LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS // key 23, led 14 and 18, 14 already bound | ||
152 | // if (row == 2 && column == 3) { | ||
153 | // led_i[counter] = 18; | ||
154 | // counter ++; | ||
155 | // } | ||
156 | // #endif | ||
157 | // #if LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER // key 43, led 22 and 26, 22 already bound | ||
158 | // if (row == 4 && column == 3) { | ||
159 | // led_i[counter] = 26; | ||
160 | // counter ++; | ||
161 | // } | ||
162 | // #endif | ||
163 | // #if LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO // key 50 (confirm with manufacturer) | ||
164 | // // LED 23 and 24, 23(?) already bound | ||
165 | // if (row == 5 && column == 0) { | ||
166 | // led_i[counter] = 24; | ||
167 | // counter ++; | ||
168 | // } | ||
169 | // #endif | ||
170 | // return counter; | ||
171 | // } | ||
diff --git a/keyboards/hub20/hub20.h b/keyboards/hub20/hub20.h index b4b1c7992..a86cc02c7 100644 --- a/keyboards/hub20/hub20.h +++ b/keyboards/hub20/hub20.h | |||
@@ -29,6 +29,24 @@ | |||
29 | * represents the switch matrix. | 29 | * represents the switch matrix. |
30 | */ | 30 | */ |
31 | 31 | ||
32 | |||
33 | /* LAYOUT_all | ||
34 | |||
35 | |||
36 | * ┌───┬───┐ | ||
37 | * │01 │02 │ | ||
38 | * ┌───┼───┼───┼───┐ | ||
39 | * │10 │11 │12 │13 │ | ||
40 | * ├───┼───┼───┼───┤ | ||
41 | * │20 │21 │22 │23 │ | ||
42 | * ├───┼───┼───┼───┤ | ||
43 | * │30 │31 │32 │33 │ | ||
44 | * ├───┼───┼───┼───┤ | ||
45 | * │40 │41 │42 │43 │ | ||
46 | * ├───┼───┼───┼───┤ | ||
47 | * │50 │51 │52 │53 │ | ||
48 | * └───┴───┴───┴───┘ | ||
49 | */ | ||
32 | #define LAYOUT_all( \ | 50 | #define LAYOUT_all( \ |
33 | K01, K02, \ | 51 | K01, K02, \ |
34 | K10, K11, K12, K13, \ | 52 | K10, K11, K12, K13, \ |
@@ -45,3 +63,75 @@ | |||
45 | { K40, K41, K42, K43, }, \ | 63 | { K40, K41, K42, K43, }, \ |
46 | { K50, K51, K52, K53, }, \ | 64 | { K50, K51, K52, K53, }, \ |
47 | } | 65 | } |
66 | |||
67 | /* LAYOUT_left_handed | ||
68 | |||
69 | |||
70 | * ┌───┬───┐ | ||
71 | * │01 │02 │ | ||
72 | * ┌───┼───┼───┼───┐ | ||
73 | * │10 │11 │12 │13 │ | ||
74 | * ├───┼───┼───┼───┤ | ||
75 | * │ │21 │22 │23 │ | ||
76 | * │20 ├───┼───┼───┤ | ||
77 | * │ │31 │32 │33 │ | ||
78 | * ├───┼───┼───┼───┤ | ||
79 | * │ │41 │42 │43 │ | ||
80 | * │40 ├───┼───┴───┤ | ||
81 | * │ │51 │ 52 │ | ||
82 | * └───┴───┴───────┘ | ||
83 | */ | ||
84 | #define LAYOUT_left_handed( \ | ||
85 | K01, K02, \ | ||
86 | K10, K11, K12, K13, \ | ||
87 | K21, K22, K23, \ | ||
88 | K20, K31, K32, K33, \ | ||
89 | K41, K42, K43, \ | ||
90 | K40, K51, K52 \ | ||
91 | ) \ | ||
92 | { \ | ||
93 | { ___, K01, K02, ___, }, \ | ||
94 | { K10, K11, K12, K13, }, \ | ||
95 | { K20, K21, K22, K23, }, \ | ||
96 | { ___, K31, K32, K33, }, \ | ||
97 | { K40, K41, K42, K43, }, \ | ||
98 | { ___, K51, K52, ___, }, \ | ||
99 | } | ||
100 | |||
101 | |||
102 | /* LAYOUT_right_handed | ||
103 | |||
104 | |||
105 | * ┌───┬───┐ | ||
106 | * │01 │02 │ | ||
107 | * ┌───┼───┼───┼───┐ | ||
108 | * │10 │11 │12 │13 │ | ||
109 | * ├───┼───┼───┼───┤ | ||
110 | * │20 │21 │22 │ │ | ||
111 | * ├───┼───┼───┤23 │ | ||
112 | * │30 │31 │32 │ │ | ||
113 | * ├───┼───┼───┼───┤ | ||
114 | * │40 │41 │42 │ │ | ||
115 | * ├───┴───┼───┤43 │ | ||
116 | * │ 50(not sure, confirm) │52 │ │ | ||
117 | * └───────┴───┴───┘ | ||
118 | */ | ||
119 | //NOT TESTED, WAITING ENDORSEMENT FROM MANUFACTURER | ||
120 | #define LAYOUT_right_handed( \ | ||
121 | K01, K02, \ | ||
122 | K10, K11, K12, K13, \ | ||
123 | K20, K21, K22, \ | ||
124 | K30, K31, K32, K23, \ | ||
125 | K40, K41, K42, \ | ||
126 | K50, K52, K43 \ | ||
127 | ) \ | ||
128 | { \ | ||
129 | { ___, K01, K02, ___, }, \ | ||
130 | { K10, K11, K12, K13, }, \ | ||
131 | { K20, K21, K22, K23, }, \ | ||
132 | { K30, K31, K32, ___, }, \ | ||
133 | { K40, K41, K42, K43, }, \ | ||
134 | { K50, ___, K52, ___, }, \ | ||
135 | } | ||
136 | |||
137 | |||
diff --git a/keyboards/hub20/info.json b/keyboards/hub20/info.json index d60212c27..d58294ffb 100644 --- a/keyboards/hub20/info.json +++ b/keyboards/hub20/info.json | |||
@@ -30,6 +30,56 @@ | |||
30 | {"label":"0", "x":2, "y":5}, | 30 | {"label":"0", "x":2, "y":5}, |
31 | {"label":"0", "x":3, "y":5} | 31 | {"label":"0", "x":3, "y":5} |
32 | ] | 32 | ] |
33 | }, | ||
34 | "LAYOUT_left_handed": { | ||
35 | "layout": [ | ||
36 | {"label":"Mute", "x":0.5, "y":0}, | ||
37 | {"label":"Play / Pause", "x":2.5, "y":0}, | ||
38 | {"label":"-", "x":0, "y":1}, | ||
39 | {"label":"*", "x":1, "y":1}, | ||
40 | {"label":"/", "x":2, "y":1}, | ||
41 | {"label":"Numlock", "x":3, "y":1}, | ||
42 | {"label":"7", "x":1, "y":2}, | ||
43 | {"label":"8", "x":2, "y":2}, | ||
44 | {"label":"9", "x":3, "y":2}, | ||
45 | {"label":"+", "x":0, "y":2, "h":2}, | ||
46 | {"label":"4", "x":1, "y":3}, | ||
47 | {"label":"5", "x":2, "y":3}, | ||
48 | {"label":"6", "x":3, "y":3}, | ||
49 | {"label":"Enter", "x":0, "y":4, "h":2}, | ||
50 | {"label":"1", "x":1, "y":4}, | ||
51 | {"label":"2", "x":2, "y":4}, | ||
52 | {"label":"3", "x":3, "y":4}, | ||
53 | {"label":".", "x":1, "y":5}, | ||
54 | {"label":"0", "x":3, "y":5, "w":2} | ||
55 | ] | ||
56 | }, | ||
57 | "LAYOUT_right_handed": { | ||
58 | "layout": [ | ||
59 | {"label":"Mute", "x":0.5, "y":0}, | ||
60 | {"label":"Play / Pause", "x":2.5, "y":0}, | ||
61 | {"label":"Numlock", "x":0, "y":1}, | ||
62 | {"label":"/", "x":1, "y":1}, | ||
63 | {"label":"*", "x":2, "y":1}, | ||
64 | {"label":"-", "x":3, "y":1}, | ||
65 | |||
66 | {"label":"7", "x":0, "y":2}, | ||
67 | {"label":"8", "x":1, "y":2}, | ||
68 | {"label":"9", "x":2, "y":2}, | ||
69 | |||
70 | {"label":"4", "x":0, "y":3}, | ||
71 | {"label":"5", "x":1, "y":3}, | ||
72 | {"label":"6", "x":2, "y":3}, | ||
73 | {"label":"+", "x":3, "y":2, "h":2}, | ||
74 | |||
75 | {"label":"1", "x":0, "y":4}, | ||
76 | {"label":"2", "x":1, "y":4}, | ||
77 | {"label":"3", "x":2, "y":4}, | ||
78 | |||
79 | {"label":"0", "x":0, "y":5, "w":2}, | ||
80 | {"label":".", "x":2, "y":5}, | ||
81 | {"label":"Enter", "x":3, "y":4, "h":2} | ||
82 | ] | ||
33 | } | 83 | } |
34 | } | 84 | } |
35 | } | 85 | } |
diff --git a/keyboards/hub20/keymaps/left_hand_numpad/keymap.c b/keyboards/hub20/keymaps/left_hand_numpad/keymap.c new file mode 100644 index 000000000..395ebc15b --- /dev/null +++ b/keyboards/hub20/keymaps/left_hand_numpad/keymap.c | |||
@@ -0,0 +1,61 @@ | |||
1 | /* Copyright 2020 joshajohnson 2021 peepeetee | ||
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 | |||
19 | |||
20 | // #define LED_MERGE_NUMPAD_LEFT_HANDED_PLUS TRUE | ||
21 | // #define LED_MERGE_NUMPAD_LEFT_HANDED_ENTER TRUE | ||
22 | // #define LED_MERGE_NUMPAD_LEFT_HANDED_ZERO TRUE | ||
23 | |||
24 | |||
25 | #define MO_NLCK LT(1, KC_NLCK) // Numlock on tap, layer change on hold | ||
26 | |||
27 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
28 | [0] = LAYOUT_left_handed( | ||
29 | KC_MUTE, KC_MPLY, | ||
30 | KC_PMNS, KC_PAST, KC_PSLS, MO_NLCK, | ||
31 | KC_P7, KC_P8, KC_P9, | ||
32 | KC_PPLS, KC_P4, KC_P5, KC_P6, | ||
33 | KC_P1, KC_P2, KC_P3, | ||
34 | KC_PENT, KC_PDOT, KC_P0 | ||
35 | ), | ||
36 | [1] = LAYOUT_left_handed( | ||
37 | RESET, _______, | ||
38 | RGB_TOG, RGB_RMOD, RGB_MOD, _______, | ||
39 | _______, RGB_VAD, RGB_VAI, _______, | ||
40 | RGB_HUD, RGB_HUI, _______, | ||
41 | _______, RGB_SAD, RGB_SAI, _______, | ||
42 | _______, _______ | ||
43 | ) | ||
44 | }; | ||
45 | |||
46 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
47 | if (index == 0) { /* Left Encoder */ | ||
48 | if (clockwise) { | ||
49 | tap_code(KC_VOLU); | ||
50 | } else { | ||
51 | tap_code(KC_VOLD); | ||
52 | } | ||
53 | } else if (index == 1) { /* Right Encoder */ | ||
54 | if (clockwise) { | ||
55 | tap_code(KC_MNXT); | ||
56 | } else { | ||
57 | tap_code(KC_MPRV); | ||
58 | } | ||
59 | } | ||
60 | } | ||
61 | |||
diff --git a/keyboards/hub20/keymaps/right_hand_numpad/keymap.c b/keyboards/hub20/keymaps/right_hand_numpad/keymap.c new file mode 100644 index 000000000..89466d31b --- /dev/null +++ b/keyboards/hub20/keymaps/right_hand_numpad/keymap.c | |||
@@ -0,0 +1,66 @@ | |||
1 | /* Copyright 2021 peepeetee | ||
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 | |||
19 | |||
20 | // #define LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS TRUE | ||
21 | // #define LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER TRUE | ||
22 | // #define LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO TRUE | ||
23 | |||
24 | |||
25 | #define MO_NLCK LT(1, KC_NLCK) // Numlock on tap, layer change on hold | ||
26 | |||
27 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
28 | |||
29 | //NOT TESTED, WAITING ENDORSEMENT FROM MANUFACTURER | ||
30 | [0] = LAYOUT_right_handed( | ||
31 | KC_MUTE, KC_MPLY, | ||
32 | MO_NLCK, KC_PSLS, KC_PAST, KC_PMNS, | ||
33 | KC_P7, KC_P8, KC_P9, | ||
34 | KC_P4, KC_P5, KC_P6, KC_PPLS, | ||
35 | KC_P1, KC_P2, KC_P3, | ||
36 | KC_P0, KC_PDOT, KC_PENT | ||
37 | ), | ||
38 | [1] = LAYOUT_right_handed( | ||
39 | RESET, _______, | ||
40 | RGB_TOG, RGB_RMOD, RGB_MOD, _______, | ||
41 | _______, RGB_VAD, RGB_VAI, | ||
42 | _______, RGB_HUD, RGB_HUI, _______, | ||
43 | _______, RGB_SAD, RGB_SAI, | ||
44 | _______, _______, _______ | ||
45 | ) | ||
46 | }; | ||
47 | |||
48 | |||
49 | |||
50 | |||
51 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
52 | if (index == 0) { /* Left Encoder */ | ||
53 | if (clockwise) { | ||
54 | tap_code(KC_VOLU); | ||
55 | } else { | ||
56 | tap_code(KC_VOLD); | ||
57 | } | ||
58 | } else if (index == 1) { /* Right Encoder */ | ||
59 | if (clockwise) { | ||
60 | tap_code(KC_MNXT); | ||
61 | } else { | ||
62 | tap_code(KC_MPRV); | ||
63 | } | ||
64 | } | ||
65 | } | ||
66 | |||
diff --git a/keyboards/hub20/rules.mk b/keyboards/hub20/rules.mk index 61d6ba1f5..59a4b8aa1 100644 --- a/keyboards/hub20/rules.mk +++ b/keyboards/hub20/rules.mk | |||
@@ -10,16 +10,18 @@ BOOTLOADER = stm32-dfu | |||
10 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration | 10 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration |
11 | MOUSEKEY_ENABLE = yes # Mouse keys | 11 | MOUSEKEY_ENABLE = yes # Mouse keys |
12 | EXTRAKEY_ENABLE = yes # Audio control and System control | 12 | EXTRAKEY_ENABLE = yes # Audio control and System control |
13 | CONSOLE_ENABLE = yes # Console for debug | 13 | CONSOLE_ENABLE = no # Console for debug |
14 | COMMAND_ENABLE = yes # Commands for debug and configuration | 14 | COMMAND_ENABLE = no # Commands for debug and configuration |
15 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | 15 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE |
16 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | 16 | SLEEP_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 | 17 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
18 | NKRO_ENABLE = yes # USB Nkey Rollover | 18 | NKRO_ENABLE = yes # USB Nkey Rollover |
19 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | 19 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality |
20 | RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow | 20 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow |
21 | BLUETOOTH_ENABLE = no # Enable Bluetooth | 21 | BLUETOOTH_ENABLE = no # Enable Bluetooth |
22 | AUDIO_ENABLE = no # Audio output | 22 | AUDIO_ENABLE = no # Audio output |
23 | RGB_MATRIX_ENABLE = yes | ||
24 | RGB_MATRIX_DRIVER = WS2812 | ||
23 | ENCODER_ENABLE = yes | 25 | ENCODER_ENABLE = yes |
24 | 26 | ||
25 | # Enter lower-power sleep mode when on the ChibiOS idle thread | 27 | # Enter lower-power sleep mode when on the ChibiOS idle thread |