From 34a2f1427426e28f9e260e2e9f53a63a131e6ad2 Mon Sep 17 00:00:00 2001 From: Synth and Keys <117340582+Synth-and-Keys@users.noreply.github.com> Date: Wed, 2 Aug 2023 11:05:00 -0600 Subject: [PATCH] [Keyboard] Add Bento Box macropad (#20521) --- keyboards/synthandkeys/bento_box/bento_box.c | 37 +++++++++++ keyboards/synthandkeys/bento_box/info.json | 64 +++++++++++++++++++ .../bento_box/keymaps/default/keymap.c | 41 ++++++++++++ keyboards/synthandkeys/bento_box/readme.md | 26 ++++++++ keyboards/synthandkeys/bento_box/rules.mk | 1 + 5 files changed, 169 insertions(+) create mode 100644 keyboards/synthandkeys/bento_box/bento_box.c create mode 100644 keyboards/synthandkeys/bento_box/info.json create mode 100644 keyboards/synthandkeys/bento_box/keymaps/default/keymap.c create mode 100644 keyboards/synthandkeys/bento_box/readme.md create mode 100644 keyboards/synthandkeys/bento_box/rules.mk diff --git a/keyboards/synthandkeys/bento_box/bento_box.c b/keyboards/synthandkeys/bento_box/bento_box.c new file mode 100644 index 00000000000..5ef0678f5ec --- /dev/null +++ b/keyboards/synthandkeys/bento_box/bento_box.c @@ -0,0 +1,37 @@ +// Copyright 2023 Synth-and-Keys (@Synth-and-Keys) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "quantum.h" + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { + return false; + } + /*Main Encoder*/ + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + /* TOP LEFT*/ + else if (index == 1) { + if (clockwise) { + tap_code16(C(KC_EQUAL)); + } else { + tap_code16(C(KC_MINUS)); + } + } + /* TOP RIGHT*/ + else if (index == 2) { + if (clockwise) { + tap_code16(C(KC_Y)); + } else { + tap_code16(C(KC_Z)); + } + } + return true; +} +#endif \ No newline at end of file diff --git a/keyboards/synthandkeys/bento_box/info.json b/keyboards/synthandkeys/bento_box/info.json new file mode 100644 index 00000000000..3cdc7a58708 --- /dev/null +++ b/keyboards/synthandkeys/bento_box/info.json @@ -0,0 +1,64 @@ +{ + "manufacturer": "Synth-and-Keys", + "keyboard_name": "bento_box", + "maintainer": "Synth-and-Keys", + "bootloader": "stm32-dfu", + "bootmagic": { + "matrix": [2, 0] + }, + "diode_direction": "COL2ROW", + "encoder": { + "rotary": [ + {"pin_a": "B2","pin_b": "B1"}, + {"pin_a": "A13","pin_b": "A14"}, + {"pin_a": "A15","pin_b": "B3"} + ] + }, + "features": { + "bootmagic": true, + "command": false, + "console": false, + "encoder": true, + "extrakey": true, + "mousekey": true, + "nkro": true + }, + "matrix_pins": { + "direct": [ + [ "A9", "A8", "B10", "B9", "B6", "B0"], + [ "A5", "A2", "A7", "A4", "A1", "B8"], + [ "B5", "A6", "A3", "A0", "B7", "B4"] + ] + }, + "processor": "STM32F072", + "url": "", + "usb": { + "device_version": "1.0.0", + "pid": "0x0000", + "vid": "0xFEED" + }, + "layouts": { + "LAYOUT": { + "layout": [ + { "matrix": [0, 0], "x": 3.5, "y": 0 }, + { "matrix": [0, 1], "x": 4.5, "y": 0 }, + { "matrix": [0, 2], "x": 1, "y": 0.5 }, + { "matrix": [0, 3], "x": 3.5, "y": 1 }, + { "matrix": [0, 4], "x": 4.5, "y": 1 }, + { "matrix": [0, 5], "x": 0, "y": 2 }, + { "matrix": [1, 0], "x": 1, "y": 2 }, + { "matrix": [1, 1], "x": 2, "y": 2 }, + { "matrix": [1, 2], "x": 0, "y": 3 }, + { "matrix": [1, 3], "x": 1, "y": 3 }, + { "matrix": [1, 4], "x": 2, "y": 3 }, + { "matrix": [1, 5], "x": 3.5, "y": 2.5 }, + { "matrix": [2, 0], "x": 4.5, "y": 2.5 }, + { "matrix": [2, 1], "x": 0, "y": 4 }, + { "matrix": [2, 2], "x": 1, "y": 4 }, + { "matrix": [2, 3], "x": 2, "y": 4 }, + { "matrix": [2, 4], "x": 3.5, "y": 3.5, "h": 1.5}, + { "matrix": [2, 5], "x": 4.5, "y": 3.5, "h": 1.5} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/synthandkeys/bento_box/keymaps/default/keymap.c b/keyboards/synthandkeys/bento_box/keymaps/default/keymap.c new file mode 100644 index 00000000000..bf8f26984bf --- /dev/null +++ b/keyboards/synthandkeys/bento_box/keymaps/default/keymap.c @@ -0,0 +1,41 @@ +// Copyright 2023 Synth-and-Keys (@Synth-and-Keys) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ---------------------------------------------------------------- + * | | | | Ctrl+0 | GUI+Shift+S | + * ---------------------------------------------------------------- + * | | Mute | | Copy | Paste | + * ---------------------------------------------------------------- + * | Prev | Pause | Next | | | + * ---------------------------------------------------------------- + * | Home | Up | End | Ctrl+T | Ctrl+W | + * ---------------------------------------------------------------- + * | Left | Down | Right | Shift+Alt+Tab | Alt+Tab | + * ---------------------------------------------------------------- + */ + [0] = LAYOUT( + C(KC_0), G(S(KC_S)), + KC_MUTE, C(KC_C), C(KC_V), + KC_MPRV, KC_MPLY, KC_MNXT, + KC_HOME, KC_UP, KC_END, C(KC_T), C(KC_W), + KC_LEFT, KC_DOWN, KC_RIGHT, S(C(KC_TAB)), C(KC_TAB) + ) +}; + + /* LAYER TEMPLATE + * ------------------------------------ + * | | | | | | + * ------------------------------------ + * | | | | | | + * ------------------------------------ + * | | | | | | + * ------------------------------------ + * | | | | | | + * ------------------------------------ + * | | | | | | + * ------------------------------------ + */ \ No newline at end of file diff --git a/keyboards/synthandkeys/bento_box/readme.md b/keyboards/synthandkeys/bento_box/readme.md new file mode 100644 index 00000000000..32ce47a0137 --- /dev/null +++ b/keyboards/synthandkeys/bento_box/readme.md @@ -0,0 +1,26 @@ +# synthandkeys/bento_box + +![synthandkeys/bento_box](https://i.imgur.com/J8NkYO8h.jpeg) + +The Bento Box is a 15-key, 3-encoder macropad running on QMK. + +* Keyboard Maintainer: [Synth-and-Keys](https://github.com/Synth-and-Keys) +* Hardware Supported: Bento Box PCB +* Hardware Availability: https://www.etsy.com/shop/SynthandKeys + +Make example for this keyboard (after setting up your build environment): + + make synthandkeys/bento_box:default + +Flashing example for this keyboard: + + make synthandkeys/bento_box: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). + +## Bootloader + +Enter the bootloader in 2 ways: + +* **Bootmagic reset**: Hold down the top left key in the group of 9 and plug in the keyboard +* **Physical reset button**: Hold down the reset button on the back of the PCB for 5 seconds and release diff --git a/keyboards/synthandkeys/bento_box/rules.mk b/keyboards/synthandkeys/bento_box/rules.mk new file mode 100644 index 00000000000..7ff128fa692 --- /dev/null +++ b/keyboards/synthandkeys/bento_box/rules.mk @@ -0,0 +1 @@ +# This file intentionally left blank \ No newline at end of file