diff --git a/keyboards/treasure/type30/keyboard.json b/keyboards/treasure/type30/keyboard.json new file mode 100644 index 00000000000..a2b09f5d3ea --- /dev/null +++ b/keyboards/treasure/type30/keyboard.json @@ -0,0 +1,138 @@ +{ + "manufacturer": "TREASURE", + "keyboard_name": "TYPE30", + "maintainer": "TREASURE", + "processor": "atmega32u2", + "bootloader": "atmel-dfu", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "command": false, + "console": false, + "extrakey": true, + "mousekey": false, + "nkro": true, + "rgb_matrix": true + }, + "combo": { + "term": 150 + }, + "matrix_pins": { + "cols": ["B5", "B6", "B7", "C7", "C6", "C4", "D4", "D5", "D6", "B0", "B1", "B2"], + "rows": ["D2", "C5", "B3"] + }, + "build": { + "lto": true + }, + "usb": { + "device_version": "1.0.0", + "pid": "0x0001", + "vid": "0xFEED" + }, + "ws2812": { + "pin": "B4" + }, + "rgblight": { + "led_count": 36 + }, + "rgb_matrix": { + "driver": "ws2812", + "speed": 40, + "max_brightness": 180, + "sleep": true, + "animations": { + "gradient_up_down": true, + "gradient_left_right": true, + "breathing": true, + "cycle_left_right": true, + "cycle_up_down": true, + "rainbow_pinwheels": true, + "jellybean_raindrops": true, + "typing_heatmap": true + }, + "default": { + "animation": "gradient_left_right" + }, + "layout": [ + { "matrix": [2, 0],"flags": 4, "x": 0, "y": 20 }, + { "matrix": [2, 1],"flags": 4, "x": 10, "y": 20 }, + { "matrix": [2, 2],"flags": 4, "x": 20, "y": 20 }, + { "matrix": [2, 3],"flags": 4, "x": 30, "y": 20 }, + { "matrix": [2, 4],"flags": 4, "x": 40, "y": 20 }, + { "matrix": [2, 5],"flags": 4, "x": 50, "y": 20 }, + { "matrix": [2, 6],"flags": 4, "x": 60, "y": 20 }, + { "matrix": [2, 7],"flags": 4, "x": 70, "y": 20 }, + { "matrix": [2, 8],"flags": 4, "x": 80, "y": 20 }, + { "matrix": [2, 9],"flags": 4, "x": 90, "y": 20 }, + { "matrix": [2, 10],"flags": 4, "x": 100, "y": 20 }, + { "matrix": [2, 11],"flags": 4, "x": 110, "y": 20 }, + { "matrix": [1, 11],"flags": 4, "x": 110, "y": 10 }, + { "matrix": [1, 10],"flags": 4, "x": 100, "y": 10 }, + { "matrix": [1, 9],"flags": 4, "x": 90, "y": 10 }, + { "matrix": [1, 8],"flags": 4, "x": 80, "y": 10 }, + { "matrix": [1, 7],"flags": 4, "x": 70, "y": 10 }, + { "matrix": [1, 6],"flags": 4, "x": 60, "y": 10 }, + { "matrix": [1, 5],"flags": 4, "x": 50, "y": 10 }, + { "matrix": [1, 4],"flags": 4, "x": 40, "y": 10 }, + { "matrix": [1, 3],"flags": 4, "x": 30, "y": 10 }, + { "matrix": [1, 2],"flags": 4, "x": 20, "y": 10 }, + { "matrix": [1, 1],"flags": 4, "x": 10, "y": 10 }, + { "matrix": [1, 0],"flags": 4, "x": 0, "y": 10 }, + { "matrix": [0, 0],"flags": 4, "x": 0, "y": 0 }, + { "matrix": [0, 1],"flags": 4, "x": 10, "y": 0 }, + { "matrix": [0, 2],"flags": 4, "x": 20, "y": 0 }, + { "matrix": [0, 3],"flags": 4, "x": 30, "y": 0 }, + { "matrix": [0, 4],"flags": 4, "x": 40, "y": 0 }, + { "matrix": [0, 5],"flags": 4, "x": 50, "y": 0 }, + { "matrix": [0, 6],"flags": 4, "x": 60, "y": 0 }, + { "matrix": [0, 7],"flags": 4, "x": 70, "y": 0 }, + { "matrix": [0, 8],"flags": 4, "x": 80, "y": 0 }, + { "matrix": [0, 9],"flags": 4, "x": 90, "y": 0 }, + { "matrix": [0, 10],"flags": 4, "x": 100, "y": 0 }, + { "matrix": [0, 11],"flags": 4, "x": 110, "y": 0 } + ] + }, + "layouts": { + "LAYOUT": { + "layout": [ + { "matrix": [0, 0], "x": 0, "y": 0 }, + { "matrix": [0, 1], "x": 1, "y": 0 }, + { "matrix": [0, 2], "x": 2, "y": 0 }, + { "matrix": [0, 3], "x": 3, "y": 0 }, + { "matrix": [0, 4], "x": 4, "y": 0 }, + { "matrix": [0, 5], "x": 5, "y": 0 }, + { "matrix": [0, 6], "x": 6, "y": 0 }, + { "matrix": [0, 7], "x": 7, "y": 0 }, + { "matrix": [0, 8], "x": 8, "y": 0 }, + { "matrix": [0, 9], "x": 9, "y": 0 }, + { "matrix": [0, 10], "x": 10, "y": 0}, + { "matrix": [0, 11], "x": 11, "y": 0}, + { "matrix": [1, 0], "x": 0, "y": 1 }, + { "matrix": [1, 1], "x": 1, "y": 1 }, + { "matrix": [1, 2], "x": 2, "y": 1 }, + { "matrix": [1, 3], "x": 3, "y": 1 }, + { "matrix": [1, 4], "x": 4, "y": 1 }, + { "matrix": [1, 5], "x": 5, "y": 1 }, + { "matrix": [1, 6], "x": 6, "y": 1 }, + { "matrix": [1, 7], "x": 7, "y": 1 }, + { "matrix": [1, 8], "x": 8, "y": 1 }, + { "matrix": [1, 9], "x": 9, "y": 1 }, + { "matrix": [1, 10], "x": 10, "y": 1 }, + { "matrix": [1, 11], "x": 11, "y": 1 }, + { "matrix": [2, 0], "x": 0, "y": 2 }, + { "matrix": [2, 1], "x": 1, "y": 2 }, + { "matrix": [2, 2], "x": 2, "y": 2 }, + { "matrix": [2, 3], "x": 3, "y": 2 }, + { "matrix": [2, 4], "x": 4, "y": 2 }, + { "matrix": [2, 5], "x": 5, "y": 2 }, + { "matrix": [2, 6], "x": 6, "y": 2 }, + { "matrix": [2, 7], "x": 7, "y": 2 }, + { "matrix": [2, 8], "x": 8, "y": 2 }, + { "matrix": [2, 9], "x": 9, "y": 2 }, + { "matrix": [2, 10], "x": 10, "y": 2 }, + { "matrix": [2, 11], "x": 11, "y": 2 } + ] + } + } +} + diff --git a/keyboards/treasure/type30/keymaps/default/config.h b/keyboards/treasure/type30/keymaps/default/config.h new file mode 100644 index 00000000000..d5c3fde071c --- /dev/null +++ b/keyboards/treasure/type30/keymaps/default/config.h @@ -0,0 +1,10 @@ +// TREASURE TYPE 30 +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +/* disable action features */ + +#define NO_ACTION_TAPPING +#define NO_ACTION_ONESHOT + diff --git a/keyboards/treasure/type30/keymaps/default/keymap.c b/keyboards/treasure/type30/keymaps/default/keymap.c new file mode 100644 index 00000000000..5bbf31b4797 --- /dev/null +++ b/keyboards/treasure/type30/keymaps/default/keymap.c @@ -0,0 +1,98 @@ +/* Copyright 2025 Treasure + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +// define combo names +enum combos { + COMBO_TRSPC, + COMBO_TRHME, + COMBO_TREND, + COMBO_TRENT, + COMBO_RVAL, + COMBO_RVALD, + COMBO_LENGTH +}; + +// Define a custom keycode +enum custom_keycodes { + TAP_KC_LSFT = SAFE_RANGE +}; + +uint16_t COMBO_LEN = COMBO_LENGTH; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint16_t shift_timer; // Timer to differentiate tap vs. hold + + switch (keycode) { + case TAP_KC_LSFT: + if (record->event.pressed) { + shift_timer = timer_read(); // Start timer on key press + register_code(KC_LSFT); // Register Shift immediately for hold behavior + } else { + unregister_code(KC_LSFT); // Unregister Shift on key release + if (timer_elapsed(shift_timer) < TAPPING_TERM) { + // If released quickly, treat as tap and send Space + tap_code(KC_SPC); + } + } + return false; // Skip further processing for this key + } + return true; // Process other keys normally +} +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + TAP_KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, MO(1), KC_SPC, + KC_LCTL, KC_LALT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_RGUI, KC_UP, KC_DOWN + ), + [1] = LAYOUT( + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_TRNS, KC_PLUS, KC_MINUS, KC_SLASH, KC_KP_ASTERISK, KC_LBRC, KC_RBRC,KC_BACKSLASH, KC_SCLN, KC_QUOT, KC_TRNS, KC_ENT, + KC_TRNS, KC_TRNS, KC_EQL, RGB_TOG,RGB_HUI, RGB_MOD, KC_GRAVE, KC_COMMA, KC_DOT, KC_TRNS, KC_LEFT, KC_RIGHT + ) +}; + +// define keys that make up combos +const uint16_t PROGMEM fd_combo1[] = {KC_V, KC_B, COMBO_END}; +const uint16_t PROGMEM fd_combo2[] = {KC_UP, KC_DOWN, COMBO_END}; +const uint16_t PROGMEM fd_combo3[] = {KC_LEFT, KC_RIGHT, COMBO_END}; +const uint16_t PROGMEM fd_combo7[] = {MO(1), KC_SPC, COMBO_END}; + +const uint16_t PROGMEM fd_combo8[] = {RGB_TOG, RGB_HUI, COMBO_END}; +const uint16_t PROGMEM fd_combo9[] = {RGB_HUI, RGB_MOD, COMBO_END}; + + + +// map combo names to their keys and the key they trigger +combo_t key_combos[] = { + [COMBO_TRSPC] = COMBO(fd_combo1, KC_SPC), + [COMBO_TRHME] = COMBO(fd_combo2, KC_ENT), + [COMBO_TREND] = COMBO(fd_combo3, KC_END), + [COMBO_TRENT] = COMBO(fd_combo7, KC_ENT), + [COMBO_RVAL] = COMBO(fd_combo8, KC_NO), + [COMBO_RVALD] = COMBO(fd_combo9, KC_NO), + + // more here... +}; + +// Custom combo event handler +void process_combo_event(uint16_t combo_index, bool pressed) { + switch (combo_index) { + case COMBO_RVAL: + if (pressed) { + rgblight_decrease_val(); // Decrease brightness + } + break; + + case COMBO_RVALD: + if (pressed) { + rgblight_increase_val(); // Decrease brightness + } + break; + } +} diff --git a/keyboards/treasure/type30/keymaps/default/rules.mk b/keyboards/treasure/type30/keymaps/default/rules.mk new file mode 100644 index 00000000000..2e11b6a3f60 --- /dev/null +++ b/keyboards/treasure/type30/keymaps/default/rules.mk @@ -0,0 +1,2 @@ +COMBO_ENABLE = yes +RGBLIGHT_ENABLE = yes diff --git a/keyboards/treasure/type30/readme.md b/keyboards/treasure/type30/readme.md new file mode 100644 index 00000000000..df28420cf4e --- /dev/null +++ b/keyboards/treasure/type30/readme.md @@ -0,0 +1,19 @@ +# Treasure TYPE-30 + +* Keyboard Maintainer: [Treasure](https://www,treasuretypes.com) +* Hardware Supported: Treasure TYPE-30 Hotswap PCB +* Hardware Availability: [Treasure Store](http://treasuretypes.com) + +Make example for this keyboard (after setting up your build environment): + + make treasure/type30/hotswap:default + +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). + +## 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 diff --git a/keyboards/treasure/type30/rules.mk b/keyboards/treasure/type30/rules.mk new file mode 100644 index 00000000000..e69de29bb2d