From 198c6c426bc090ef449f566ac7a11dc39c114e4f Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 13 Jul 2025 00:45:46 +0530 Subject: [PATCH 1/9] [Keyboard] Add Shorty K1 macropad --- keyboards/hawtkeys/shortyk1/keyboard.json | 39 ++++++++ .../shortyk1/keymaps/default/config.h | 19 ++++ .../shortyk1/keymaps/default/keymap.c | 88 +++++++++++++++++++ .../shortyk1/keymaps/default/rules.mk | 7 ++ keyboards/hawtkeys/shortyk1/readme.md | 31 +++++++ 5 files changed, 184 insertions(+) create mode 100644 keyboards/hawtkeys/shortyk1/keyboard.json create mode 100644 keyboards/hawtkeys/shortyk1/keymaps/default/config.h create mode 100644 keyboards/hawtkeys/shortyk1/keymaps/default/keymap.c create mode 100644 keyboards/hawtkeys/shortyk1/keymaps/default/rules.mk create mode 100644 keyboards/hawtkeys/shortyk1/readme.md diff --git a/keyboards/hawtkeys/shortyk1/keyboard.json b/keyboards/hawtkeys/shortyk1/keyboard.json new file mode 100644 index 00000000000..2a675bc9151 --- /dev/null +++ b/keyboards/hawtkeys/shortyk1/keyboard.json @@ -0,0 +1,39 @@ +{ + "manufacturer": "Hawtkeys", + "keyboard_name": "Shorty K1", + "maintainer": "hawtkeys", + "bootloader": "rp2040", + "diode_direction": "ROW2COL", + "encoder": { + "rotary": [ + {"pin_a": "GP1", "pin_b": "GP2"} + ] + }, + "features": { + "bootmagic": true, + "encoder": true, + "extrakey": true, + "mousekey": true + }, + "matrix_pins": { + "cols": ["GP4"], + "rows": ["GP0", "GP3", "GP5", "GP11"] + }, + "processor": "RP2040", + "url": "https://hawtkeys.com", + "usb": { + "device_version": "1.0.0", + "pid": "0x6B31", + "vid": "0x5453" + }, + "layouts": { + "LAYOUT": { + "layout": [ + {"matrix": [0, 0], "x": 1, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [2, 0], "x": 1, "y": 1}, + {"matrix": [3, 0], "x": 2, "y": 1} + ] + } + } +} diff --git a/keyboards/hawtkeys/shortyk1/keymaps/default/config.h b/keyboards/hawtkeys/shortyk1/keymaps/default/config.h new file mode 100644 index 00000000000..e2c5d5b9409 --- /dev/null +++ b/keyboards/hawtkeys/shortyk1/keymaps/default/config.h @@ -0,0 +1,19 @@ +// Copyright 2025 Hawtkeys +// SPDX-License-Identifier: GPL-2.0-or-later +#define WS2812_DI_PIN GP10 +#define RGBLIGHT_LED_COUNT 3 +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_RAINBOW_MOOD +#define RGBLIGHT_EFFECT_RAINBOW_SWIRL +#define RGBLIGHT_EFFECT_SNAKE +#define RGBLIGHT_EFFECT_KNIGHT +#define RGBLIGHT_EFFECT_CHRISTMAS +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLIGHT_EFFECT_RGB_TEST +#define RGBLIGHT_EFFECT_ALTERNATING +#define RGBLIGHT_EFFECT_TWINKLE +#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_EFFECT_CHRISTMAS +#define RGBLIGHT_LAYERS +#define RGBLIGHT_MAX_LAYERS 4 +#define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF +#define RGBLIGHT_LAYER_BLINK \ No newline at end of file diff --git a/keyboards/hawtkeys/shortyk1/keymaps/default/keymap.c b/keyboards/hawtkeys/shortyk1/keymaps/default/keymap.c new file mode 100644 index 00000000000..91c425370ea --- /dev/null +++ b/keyboards/hawtkeys/shortyk1/keymaps/default/keymap.c @@ -0,0 +1,88 @@ +// Copyright 2025 Hawtkeys +// SPDX-License-Identifier: GPL-2.0-or-later +#include QMK_KEYBOARD_H +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + LT(0,KC_NO), + KC_A, KC_B, KC_C + ), + [1] = LAYOUT( + LT(0,KC_NO), + KC_1, KC_2, KC_3 + ), + [2] = LAYOUT( + LT(0,KC_NO), + KC_Q, KC_W, KC_E + ), + [3] = LAYOUT( + LT(0,KC_NO), + KC_R, KC_T, KC_Y + ) +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [2] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [3] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) } +}; +#endif + +#if defined(RGBLIGHT_LAYERS) +const rgblight_segment_t PROGMEM rgb_layer1_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 3, HSV_BLUE} +); +const rgblight_segment_t PROGMEM rgb_layer2_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {2, 1, HSV_YELLOW} +); +const rgblight_segment_t PROGMEM rgb_layer3_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {1, 1, HSV_GREEN} +); +const rgblight_segment_t PROGMEM rgb_layer4_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 1, HSV_PURPLE} +); + +const rgblight_segment_t* const PROGMEM all_rgb_layers[] = RGBLIGHT_LAYERS_LIST( + rgb_layer1_layer, + rgb_layer2_layer, + rgb_layer3_layer, + rgb_layer4_layer +); + +void keyboard_post_init_user(void) { + rgblight_layers = all_rgb_layers; +} +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case LT(0, KC_NO): + if (record->event.pressed) { + // on tap + if (record->tap.count) { + uint8_t layer = get_highest_layer(layer_state); + if (layer < 4){ + uint8_t next_layer = layer == 3 ? 0 : layer + 1; + bool was_enabled = rgblight_is_enabled(); + if (!was_enabled){ + rgblight_enable(); + } + rgblight_unblink_all_but_layer(next_layer); + rgblight_blink_layer_repeat(next_layer, 300, 2); + + if (!was_enabled){ + rgblight_disable(); + } + } + if (layer >= 3) { + layer_clear(); + } else { + layer_move(layer + 1); + } + } + } + return false; + } + return true; +} diff --git a/keyboards/hawtkeys/shortyk1/keymaps/default/rules.mk b/keyboards/hawtkeys/shortyk1/keymaps/default/rules.mk new file mode 100644 index 00000000000..b2a5a767d76 --- /dev/null +++ b/keyboards/hawtkeys/shortyk1/keymaps/default/rules.mk @@ -0,0 +1,7 @@ +ENCODER_ENABLE = yes +ENCODER_MAP_ENABLE = yes +LEADER_ENABLE = yes +REPEAT_KEY_ENABLE = yes +RGBLIGHT_ENABLE = yes +WS2812_DRIVER_REQUIRED = yes +WS2812_DRIVER = vendor \ No newline at end of file diff --git a/keyboards/hawtkeys/shortyk1/readme.md b/keyboards/hawtkeys/shortyk1/readme.md new file mode 100644 index 00000000000..2f01b68cc5b --- /dev/null +++ b/keyboards/hawtkeys/shortyk1/readme.md @@ -0,0 +1,31 @@ +# Shorty K1 + +![Shorty K1 by hawtkeys.com](https://i.imgur.com/tGNq5H4.png) + +The Shorty K1 is a 3x1 customizable macropad designed for productivity, gaming, and creative workflows, featuring programmable keys and rotary knobs. + +* Keyboard Maintainer: [Hawtkeys](https://github.com/hawtkeys) +* Hardware Supported: Raspberry Pi Pico, Hawtkeys Shorty Zero PCB +* Hardware Availability: [Available @ hawtkeys.com](https://hawtkeys.com) + +Make example for this keyboard (after setting up your build environment): + + make hawtkeys/shortyk1:default + +Flashing example for this keyboard: + + make hawtkeys/shortyk1:default:flash + +See 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). + +## Remap Config + +* JSON schema reference: https://github.com/remap-keys/remap/blob/c0ef7ca3242883733b7c0a1b63a7b5407e16b62a/src/services/storage/assets/keyboard-definition-schema.json#L15 + +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available \ No newline at end of file From 046e2c4892fbf50bee1ecd9952ec721a86278b13 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 13 Jul 2025 00:54:52 +0530 Subject: [PATCH 2/9] Remove default RGB lighting mode from config --- keyboards/hawtkeys/shortyk1/keymaps/default/config.h | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/hawtkeys/shortyk1/keymaps/default/config.h b/keyboards/hawtkeys/shortyk1/keymaps/default/config.h index e2c5d5b9409..502313ec874 100644 --- a/keyboards/hawtkeys/shortyk1/keymaps/default/config.h +++ b/keyboards/hawtkeys/shortyk1/keymaps/default/config.h @@ -12,7 +12,6 @@ #define RGBLIGHT_EFFECT_RGB_TEST #define RGBLIGHT_EFFECT_ALTERNATING #define RGBLIGHT_EFFECT_TWINKLE -#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_EFFECT_CHRISTMAS #define RGBLIGHT_LAYERS #define RGBLIGHT_MAX_LAYERS 4 #define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF From 1b911ac6b52871b3d4690a2e4bf02282063b0dd2 Mon Sep 17 00:00:00 2001 From: Akshay <32840608+axshae@users.noreply.github.com> Date: Sun, 13 Jul 2025 01:17:14 +0530 Subject: [PATCH 3/9] Update keyboards/hawtkeys/shortyk1/keymaps/default/rules.mk Co-authored-by: Joel Challis --- keyboards/hawtkeys/shortyk1/keymaps/default/rules.mk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/keyboards/hawtkeys/shortyk1/keymaps/default/rules.mk b/keyboards/hawtkeys/shortyk1/keymaps/default/rules.mk index b2a5a767d76..ee325681483 100644 --- a/keyboards/hawtkeys/shortyk1/keymaps/default/rules.mk +++ b/keyboards/hawtkeys/shortyk1/keymaps/default/rules.mk @@ -1,7 +1 @@ -ENCODER_ENABLE = yes ENCODER_MAP_ENABLE = yes -LEADER_ENABLE = yes -REPEAT_KEY_ENABLE = yes -RGBLIGHT_ENABLE = yes -WS2812_DRIVER_REQUIRED = yes -WS2812_DRIVER = vendor \ No newline at end of file From 2151b8af82f344c39a8ce7ad749a4aab27ae9090 Mon Sep 17 00:00:00 2001 From: Akshay <32840608+axshae@users.noreply.github.com> Date: Sun, 13 Jul 2025 01:17:25 +0530 Subject: [PATCH 4/9] Update keyboards/hawtkeys/shortyk1/readme.md Co-authored-by: Joel Challis --- keyboards/hawtkeys/shortyk1/readme.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/keyboards/hawtkeys/shortyk1/readme.md b/keyboards/hawtkeys/shortyk1/readme.md index 2f01b68cc5b..cf9e79cfc76 100644 --- a/keyboards/hawtkeys/shortyk1/readme.md +++ b/keyboards/hawtkeys/shortyk1/readme.md @@ -18,10 +18,6 @@ Flashing example for this keyboard: See 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). -## Remap Config - -* JSON schema reference: https://github.com/remap-keys/remap/blob/c0ef7ca3242883733b7c0a1b63a7b5407e16b62a/src/services/storage/assets/keyboard-definition-schema.json#L15 - ## Bootloader Enter the bootloader in 3 ways: From ce747cb52b74379aee4a03442230b66d44f81ec5 Mon Sep 17 00:00:00 2001 From: Akshay <32840608+axshae@users.noreply.github.com> Date: Sun, 13 Jul 2025 01:17:49 +0530 Subject: [PATCH 5/9] Update keyboards/hawtkeys/shortyk1/keymaps/default/config.h Co-authored-by: Joel Challis --- .../hawtkeys/shortyk1/keymaps/default/config.h | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/keyboards/hawtkeys/shortyk1/keymaps/default/config.h b/keyboards/hawtkeys/shortyk1/keymaps/default/config.h index 502313ec874..bfd4c9e2449 100644 --- a/keyboards/hawtkeys/shortyk1/keymaps/default/config.h +++ b/keyboards/hawtkeys/shortyk1/keymaps/default/config.h @@ -1,18 +1,8 @@ // Copyright 2025 Hawtkeys // SPDX-License-Identifier: GPL-2.0-or-later -#define WS2812_DI_PIN GP10 -#define RGBLIGHT_LED_COUNT 3 -#define RGBLIGHT_EFFECT_BREATHING -#define RGBLIGHT_EFFECT_RAINBOW_MOOD -#define RGBLIGHT_EFFECT_RAINBOW_SWIRL -#define RGBLIGHT_EFFECT_SNAKE -#define RGBLIGHT_EFFECT_KNIGHT -#define RGBLIGHT_EFFECT_CHRISTMAS -#define RGBLIGHT_EFFECT_STATIC_GRADIENT -#define RGBLIGHT_EFFECT_RGB_TEST -#define RGBLIGHT_EFFECT_ALTERNATING -#define RGBLIGHT_EFFECT_TWINKLE +#pragma once + #define RGBLIGHT_LAYERS #define RGBLIGHT_MAX_LAYERS 4 #define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF -#define RGBLIGHT_LAYER_BLINK \ No newline at end of file +#define RGBLIGHT_LAYER_BLINK From eafa43cf7446fc8a99609c637b2d764d6f5c2169 Mon Sep 17 00:00:00 2001 From: Akshay <32840608+axshae@users.noreply.github.com> Date: Sun, 13 Jul 2025 01:18:10 +0530 Subject: [PATCH 6/9] Update keyboards/hawtkeys/shortyk1/keyboard.json Co-authored-by: Joel Challis --- keyboards/hawtkeys/shortyk1/keyboard.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keyboards/hawtkeys/shortyk1/keyboard.json b/keyboards/hawtkeys/shortyk1/keyboard.json index 2a675bc9151..fd3bffcf9a3 100644 --- a/keyboards/hawtkeys/shortyk1/keyboard.json +++ b/keyboards/hawtkeys/shortyk1/keyboard.json @@ -13,7 +13,8 @@ "bootmagic": true, "encoder": true, "extrakey": true, - "mousekey": true + "mousekey": true, + "rgblight": true }, "matrix_pins": { "cols": ["GP4"], From 1a73d75316ede9b0598cb663297508596bad4299 Mon Sep 17 00:00:00 2001 From: Akshay <32840608+axshae@users.noreply.github.com> Date: Sun, 13 Jul 2025 01:18:45 +0530 Subject: [PATCH 7/9] Update keyboards/hawtkeys/shortyk1/keyboard.json Co-authored-by: Joel Challis --- keyboards/hawtkeys/shortyk1/keyboard.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/keyboards/hawtkeys/shortyk1/keyboard.json b/keyboards/hawtkeys/shortyk1/keyboard.json index fd3bffcf9a3..d52276604d0 100644 --- a/keyboards/hawtkeys/shortyk1/keyboard.json +++ b/keyboards/hawtkeys/shortyk1/keyboard.json @@ -27,6 +27,25 @@ "pid": "0x6B31", "vid": "0x5453" }, + "rgblight": { + "led_count": 3, + "animations": { + "breathing": true, + "rainbow_mood": true, + "rainbow_swirl": true, + "snake": true, + "knight": true, + "christmas": true, + "static_gradient": true, + "rgb_test": true, + "alternating": true, + "twinkle": true + } + }, + "ws2812": { + "driver": "vendor", + "pin": "GP10" + }, "layouts": { "LAYOUT": { "layout": [ From 368ba1b6aa9248366a2e1f2488379f3351585c8a Mon Sep 17 00:00:00 2001 From: Akshay <32840608+axshae@users.noreply.github.com> Date: Mon, 14 Jul 2025 02:10:01 +0530 Subject: [PATCH 8/9] Apply suggestions from code review Co-authored-by: Drashna Jaelre Co-authored-by: Joel Challis --- keyboards/hawtkeys/shortyk1/keyboard.json | 1 - .../shortyk1/keymaps/default/keymap.c | 19 ++++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/keyboards/hawtkeys/shortyk1/keyboard.json b/keyboards/hawtkeys/shortyk1/keyboard.json index d52276604d0..f713067b722 100644 --- a/keyboards/hawtkeys/shortyk1/keyboard.json +++ b/keyboards/hawtkeys/shortyk1/keyboard.json @@ -37,7 +37,6 @@ "knight": true, "christmas": true, "static_gradient": true, - "rgb_test": true, "alternating": true, "twinkle": true } diff --git a/keyboards/hawtkeys/shortyk1/keymaps/default/keymap.c b/keyboards/hawtkeys/shortyk1/keymaps/default/keymap.c index 91c425370ea..c34afa53644 100644 --- a/keyboards/hawtkeys/shortyk1/keymaps/default/keymap.c +++ b/keyboards/hawtkeys/shortyk1/keymaps/default/keymap.c @@ -1,21 +1,26 @@ // Copyright 2025 Hawtkeys // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H + +enum custom_keycodes { + LAYER_ROTATE = SAFE_RANGE, +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( - LT(0,KC_NO), + LAYER_ROTATE, KC_A, KC_B, KC_C ), [1] = LAYOUT( - LT(0,KC_NO), + LAYER_ROTATE, KC_1, KC_2, KC_3 ), [2] = LAYOUT( - LT(0,KC_NO), + LAYER_ROTATE, KC_Q, KC_W, KC_E ), [3] = LAYOUT( - LT(0,KC_NO), + LAYER_ROTATE, KC_R, KC_T, KC_Y ) }; @@ -23,9 +28,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { #if defined(ENCODER_MAP_ENABLE) const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, - [1] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, - [2] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, - [3] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) } + [1] = { ENCODER_CCW_CW(_______, _______) }, + [2] = { ENCODER_CCW_CW(_______, _______) }, + [3] = { ENCODER_CCW_CW(_______, _______) } }; #endif From fa2522deb31943582ddc5766d080d2b2eda04114 Mon Sep 17 00:00:00 2001 From: Akshay <32840608+axshae@users.noreply.github.com> Date: Mon, 14 Jul 2025 16:08:02 +0530 Subject: [PATCH 9/9] Update keyboards/hawtkeys/shortyk1/keymaps/default/keymap.c Co-authored-by: Joel Challis --- .../shortyk1/keymaps/default/keymap.c | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/keyboards/hawtkeys/shortyk1/keymaps/default/keymap.c b/keyboards/hawtkeys/shortyk1/keymaps/default/keymap.c index c34afa53644..1210a4f3c17 100644 --- a/keyboards/hawtkeys/shortyk1/keymaps/default/keymap.c +++ b/keyboards/hawtkeys/shortyk1/keymaps/default/keymap.c @@ -62,30 +62,16 @@ void keyboard_post_init_user(void) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch(keycode) { - case LT(0, KC_NO): + case LAYER_ROTATE: if (record->event.pressed) { - // on tap - if (record->tap.count) { - uint8_t layer = get_highest_layer(layer_state); - if (layer < 4){ - uint8_t next_layer = layer == 3 ? 0 : layer + 1; - bool was_enabled = rgblight_is_enabled(); - if (!was_enabled){ - rgblight_enable(); - } - rgblight_unblink_all_but_layer(next_layer); - rgblight_blink_layer_repeat(next_layer, 300, 2); + uint8_t layer = get_highest_layer(layer_state); - if (!was_enabled){ - rgblight_disable(); - } - } - if (layer >= 3) { - layer_clear(); - } else { - layer_move(layer + 1); - } - } + uint8_t next_layer = layer >= 3 ? 0 : layer + 1; + + rgblight_unblink_all_but_layer(next_layer); + rgblight_blink_layer_repeat(next_layer, 300, 2); + + layer_move(next_layer); } return false; }