From 7a42f8e0589caca13eec027b554273b5076f25b3 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Fri, 20 May 2022 11:09:54 +1000 Subject: [PATCH 01/24] initial upload --- keyboards/idobao/id61/config.h | 94 +++++++++++++++++++ keyboards/idobao/id61/id61.c | 68 ++++++++++++++ keyboards/idobao/id61/id61.h | 22 +++++ keyboards/idobao/id61/info.json | 100 +++++++++++++++++++++ keyboards/idobao/id61/keymaps/via/config.h | 8 ++ keyboards/idobao/id61/keymaps/via/keymap.c | 35 ++++++++ keyboards/idobao/id61/keymaps/via/rules.mk | 3 + keyboards/idobao/id61/post.rules.mk | 11 +++ keyboards/idobao/id61/readme.md | 39 ++++++++ keyboards/idobao/id61/rules.mk | 5 ++ 10 files changed, 385 insertions(+) create mode 100644 keyboards/idobao/id61/config.h create mode 100644 keyboards/idobao/id61/id61.c create mode 100644 keyboards/idobao/id61/id61.h create mode 100644 keyboards/idobao/id61/info.json create mode 100644 keyboards/idobao/id61/keymaps/via/config.h create mode 100644 keyboards/idobao/id61/keymaps/via/keymap.c create mode 100644 keyboards/idobao/id61/keymaps/via/rules.mk create mode 100644 keyboards/idobao/id61/post.rules.mk create mode 100644 keyboards/idobao/id61/readme.md create mode 100644 keyboards/idobao/id61/rules.mk diff --git a/keyboards/idobao/id61/config.h b/keyboards/idobao/id61/config.h new file mode 100644 index 000000000000..9cdd94f27ef9 --- /dev/null +++ b/keyboards/idobao/id61/config.h @@ -0,0 +1,94 @@ +// Copyright 2022 Vino Rodrigues (@vinorodrigues) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "config_common.h" + +/* key matrix size */ +// #define MATRIX_ROWS 5 +// #define MATRIX_COLS 15 + +/* ---------------- + * RGB Matrix stuff + * ---------------- */ + +// TODO: RGB Matrix +#define RGB_DI_PIN B7 + +// RGB Matrix config +#if defined(RGB_DI_PIN) && defined(RGB_MATRIX_ENABLE) + + #ifndef ID61_DISABLE_UNDERGLOW + #define DRIVER_LED_TOTAL 73 + #else + #define DRIVER_LED_TOTAL (73 - 12) + #endif + + #define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 180 // limits maximum brightness of LEDs to x out of 255. If not defined maximum brightness is set to 255 + + #define RGB_MATRIX_KEYPRESSES + + #define ENABLE_RGB_MATRIX_SOLID_COLOR // Static single color + #define ENABLE_RGB_MATRIX_ALPHAS_MODS // Static dual hue, speed is hue for secondary hue + #define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN // Static gradient top to bottom, speed controls how much gradient changes + #define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT // Static gradient left to right, speed controls how much gradient changes + #define ENABLE_RGB_MATRIX_BREATHING // Single hue brightness cycling animation + #define ENABLE_RGB_MATRIX_BAND_SAT // Single hue band fading saturation scrolling left to right + #define ENABLE_RGB_MATRIX_BAND_VAL // Single hue band fading brightness scrolling left to right + #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT // Single hue 3 blade spinning pinwheel fades saturation + #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL // Single hue 3 blade spinning pinwheel fades brightness + #define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT // Single hue spinning spiral fades saturation + #define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL // Single hue spinning spiral fades brightness + #define ENABLE_RGB_MATRIX_CYCLE_ALL // Full keyboard solid hue cycling through full gradient + #define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT // Full gradient scrolling left to right + #define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN // Full gradient scrolling top to bottom + #define ENABLE_RGB_MATRIX_CYCLE_OUT_IN // Full gradient scrolling out to in + #define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL // Full dual gradients scrolling out to in + #define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Full gradient Chevron shaped scrolling left to right + #define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL // Full gradient spinning pinwheel around center of keyboard + #define ENABLE_RGB_MATRIX_CYCLE_SPIRAL // Full gradient spinning spiral around center of keyboard + #define ENABLE_RGB_MATRIX_DUAL_BEACON // Full gradient spinning around center of keyboard + #define ENABLE_RGB_MATRIX_RAINBOW_BEACON // Full tighter gradient spinning around center of keyboard + #define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS // Full dual gradients spinning two halfs of keyboard + #define ENABLE_RGB_MATRIX_RAINDROPS // Randomly changes a single key's hue + #define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS // Randomly changes a single key's hue and saturation + #define ENABLE_RGB_MATRIX_HUE_BREATHING // Hue shifts up a slight amount at the same time, then shifts back + #define ENABLE_RGB_MATRIX_HUE_PENDULUM // Hue shifts up a slight amount in a wave to the right, then back to the left + #define ENABLE_RGB_MATRIX_HUE_WAVE // Hue shifts up a slight amount and then back down in a wave to the right + + /* RGB_MATRIX_FRAMEBUFFER_EFFECTS) */ + // #define ENABLE_RGB_MATRIX_TYPING_HEATMAP + // #define ENABLE_RGB_MATRIX_DIGITAL_RAIN + + /* RGB_MATRIX_KEYPRESSES) | defined(RGB_MATRIX_KEYRELEASES) */ + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE // Pulses keys hit to hue & value then fades value out + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE // Static single hue, pulses keys hit to shifted hue then fades to current hue + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse near a single key hit then fades value out + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE // Hue & value pulse near multiple key hits then fades value out + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS // Hue & value pulse the same column and row of a single key hit then fades value out + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS // Hue & value pulse the same column and row of multiple key hits then fades value out + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS // Hue & value pulse away on the same column and row of a single key hit then fades value out + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS // Hue & value pulse away on the same column and row of multiple key hits then fades value out + #define ENABLE_RGB_MATRIX_SPLASH // Full gradient & value pulse away from a single key hit then fades value out + #define ENABLE_RGB_MATRIX_MULTISPLASH // Full gradient & value pulse away from multiple key hits then fades value out + #define ENABLE_RGB_MATRIX_SOLID_SPLASH // Hue & value pulse away from a single key hit then fades value out + #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH // Hue & value pulse away from multiple key hits then fades value out +#endif // RGB_MATRIX_ENABLE + +/* ----------------------- + * Feature disable options + * These options are also useful to firmware size reduction. + * ----------------------- */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +// #define NO_ACTION_LAYER +// #define NO_ACTION_TAPPING +// #define NO_ACTION_ONESHOT diff --git a/keyboards/idobao/id61/id61.c b/keyboards/idobao/id61/id61.c new file mode 100644 index 000000000000..2f65f30740a1 --- /dev/null +++ b/keyboards/idobao/id61/id61.c @@ -0,0 +1,68 @@ +// Copyright 2022 Vino Rodrigues (@vinorodrigues) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "id61.h" + +#define __ NO_LED + +#if defined(RGB_MATRIX_ENABLE) + +/* Pre-key + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │60 │59 │58 │57 │56 │55 │54 │53 │52 │51 │50 │49 │48 │ 47 │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ 46 │45 │44 │43 │42 │41 │40 │39 │38 │37 │36 │35 │34 │ 33 │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ 32 │31 │30 │29 │28 │27 │26 │25 │24 │23 │22 │21 │ 20 │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ 19 │18 │17 │16 │15 │14 │13 │12 │11 │10 │ 9 │ 8 │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + * + * Underglow (from top / [Esc] = top left) + * ┌────┬────┬────┬────┬────┬────┐ + * │ 61 │ 62 │ 63 │ 64 │ 65 │ 66 │ + * ├────┴────┴────┴────┴────┴────┤ + * ├────┬────┬────┬────┬────┬────┤ + * │ 72 │ 71 │ 70 │ 69 │ 68 │ 67 │ + * └────┴────┴────┴────┴────┴────┘ + */ + +led_config_t g_led_config = { { + // Key Matrix to LED Index + { 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, __, 47 }, + { 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, __ }, + { 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, __, 20, __ }, + { 19, __, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, __, __ }, + { 7, 6, 5, __, __, __, 4, __, __, __, 3, 2, 1, 0, __ }, +}, { + // LED Index to Physical Position + // generated from: https://xelus.netlify.app/guides/KLE_to_RGB_parser + /* NB: Reverse order! */ + {224,64 }, {204,64 }, {184,64 }, {163,64 }, {103,64 }, { 42,64 }, { 22,64 }, { 2,64 }, + {212,48 }, {182,48 }, {165,48 }, {149,48 }, {133,48 }, {117,48 }, {101,48 }, { 85,48 }, { 69,48 }, { 52,48 }, { 36,48 }, { 10,48 }, + {216,32 }, {190,32 }, {174,32 }, {157,32 }, {141,32 }, {125,32 }, {109,32 }, { 93,32 }, { 77,32 }, { 61,32 }, { 44,32 }, { 28,32 }, { 6,32 }, + {222,16 }, {202,16 }, {186,16 }, {170,16 }, {153,16 }, {137,16 }, {121,16 }, {105,16 }, { 89,16 }, { 73,16 }, { 57,16 }, { 40,16 }, { 24,16 }, { 4,16 }, + {218,0 }, {194,0 }, {178,0 }, {161,0 }, {145,0 }, {129,0 }, {113,0 }, { 97,0 }, { 81,0 }, { 65,0 }, { 48,0 }, { 32,0 }, { 16,0 }, { 0,0 } + // underglow LEDs (positions pushed to nearest edge to match edge key colors) + #ifndef ID61_DISABLE_UNDERGLOW + , { 0,0 }, { 45,0 }, { 90,0 }, {134,0 }, {179,0 }, {224,0 }, + {224,64 }, {179,64 }, {134,64 }, { 90,64 }, { 45,64 }, { 0,64 } + #endif +}, { + // LED Index to Flag + /* NB: Reverse order! */ + 1, 1, 1, 1, 4, 1, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 9, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 + // underglow LEDs + #ifndef ID61_DISABLE_UNDERGLOW + , 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2 + #endif +} }; + +#endif // RGB_MATRIX_ENABLE diff --git a/keyboards/idobao/id61/id61.h b/keyboards/idobao/id61/id61.h new file mode 100644 index 000000000000..186c59972d49 --- /dev/null +++ b/keyboards/idobao/id61/id61.h @@ -0,0 +1,22 @@ +// Copyright 2022 Vino Rodrigues (@vinorodrigues) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "quantum.h" + +/* +#define LAYOUT( \ + k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k014, \ + k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, \ + k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k213, \ + k300, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, \ + k400, k401, k402, k406, k410, k411, k412, k413 \ +) { \ + { k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, KC_NO, k014 }, \ + { k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, KC_NO}, \ + { k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, KC_NO, k213, KC_NO}, \ + { k300, KC_NO, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, KC_NO, KC_NO}, \ + { k400, k401, k402, KC_NO, KC_NO, KC_NO, k406, KC_NO, KC_NO, KC_NO, k410, k411, k412, k413, KC_NO} \ +} +*/ diff --git a/keyboards/idobao/id61/info.json b/keyboards/idobao/id61/info.json new file mode 100644 index 000000000000..f6a326683652 --- /dev/null +++ b/keyboards/idobao/id61/info.json @@ -0,0 +1,100 @@ +{ + "manufacturer": "IDOBAO", + "keyboard_name": "ID61", + "maintainer": "vinorodrigues", + "bootloader": "atmel-dfu", + "diode_direction": "COL2ROW", + "debounce": 5, + "features": { + "bootmagic": true, + "command": false, + "console": false, + "extrakey": true, + "mousekey": true, + "nkro": true, + "backlight": false, + "rgblight": false + }, + "matrix_pins": { + "cols": ["F6", "B0", "F1", "C7", "C6", "B6", "B5", "B4", "D7", "D6", "D4", "D5", "D3", "D2", "D1"], + "rows": ["E6", "B7", "F7", "F4", "F5"] + }, + "processor": "atmega32u4", + "url": "https://idobao.net/search?type=product&q=id61*", + "usb": { + "device_version": "1.0.0", + "pid": "0x0061", + "vid": "0x6964" + }, + "layouts": { + "LAYOUT_61_ansi": { + "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": [0, 12], "x":12, "y":0 }, + { "matrix": [0, 14], "x":13, "y":0, "w":2 }, + + { "matrix": [1, 0], "x":0, "y":1, "w":1.5 }, + { "matrix": [1, 1], "x":1.5, "y":1 }, + { "matrix": [1, 2], "x":2.5, "y":1 }, + { "matrix": [1, 3], "x":3.5, "y":1 }, + { "matrix": [1, 4], "x":4.5, "y":1 }, + { "matrix": [1, 5], "x":5.5, "y":1 }, + { "matrix": [1, 6], "x":6.5, "y":1 }, + { "matrix": [1, 7], "x":7.5, "y":1 }, + { "matrix": [1, 8], "x":8.5, "y":1 }, + { "matrix": [1, 9], "x":9.5, "y":1 }, + { "matrix": [1, 10], "x":10.5, "y":1 }, + { "matrix": [1, 11], "x":11.5, "y":1 }, + { "matrix": [1, 12], "x":12.5, "y":1 }, + { "matrix": [1, 13], "x":13.5, "y":1, "w":1.5 }, + + { "matrix": [2, 0], "x":0, "y":2, "w":1.75 }, + { "matrix": [2, 1], "x":1.75, "y":2 }, + { "matrix": [2, 2], "x":2.75, "y":2 }, + { "matrix": [2, 3], "x":3.75, "y":2 }, + { "matrix": [2, 4], "x":4.75, "y":2 }, + { "matrix": [2, 5], "x":5.75, "y":2 }, + { "matrix": [2, 6], "x":6.75, "y":2 }, + { "matrix": [2, 7], "x":7.75, "y":2 }, + { "matrix": [2, 8], "x":8.75, "y":2 }, + { "matrix": [2, 9], "x":9.75, "y":2 }, + { "matrix": [2, 10], "x":10.75, "y":2 }, + { "matrix": [2, 11], "x":11.75, "y":2 }, + { "matrix": [2, 13], "x":12.75, "y":2, "w":2.25 }, + + { "matrix": [3, 0], "x":0, "y":3, "w":2.25 }, + { "matrix": [3, 2], "x":2.25, "y":3 }, + { "matrix": [3, 3], "x":3.25, "y":3 }, + { "matrix": [3, 4], "x":4.25, "y":3 }, + { "matrix": [3, 5], "x":5.25, "y":3 }, + { "matrix": [3, 6], "x":6.25, "y":3 }, + { "matrix": [3, 7], "x":7.25, "y":3 }, + { "matrix": [3, 8], "x":8.25, "y":3 }, + { "matrix": [3, 9], "x":9.25, "y":3 }, + { "matrix": [3, 10], "x":10.25, "y":3 }, + { "matrix": [3, 11], "x":11.25, "y":3 }, + { "matrix": [3, 12], "x":12.25, "y":3, "w":2.75 }, + + { "matrix": [4, 0], "x":0, "y":4, "w":1.25 }, + { "matrix": [4, 1], "x":1.25, "y":4, "w":1.25 }, + { "matrix": [4, 2], "x":2.5, "y":4, "w":1.25 }, + { "matrix": [4, 6], "x":3.75, "y":4, "w":6.25 }, + { "matrix": [4, 10], "x":10, "y":4, "w":1.25 }, + { "matrix": [4, 11], "x":11.25, "y":4, "w":1.25 }, + { "matrix": [4, 12], "x":12.5, "y":4, "w":1.25 }, + { "matrix": [4, 14], "x":13.75, "y":4, "w":1.25 } + ] + } + } +} diff --git a/keyboards/idobao/id61/keymaps/via/config.h b/keyboards/idobao/id61/keymaps/via/config.h new file mode 100644 index 000000000000..99144d966d1c --- /dev/null +++ b/keyboards/idobao/id61/keymaps/via/config.h @@ -0,0 +1,8 @@ +// Copyright 2022 Vino Rodrigues (@vinorodrigues) +// SPDX-License-Identifier: GPL-2.0-or-later + +#define DYNAMIC_KEYMAP_LAYER_COUNT 2 + +#if defined(RGB_MATRIX_ENABLE) && !defined(VIA_QMK_RGBLIGHT_ENABLE) + #define VIA_QMK_RGBLIGHT_ENABLE +#endif diff --git a/keyboards/idobao/id61/keymaps/via/keymap.c b/keyboards/idobao/id61/keymaps/via/keymap.c new file mode 100644 index 000000000000..c5b0b99537a5 --- /dev/null +++ b/keyboards/idobao/id61/keymaps/via/keymap.c @@ -0,0 +1,35 @@ +// Copyright 2022 Vino Rodrigues (@vinorodrigues) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Backspc│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │Ctrl│Win │Alt │ │ Fn │Alt │Win │Ctrl│ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + [0] = LAYOUT_61_ansi( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RGUI, KC_RCTL + ), + + [1] = LAYOUT_61_ansi( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/idobao/id61/keymaps/via/rules.mk b/keyboards/idobao/id61/keymaps/via/rules.mk new file mode 100644 index 000000000000..974ef9966007 --- /dev/null +++ b/keyboards/idobao/id61/keymaps/via/rules.mk @@ -0,0 +1,3 @@ + +LTO_ENABLE = yes +VIA_ENABLE = yes diff --git a/keyboards/idobao/id61/post.rules.mk b/keyboards/idobao/id61/post.rules.mk new file mode 100644 index 000000000000..f953c1ebb624 --- /dev/null +++ b/keyboards/idobao/id61/post.rules.mk @@ -0,0 +1,11 @@ +# The Denwir D60 case has a sealed/solid undercase, +# this enables switching off thoes LEDs +# Usage: `make idobao/id61:default UNDERGLOW=off` + +ifeq ($(findstring off,$(UNDERGLOW)), off) + OPT_DEFS += -DID61_DISABLE_UNDERGLOW +else ifeq ($(findstring no,$(UNDERGLOW)), no) + OPT_DEFS += -DID61_DISABLE_UNDERGLOW +else ifeq ($(findstring 0,$(UNDERGLOW)), 0) + OPT_DEFS += -DID61_DISABLE_UNDERGLOW +endif diff --git a/keyboards/idobao/id61/readme.md b/keyboards/idobao/id61/readme.md new file mode 100644 index 000000000000..63fb0731cb5f --- /dev/null +++ b/keyboards/idobao/id61/readme.md @@ -0,0 +1,39 @@ +# IDOBAO *(Denwir 60)* ID61 + +![IDOBAO ID61](https://idobao.github.io/assets/img/idobao-id61.png) + +*The ID61 Keyboard Kit brings a tailored gasket-mounted build to an ultra-compact 60% layout.* + +## ANSI Support + +* Keyboard Maintainer: [Vino Rodrigues](https://github.com/vinorodrigues) +* Hardware Supported: **IDOBAO ID61** +* Hardware Availability: [IDOBAO.net](https://idobao.net/search?type=product&q=id61*) + +## Layout + +![IDOBAO ID61](https://idobao.github.io/kle/idobao-id61.png) + +## Compiling and Flashing + +Make example for this keyboard (after setting up your build environment): + + qmk compile -kb idobao/id61 -km default + +*{..or..}* + + make idobao/id61:default + +Flashing example for this keyboard: + + make idobao/id61: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 3 ways: + +* **Bootmagic reset**: Hold down the [Escape] key and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB +* **Keycode in layout**: Press the key mapped to `RESET`, default is [Fn]+[Z] diff --git a/keyboards/idobao/id61/rules.mk b/keyboards/idobao/id61/rules.mk new file mode 100644 index 000000000000..eab741fd0aad --- /dev/null +++ b/keyboards/idobao/id61/rules.mk @@ -0,0 +1,5 @@ +# This file intentionally left blank +# ** settings are data driven & stored in `info.json` ** + +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = WS2812 From 2cc7e980c06e87cd543f19e2f5a44021aa64f04f Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Fri, 20 May 2022 15:19:47 +1000 Subject: [PATCH 02/24] adjust keymap --- keyboards/idobao/id61/keymaps/via/config.h | 2 +- keyboards/idobao/id61/keymaps/via/keymap.c | 62 ++++++++++++++++++---- 2 files changed, 53 insertions(+), 11 deletions(-) diff --git a/keyboards/idobao/id61/keymaps/via/config.h b/keyboards/idobao/id61/keymaps/via/config.h index 99144d966d1c..a796ef04671d 100644 --- a/keyboards/idobao/id61/keymaps/via/config.h +++ b/keyboards/idobao/id61/keymaps/via/config.h @@ -1,7 +1,7 @@ // Copyright 2022 Vino Rodrigues (@vinorodrigues) // SPDX-License-Identifier: GPL-2.0-or-later -#define DYNAMIC_KEYMAP_LAYER_COUNT 2 +// #define DYNAMIC_KEYMAP_LAYER_COUNT 4 #if defined(RGB_MATRIX_ENABLE) && !defined(VIA_QMK_RGBLIGHT_ENABLE) #define VIA_QMK_RGBLIGHT_ENABLE diff --git a/keyboards/idobao/id61/keymaps/via/keymap.c b/keyboards/idobao/id61/keymaps/via/keymap.c index c5b0b99537a5..15266f7dbc7e 100644 --- a/keyboards/idobao/id61/keymaps/via/keymap.c +++ b/keyboards/idobao/id61/keymaps/via/keymap.c @@ -18,18 +18,60 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ [0] = LAYOUT_61_ansi( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RGUI, KC_RCTL + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RGUI, KC_RCTL ), + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ Del │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ Ins │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │Rst│ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ [1] = LAYOUT_61_ansi( - RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + _______, RGB_TOG, KC_UP, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_PSCR, KC_SLCK, KC_PAUS, KC_INS, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, RGB_SPI, RGB_SPD, _______, _______, _______, + _______, QK_BOOT, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + [2] = LAYOUT_61_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [3] = LAYOUT_61_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______ ) }; From e0d2006683972e7513936e5a1767b5295c0f2eea Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Fri, 20 May 2022 15:34:58 +1000 Subject: [PATCH 03/24] Delete config.h --- keyboards/idobao/id61/keymaps/via/config.h | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 keyboards/idobao/id61/keymaps/via/config.h diff --git a/keyboards/idobao/id61/keymaps/via/config.h b/keyboards/idobao/id61/keymaps/via/config.h deleted file mode 100644 index a796ef04671d..000000000000 --- a/keyboards/idobao/id61/keymaps/via/config.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2022 Vino Rodrigues (@vinorodrigues) -// SPDX-License-Identifier: GPL-2.0-or-later - -// #define DYNAMIC_KEYMAP_LAYER_COUNT 4 - -#if defined(RGB_MATRIX_ENABLE) && !defined(VIA_QMK_RGBLIGHT_ENABLE) - #define VIA_QMK_RGBLIGHT_ENABLE -#endif From b5df6354ed4c32e022dbb3ae1aedbb38365871cc Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Sat, 21 May 2022 01:28:54 +1000 Subject: [PATCH 04/24] Update post.rules.mk --- keyboards/idobao/id61/post.rules.mk | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/keyboards/idobao/id61/post.rules.mk b/keyboards/idobao/id61/post.rules.mk index f953c1ebb624..673b26039656 100644 --- a/keyboards/idobao/id61/post.rules.mk +++ b/keyboards/idobao/id61/post.rules.mk @@ -2,10 +2,7 @@ # this enables switching off thoes LEDs # Usage: `make idobao/id61:default UNDERGLOW=off` -ifeq ($(findstring off,$(UNDERGLOW)), off) - OPT_DEFS += -DID61_DISABLE_UNDERGLOW -else ifeq ($(findstring no,$(UNDERGLOW)), no) - OPT_DEFS += -DID61_DISABLE_UNDERGLOW -else ifeq ($(findstring 0,$(UNDERGLOW)), 0) +UNDERGLOW ?= yes +ifneq ($(strip $(UNDERGLOW)), yes) OPT_DEFS += -DID61_DISABLE_UNDERGLOW endif From 27386e7f0223753f618d50d8a62f06cf963ab6a8 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Wed, 8 Jun 2022 12:08:36 +1000 Subject: [PATCH 05/24] remapped to correct pins --- keyboards/idobao/id61/config.h | 7 ++- keyboards/idobao/id61/id61.c | 50 +++++++++++----------- keyboards/idobao/id61/info.json | 10 ++--- keyboards/idobao/id61/keymaps/via/keymap.c | 16 +++---- 4 files changed, 41 insertions(+), 42 deletions(-) diff --git a/keyboards/idobao/id61/config.h b/keyboards/idobao/id61/config.h index 9cdd94f27ef9..7ae1564bdd80 100644 --- a/keyboards/idobao/id61/config.h +++ b/keyboards/idobao/id61/config.h @@ -13,16 +13,15 @@ * RGB Matrix stuff * ---------------- */ -// TODO: RGB Matrix -#define RGB_DI_PIN B7 +#define RGB_DI_PIN F0 // RGB Matrix config #if defined(RGB_DI_PIN) && defined(RGB_MATRIX_ENABLE) #ifndef ID61_DISABLE_UNDERGLOW - #define DRIVER_LED_TOTAL 73 + #define DRIVER_LED_TOTAL 71 #else - #define DRIVER_LED_TOTAL (73 - 12) + #define DRIVER_LED_TOTAL (71 - 10) #endif #define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended diff --git a/keyboards/idobao/id61/id61.c b/keyboards/idobao/id61/id61.c index 2f65f30740a1..f6338c71337a 100644 --- a/keyboards/idobao/id61/id61.c +++ b/keyboards/idobao/id61/id61.c @@ -21,47 +21,47 @@ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ * * Underglow (from top / [Esc] = top left) - * ┌────┬────┬────┬────┬────┬────┐ - * │ 61 │ 62 │ 63 │ 64 │ 65 │ 66 │ - * ├────┴────┴────┴────┴────┴────┤ - * ├────┬────┬────┬────┬────┬────┤ - * │ 72 │ 71 │ 70 │ 69 │ 68 │ 67 │ - * └────┴────┴────┴────┴────┴────┘ + * ┌────┬────┬────┬────┬────┐ + * │ 61 │ 62 │ 63 │ 64 │ 65 │ + * ├────┴────┴────┴────┴────┤ + * ├────┬────┬────┬────┬────┤ + * │ 70 │ 69 │ 68 │ 67 │ 66 │ + * └────┴────┴────┴────┴────┘ */ led_config_t g_led_config = { { // Key Matrix to LED Index - { 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, __, 47 }, - { 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, __ }, - { 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, __, 20, __ }, - { 19, __, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, __, __ }, - { 7, 6, 5, __, __, __, 4, __, __, __, 3, 2, 1, 0, __ }, + { 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47 }, + { 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33 }, + { 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, __ }, + { 19, __, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, __ }, + { 7, 6, 5, __, __, __, 4, __, __, __, 3, 2, 1, 0 }, }, { // LED Index to Physical Position // generated from: https://xelus.netlify.app/guides/KLE_to_RGB_parser /* NB: Reverse order! */ - {224,64 }, {204,64 }, {184,64 }, {163,64 }, {103,64 }, { 42,64 }, { 22,64 }, { 2,64 }, - {212,48 }, {182,48 }, {165,48 }, {149,48 }, {133,48 }, {117,48 }, {101,48 }, { 85,48 }, { 69,48 }, { 52,48 }, { 36,48 }, { 10,48 }, - {216,32 }, {190,32 }, {174,32 }, {157,32 }, {141,32 }, {125,32 }, {109,32 }, { 93,32 }, { 77,32 }, { 61,32 }, { 44,32 }, { 28,32 }, { 6,32 }, - {222,16 }, {202,16 }, {186,16 }, {170,16 }, {153,16 }, {137,16 }, {121,16 }, {105,16 }, { 89,16 }, { 73,16 }, { 57,16 }, { 40,16 }, { 24,16 }, { 4,16 }, - {218,0 }, {194,0 }, {178,0 }, {161,0 }, {145,0 }, {129,0 }, {113,0 }, { 97,0 }, { 81,0 }, { 65,0 }, { 48,0 }, { 32,0 }, { 16,0 }, { 0,0 } + {224,64 }, {204,64 }, {184,64 }, {163,64 }, {103,64 }, { 42,64 }, { 22,64 }, { 2,64 }, + {212,48 }, {182,48 }, {165,48 }, {149,48 }, {133,48 }, {117,48 }, {101,48 }, { 85,48 }, { 69,48 }, { 52,48 }, { 36,48 }, { 10,48 }, + {216,32 }, {190,32 }, {174,32 }, {157,32 }, {141,32 }, {125,32 }, {109,32 }, { 93,32 }, { 77,32 }, { 61,32 }, { 44,32 }, { 28,32 }, { 6,32 }, + {222,16 }, {202,16 }, {186,16 }, {170,16 }, {153,16 }, {137,16 }, {121,16 }, {105,16 }, { 89,16 }, { 73,16 }, { 57,16 }, { 40,16 }, { 24,16 }, { 4,16 }, + {218,0 }, {194,0 }, {178,0 }, {161,0 }, {145,0 }, {129,0 }, {113,0 }, { 97,0 }, { 81,0 }, { 65,0 }, { 48,0 }, { 32,0 }, { 16,0 }, { 0,0 } // underglow LEDs (positions pushed to nearest edge to match edge key colors) #ifndef ID61_DISABLE_UNDERGLOW - , { 0,0 }, { 45,0 }, { 90,0 }, {134,0 }, {179,0 }, {224,0 }, - {224,64 }, {179,64 }, {134,64 }, { 90,64 }, { 45,64 }, { 0,64 } + , { 0,0 }, { 56,0 }, { 112,0 }, {168,0 }, {224,0 }, + {224,64 }, {168,64 }, {112,64 }, { 56,64 }, { 0,64 } #endif }, { // LED Index to Flag /* NB: Reverse order! */ - 1, 1, 1, 1, 4, 1, 1, 1, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 9, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 + 1, 1, 1, 1, 4, 1, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 9, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 // underglow LEDs #ifndef ID61_DISABLE_UNDERGLOW - , 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2 + , 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2 #endif } }; diff --git a/keyboards/idobao/id61/info.json b/keyboards/idobao/id61/info.json index f6a326683652..06ef87b6524a 100644 --- a/keyboards/idobao/id61/info.json +++ b/keyboards/idobao/id61/info.json @@ -16,8 +16,8 @@ "rgblight": false }, "matrix_pins": { - "cols": ["F6", "B0", "F1", "C7", "C6", "B6", "B5", "B4", "D7", "D6", "D4", "D5", "D3", "D2", "D1"], - "rows": ["E6", "B7", "F7", "F4", "F5"] + "cols": ["C7", "F6", "F5", "F4", "F1", "B7", "D5", "D1", "D2", "D3", "D4", "D0", "D6", "D7"], + "rows": ["B0", "B1", "B2", "B3", "F7"] }, "processor": "atmega32u4", "url": "https://idobao.net/search?type=product&q=id61*", @@ -42,7 +42,7 @@ { "matrix": [0, 10], "x":10, "y":0 }, { "matrix": [0, 11], "x":11, "y":0 }, { "matrix": [0, 12], "x":12, "y":0 }, - { "matrix": [0, 14], "x":13, "y":0, "w":2 }, + { "matrix": [0, 13], "x":13, "y":0, "w":2 }, { "matrix": [1, 0], "x":0, "y":1, "w":1.5 }, { "matrix": [1, 1], "x":1.5, "y":1 }, @@ -71,7 +71,7 @@ { "matrix": [2, 9], "x":9.75, "y":2 }, { "matrix": [2, 10], "x":10.75, "y":2 }, { "matrix": [2, 11], "x":11.75, "y":2 }, - { "matrix": [2, 13], "x":12.75, "y":2, "w":2.25 }, + { "matrix": [2, 12], "x":12.75, "y":2, "w":2.25 }, { "matrix": [3, 0], "x":0, "y":3, "w":2.25 }, { "matrix": [3, 2], "x":2.25, "y":3 }, @@ -93,7 +93,7 @@ { "matrix": [4, 10], "x":10, "y":4, "w":1.25 }, { "matrix": [4, 11], "x":11.25, "y":4, "w":1.25 }, { "matrix": [4, 12], "x":12.5, "y":4, "w":1.25 }, - { "matrix": [4, 14], "x":13.75, "y":4, "w":1.25 } + { "matrix": [4, 13], "x":13.75, "y":4, "w":1.25 } ] } } diff --git a/keyboards/idobao/id61/keymaps/via/keymap.c b/keyboards/idobao/id61/keymaps/via/keymap.c index 15266f7dbc7e..e5cb0deb358b 100644 --- a/keyboards/idobao/id61/keymaps/via/keymap.c +++ b/keyboards/idobao/id61/keymaps/via/keymap.c @@ -20,8 +20,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_61_ansi( KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RGUI, KC_RCTL ), @@ -41,8 +41,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [1] = LAYOUT_61_ansi( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, RGB_TOG, KC_UP, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_PSCR, KC_SLCK, KC_PAUS, KC_INS, - _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, RGB_SPI, RGB_SPD, _______, _______, _______, - _______, QK_BOOT, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, RGB_SPI, RGB_SPD, _______, _______, _______, + _______, QK_BOOT, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -62,16 +62,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [2] = LAYOUT_61_ansi( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), [3] = LAYOUT_61_ansi( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; From bfec26221f3c1ca82b5da0d28607a2ed7acedfa8 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Wed, 8 Jun 2022 23:20:55 +1000 Subject: [PATCH 06/24] add idobao keymap --- .../idobao/id61/keymaps/default/keymap.c | 48 ++ keyboards/idobao/id61/keymaps/idobao/config.h | 7 + keyboards/idobao/id61/keymaps/idobao/keymap.c | 437 ++++++++++++++++++ keyboards/idobao/id61/keymaps/idobao/rules.mk | 3 + keyboards/idobao/id61/keymaps/via/keymap.c | 16 +- keyboards/idobao/id61/readme.md | 9 +- 6 files changed, 508 insertions(+), 12 deletions(-) create mode 100644 keyboards/idobao/id61/keymaps/default/keymap.c create mode 100644 keyboards/idobao/id61/keymaps/idobao/config.h create mode 100644 keyboards/idobao/id61/keymaps/idobao/keymap.c create mode 100644 keyboards/idobao/id61/keymaps/idobao/rules.mk diff --git a/keyboards/idobao/id61/keymaps/default/keymap.c b/keyboards/idobao/id61/keymaps/default/keymap.c new file mode 100644 index 000000000000..7d6ff22bac62 --- /dev/null +++ b/keyboards/idobao/id61/keymaps/default/keymap.c @@ -0,0 +1,48 @@ +// Copyright 2022 Vino Rodrigues (@vinorodrigues) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Backspc│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │Ctrl│Win │Alt │ │ Fn │Alt │Win │Ctrl│ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + [0] = LAYOUT_61_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RGUI, KC_RCTL + ), + + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │Up │ │ │Tog│Hu+│Sa+│Br+│Sp+│PSc│Hom│End│ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │Lf │Dn │Rt │ │Mod│Hu-│Sa-│Br-│Sp-│PUp│PDn│ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │Rst│NKR│ │ │Ins│Del│ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + [1] = LAYOUT_61_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, + _______, _______, KC_UP, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_PSCR, KC_HOME, KC_END, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, QK_BOOT, NK_TOGG, _______, _______, KC_INS, KC_DEL, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/idobao/id61/keymaps/idobao/config.h b/keyboards/idobao/id61/keymaps/idobao/config.h new file mode 100644 index 000000000000..f8c367088d8c --- /dev/null +++ b/keyboards/idobao/id61/keymaps/idobao/config.h @@ -0,0 +1,7 @@ +// Copyright 2022 Vino Rodrigues (@vinorodrigues) +// SPDX-License-Identifier: GPL-2.0-or-later + +/* Denwir D60 has solid back case - no underglow LED's are visible. */ +//// #define ID61_DISABLE_UNDERGLOW + +//// #define DYNAMIC_KEYMAP_LAYER_COUNT 4 diff --git a/keyboards/idobao/id61/keymaps/idobao/keymap.c b/keyboards/idobao/id61/keymaps/idobao/keymap.c new file mode 100644 index 000000000000..59d35a352b8d --- /dev/null +++ b/keyboards/idobao/id61/keymaps/idobao/keymap.c @@ -0,0 +1,437 @@ +// Copyright 2022 Vino Rodrigues (@vinorodrigues) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H +#include "version.h" + +typedef union { + uint32_t raw; + struct { + bool in_arrow_mode:1; + bool rgb_disable_perkey:1; + #ifndef ID61_DISABLE_UNDERGLOW + bool rgb_disable_underglow:1; + #endif // ID61_DISABLE_UNDERGLOW + }; +} user_config_t; + +enum { + _BASE = 0, + _FN1, + _FN2, + _FN3 +}; + +enum { + KC_MCON = USER00, // macOS Open Mission Control + KC_LPAD, // macOS Open Launchpad + KB_ARRW, // toggle right modifiers are arrows feature + KB_RSFT, // right shift or up arrow + KB_RALT, // right alt or left arrow + KB_RGUI, // right gui or down arrow + KB_RCOM, // right gui or left arrow (macOS Command) + KB_ROPT, // right alt or down arrow (macOS Option) + KB_RCTL, // right ctrl ot right arrow + KB_VRSN // debug, type version +}; + +enum macos_consumer_usages { + _AC_SHOW_ALL_WINDOWS = 0x29F, // mapped to KC_MCON + _AC_SHOW_ALL_APPS = 0x2A0 // mapped to KC_LPAD +}; + +/* Special Keys */ +#define SK_LT1C LT(_FN1, KC_CAPS) // Layer Tap 1, i.e., Tap = Caps Lock, Hold = Layer 1 +#define SK_LT2M LT(_FN2, KC_MENU) // Layer Tap 2, i.e., Tap = Menu, Hold = Layer 2 + +/* key matrix */ +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Backspc│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │*Caps*│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ *Caps* => Tap = Caps Lock, Hold = Layer 1 (Fn1) + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ ↑Shift │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │Ctrl│Win │Alt │ │Fn1 │←Alt│↓Win│→Ctl│ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + [0] = LAYOUT_61_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + SK_LT1C, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KB_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KB_RALT, KB_RGUI, KB_RCTL + ), + + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ ~ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ Del │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ ↑ │ │ │Tog│Hu+│Sa+│Br+│Sp+│PSc│Hom│End│ Ins │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ ← │ ↓ │ → │ │Mod│Hu-│Sa-│Br-│Sp-│ │PUp│ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │Rst│NKR│ │ │ │PDn│ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + [1] = LAYOUT_61_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, + KB_ARRW, _______, KC_UP, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_PSCR, KC_HOME, KC_END, KC_INS, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, KC_PGUP, _______, + _______, _______, _______, _______, KB_VRSN, QK_BOOT, NK_TOGG, _______, _______, _______, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ + [2] = LAYOUT_61_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [3] = LAYOUT_61_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +//// #ifdef RGB_MATRIX_ENABLE + +/* + * RGB Stuff + */ + +#define ID61_CAPS_LOCK_KEY_INDEX 32 // position of Caps Lock key + +#define ID61_CAPS_LOCK_MAX_BRIGHTNESS 0xFF +#ifdef RGB_MATRIX_MAXIMUM_BRIGHTNESS + #undef ID61_CAPS_LOCK_MAX_BRIGHTNESS + #define ID61_CAPS_LOCK_MAX_BRIGHTNESS RGB_MATRIX_MAXIMUM_BRIGHTNESS +#endif + +#define ID61_CAPS_LOCK_VAL_STEP 8 +#ifdef RGB_MATRIX_VAL_STEP + #undef ID61_CAPS_LOCK_VAL_STEP + #define ID61_CAPS_LOCK_VAL_STEP RGB_MATRIX_VAL_STEP +#endif + +user_config_t user_config; +uint8_t mod_state; +bool delkey_registered; + +void ID61_update_rgb_mode(void) { + uint8_t flags = LED_FLAG_ALL; + + if (user_config.rgb_disable_perkey + #ifndef ID61_DISABLE_UNDERGLOW + && user_config.rgb_disable_underglow + #endif // ID61_DISABLE_UNDERGLOW + ) { + flags = 0; // All OFF Condition + } else { + if (user_config.rgb_disable_perkey) { + #ifndef ID61_DISABLE_UNDERGLOW + flags = LED_FLAG_UNDERGLOW | 0xF0; + #else + flags = 0xF0; + #endif // ID61_DISABLE_UNDERGLOW + } + #ifndef ID61_DISABLE_UNDERGLOW + if (user_config.rgb_disable_underglow) { + flags = LED_FLAG_MODIFIER | LED_FLAG_KEYLIGHT | LED_FLAG_INDICATOR | 0xF0; + } + #endif // ID61_DISABLE_UNDERGLOW + } + + if (flags == 0) { + rgb_matrix_set_flags(0); + rgb_matrix_set_color_all(HSV_OFF); + } else { + rgb_matrix_set_flags(flags); + rgb_matrix_enable_noeeprom(); + } + + eeconfig_update_kb(user_config.raw); // write back to EEPROM +} + +void ID61_get_rgb_mode(void) { + user_config.raw = eeconfig_read_kb(); // read config from EEPROM + ID61_update_rgb_mode(); +} + +void keyboard_post_init_user(void) { + delkey_registered = false; + ID61_get_rgb_mode(); +} + +void eeconfig_init_user(void) { + // EEPROM is getting reset! + user_config.raw = 0; + ID61_update_rgb_mode(); +} + +void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + // Caps Lock key stuff + + if (host_keyboard_led_state().caps_lock) { + uint8_t v = rgb_matrix_get_val(); + if (v < ID61_CAPS_LOCK_VAL_STEP) { + v = ID61_CAPS_LOCK_VAL_STEP; + } else if (v < (ID61_CAPS_LOCK_MAX_BRIGHTNESS - ID61_CAPS_LOCK_VAL_STEP)) { + if (!user_config.rgb_disable_perkey) { + v += ID61_CAPS_LOCK_VAL_STEP; // inc. by one more step than current brightness + } // else leave as current brightness + } else { + v = ID61_CAPS_LOCK_MAX_BRIGHTNESS; + } + rgb_matrix_set_color(ID61_CAPS_LOCK_KEY_INDEX, v, v, v); // white, brightness adjusted + } else if (user_config.rgb_disable_perkey) { + rgb_matrix_set_color(ID61_CAPS_LOCK_KEY_INDEX, HSV_OFF); // off + } +} + +//// #endif // RGB_MATRIX_ENABLE + +/* + * Extra keys and RGB Toggle handler + */ + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + mod_state = get_mods(); + + switch (keycode) { + + // handle RGB toggle key - this ensures caps lock always works + //// #ifdef RGB_MATRIX_ENABLE + + case QK_BOOT: + if (record->event.pressed) { + rgb_matrix_set_color_all(RGB_MATRIX_MAXIMUM_BRIGHTNESS, 0, 0); // All red + rgb_matrix_driver.flush(); + } + return true; + + case RGB_TOG: + /* roll through the LED modes + * | Level | Per-key | Underglow | + * |-------------|---------|-----------| + * | 0 (default) | on | on | + * | 1 | OFF | on | + * | 2 | on | OFF | + * | 3 | OFF | OFF | + * + * for ID61_DISABLE_UNDERGLOW + * | Level | Per-key | + * |-------------|---------| + * | 0 (default) | on | + * | 1 | OFF | + */ + if (record->event.pressed) { + if ( (!user_config.rgb_disable_perkey) + #ifndef ID61_DISABLE_UNDERGLOW + && (!user_config.rgb_disable_underglow) + #endif // ID61_DISABLE_UNDERGLOW + ) { + user_config.rgb_disable_perkey = 1; + + #ifndef ID61_DISABLE_UNDERGLOW + + } else if ( user_config.rgb_disable_perkey && (!user_config.rgb_disable_underglow) ) { + user_config.rgb_disable_perkey = 0; + user_config.rgb_disable_underglow = 1; + + } else if ( (!user_config.rgb_disable_perkey) && user_config.rgb_disable_underglow ) { + user_config.rgb_disable_perkey = 1; + + #endif // ID61_DISABLE_UNDERGLOW + + } else { + user_config.rgb_disable_perkey = 0; + #ifndef ID61_DISABLE_UNDERGLOW + user_config.rgb_disable_underglow = 0; + #endif // ID61_DISABLE_UNDERGLOW + } + ID61_update_rgb_mode(); + } + return false; + + case EE_CLR: + if (!record->event.pressed) { // on release + ID61_get_rgb_mode(); + } + return true; // let this one pass on + + //// #endif // RGB_MATRIX_ENABLE + + case KB_ARRW: + if (record->event.pressed) { + user_config.in_arrow_mode ^= 1; + } + return false; + + case KB_RSFT: + if (user_config.in_arrow_mode) { + if (record->event.pressed) { + register_code(KC_UP); + } else { + unregister_code(KC_UP); + } + } else { + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + } + return false; + + case KB_RALT: + if (user_config.in_arrow_mode) { + if (record->event.pressed) { + register_code(KC_LEFT); + } else { + unregister_code(KC_LEFT); + } + } else { + if (record->event.pressed) { + register_code(KC_RALT); + } else { + unregister_code(KC_RALT); + } + } + return false; + + case KB_RGUI: + if (user_config.in_arrow_mode) { + if (record->event.pressed) { + register_code(KC_DOWN); + } else { + unregister_code(KC_DOWN); + } + } else { + if (record->event.pressed) { + register_code(KC_RGUI); + } else { + unregister_code(KC_RGUI); + } + } + return false; + + case KB_RCOM: + if (user_config.in_arrow_mode) { + if (record->event.pressed) { + register_code(KC_LEFT); + } else { + unregister_code(KC_LEFT); + } + } else { + if (record->event.pressed) { + register_code(KC_RGUI); + } else { + unregister_code(KC_RGUI); + } + } + return false; + + case KB_ROPT: + if (user_config.in_arrow_mode) { + if (record->event.pressed) { + register_code(KC_DOWN); + } else { + unregister_code(KC_DOWN); + } + } else { + if (record->event.pressed) { + register_code(KC_RALT); + } else { + unregister_code(KC_RALT); + } + } + return false; + + case KB_RCTL: + if (user_config.in_arrow_mode) { + if (record->event.pressed) { + register_code(KC_RIGHT); + } else { + unregister_code(KC_RIGHT); + } + } else { + if (record->event.pressed) { + register_code(KC_RCTL); + } else { + unregister_code(KC_RCTL); + } + } + return false; + + // print firmware version + case KB_VRSN: + if (!get_mods()) { + if (!record->event.pressed) { + SEND_STRING(QMK_KEYBOARD ":" QMK_KEYMAP " (v" QMK_VERSION ")"); + } + } + return false; + + // @see: https://github.com/qmk/qmk_firmware/issues/10111#issuecomment-752300353 + case KC_MCON: + if (record->event.pressed) { + host_consumer_send(_AC_SHOW_ALL_WINDOWS); + } + return false; + + case KC_LPAD: + if (record->event.pressed) { + host_consumer_send(_AC_SHOW_ALL_APPS); + } + return false; + + // Shift + Backspace = Delete, see: https://docs.qmk.fm/#/feature_advanced_keycodes?id=shift-backspace-for-delete + case KC_BSPC: + if (record->event.pressed) { + if (mod_state & MOD_MASK_SHIFT) { + del_mods(MOD_MASK_SHIFT); + register_code(KC_DEL); + delkey_registered = true; + set_mods(mod_state); + + return false; + } + } else { + if (delkey_registered) { + unregister_code(KC_DEL); + delkey_registered = false; + return false; + } + } + return true; + + default: + return true; /* Process all other keycodes normally */ + } +} diff --git a/keyboards/idobao/id61/keymaps/idobao/rules.mk b/keyboards/idobao/id61/keymaps/idobao/rules.mk new file mode 100644 index 000000000000..974ef9966007 --- /dev/null +++ b/keyboards/idobao/id61/keymaps/idobao/rules.mk @@ -0,0 +1,3 @@ + +LTO_ENABLE = yes +VIA_ENABLE = yes diff --git a/keyboards/idobao/id61/keymaps/via/keymap.c b/keyboards/idobao/id61/keymaps/via/keymap.c index e5cb0deb358b..702a7a1b8077 100644 --- a/keyboards/idobao/id61/keymaps/via/keymap.c +++ b/keyboards/idobao/id61/keymaps/via/keymap.c @@ -27,22 +27,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ Del │ + * │ ~ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │ * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ Ins │ + * │ │ │Up │ │ │Tog│Hu+│Sa+│Br+│Sp+│PSc│Hom│End│ │ * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * │ │Lf │Dn │Rt │ │Mod│Hu-│Sa-│Br-│Sp-│PUp│PDn│ │ * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │Rst│ │ │ │ │ │ │ │ │ │ │ + * │ │ │ │ │ │Rst│NKR│ │ │Ins│Del│ │ * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ * │ │ │ │ │ │ │ │ │ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ [1] = LAYOUT_61_ansi( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, - _______, RGB_TOG, KC_UP, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_PSCR, KC_SLCK, KC_PAUS, KC_INS, - _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, RGB_SPI, RGB_SPD, _______, _______, _______, - _______, QK_BOOT, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, + _______, _______, KC_UP, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_PSCR, KC_HOME, KC_END, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, QK_BOOT, NK_TOGG, _______, _______, KC_INS, KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), diff --git a/keyboards/idobao/id61/readme.md b/keyboards/idobao/id61/readme.md index 63fb0731cb5f..3dcb39d3f3c5 100644 --- a/keyboards/idobao/id61/readme.md +++ b/keyboards/idobao/id61/readme.md @@ -1,8 +1,8 @@ -# IDOBAO *(Denwir 60)* ID61 +# IDOBAO ID61 ![IDOBAO ID61](https://idobao.github.io/assets/img/idobao-id61.png) -*The ID61 Keyboard Kit brings a tailored gasket-mounted build to an ultra-compact 60% layout.* +*The ID61 Keyboard Kit brings a tailored gasket-mounted build to an ultra-compact 60% layout with a unique ribbed side texture.* ## ANSI Support @@ -28,7 +28,8 @@ Flashing example for this keyboard: make idobao/id61: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). +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 @@ -36,4 +37,4 @@ Enter the bootloader in 3 ways: * **Bootmagic reset**: Hold down the [Escape] key and plug in the keyboard * **Physical reset button**: Briefly press the button on the back of the PCB -* **Keycode in layout**: Press the key mapped to `RESET`, default is [Fn]+[Z] +* **Keycode in layout**: Press the key mapped to `RESET`, default is [Fn]+[B] From d031ec6f947a2dc20eff976aaaa1fcc8a8bfdeb5 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Wed, 8 Jun 2022 23:27:47 +1000 Subject: [PATCH 07/24] disable underglow --- keyboards/idobao/id61/keymaps/idobao/config.h | 4 ++-- keyboards/idobao/id61/keymaps/idobao/keymap.c | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/keyboards/idobao/id61/keymaps/idobao/config.h b/keyboards/idobao/id61/keymaps/idobao/config.h index f8c367088d8c..fa39749d6093 100644 --- a/keyboards/idobao/id61/keymaps/idobao/config.h +++ b/keyboards/idobao/id61/keymaps/idobao/config.h @@ -2,6 +2,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* Denwir D60 has solid back case - no underglow LED's are visible. */ -//// #define ID61_DISABLE_UNDERGLOW +#define ID61_DISABLE_UNDERGLOW -//// #define DYNAMIC_KEYMAP_LAYER_COUNT 4 +#define DYNAMIC_KEYMAP_LAYER_COUNT 5 diff --git a/keyboards/idobao/id61/keymaps/idobao/keymap.c b/keyboards/idobao/id61/keymaps/idobao/keymap.c index 59d35a352b8d..0f9ebaeb95c4 100644 --- a/keyboards/idobao/id61/keymaps/idobao/keymap.c +++ b/keyboards/idobao/id61/keymaps/idobao/keymap.c @@ -19,7 +19,8 @@ enum { _BASE = 0, _FN1, _FN2, - _FN3 + _FN3, + _FN4 }; enum { @@ -115,10 +116,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [4] = LAYOUT_61_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ ) }; -//// #ifdef RGB_MATRIX_ENABLE +#ifdef RGB_MATRIX_ENABLE /* * RGB Stuff @@ -213,7 +222,7 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { } } -//// #endif // RGB_MATRIX_ENABLE +#endif // RGB_MATRIX_ENABLE /* * Extra keys and RGB Toggle handler @@ -226,7 +235,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { // handle RGB toggle key - this ensures caps lock always works - //// #ifdef RGB_MATRIX_ENABLE + #ifdef RGB_MATRIX_ENABLE case QK_BOOT: if (record->event.pressed) { @@ -285,7 +294,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return true; // let this one pass on - //// #endif // RGB_MATRIX_ENABLE + #endif // RGB_MATRIX_ENABLE case KB_ARRW: if (record->event.pressed) { From 84a87665d39993fb403101da5956b24e3f46e21a Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Wed, 8 Jun 2022 23:50:50 +1000 Subject: [PATCH 08/24] minor fix --- keyboards/idobao/id61/keymaps/idobao/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/idobao/id61/keymaps/idobao/keymap.c b/keyboards/idobao/id61/keymaps/idobao/keymap.c index 0f9ebaeb95c4..d3abb304922e 100644 --- a/keyboards/idobao/id61/keymaps/idobao/keymap.c +++ b/keyboards/idobao/id61/keymaps/idobao/keymap.c @@ -76,7 +76,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ * │ │ ← │ ↓ │ → │ │Mod│Hu-│Sa-│Br-│Sp-│ │PUp│ │ * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │Rst│NKR│ │ │ │PDn│ │ + * │ │ │ │ │Ver│Rst│NKR│ │ │ │PDn│ │ * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ * │ │ │ │ │ │ │ │ │ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ @@ -127,6 +127,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; +uint8_t mod_state; +bool delkey_registered; + #ifdef RGB_MATRIX_ENABLE /* @@ -148,8 +151,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { #endif user_config_t user_config; -uint8_t mod_state; -bool delkey_registered; void ID61_update_rgb_mode(void) { uint8_t flags = LED_FLAG_ALL; @@ -192,7 +193,6 @@ void ID61_get_rgb_mode(void) { } void keyboard_post_init_user(void) { - delkey_registered = false; ID61_get_rgb_mode(); } From 93752bd4232c7bc8cfffc06b467c54241d623a03 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Thu, 9 Jun 2022 09:38:16 +1000 Subject: [PATCH 09/24] right menu on windows --- keyboards/idobao/id61/keymaps/default/keymap.c | 4 ++-- keyboards/idobao/id61/keymaps/idobao/keymap.c | 12 ++++++------ keyboards/idobao/id61/keymaps/via/keymap.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/keyboards/idobao/id61/keymaps/default/keymap.c b/keyboards/idobao/id61/keymaps/default/keymap.c index 7d6ff22bac62..423081d88aba 100644 --- a/keyboards/idobao/id61/keymaps/default/keymap.c +++ b/keyboards/idobao/id61/keymaps/default/keymap.c @@ -14,7 +14,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift │ * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │Ctrl│Win │Alt │ │ Fn │Alt │Win │Ctrl│ + * │Ctrl│Win │Alt │ │ Fn │Alt │Menu│Ctrl│ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ [0] = LAYOUT_61_ansi( @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RGUI, KC_RCTL + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_Menu, KC_RCTL ), /* diff --git a/keyboards/idobao/id61/keymaps/idobao/keymap.c b/keyboards/idobao/id61/keymaps/idobao/keymap.c index d3abb304922e..0796ece7baeb 100644 --- a/keyboards/idobao/id61/keymaps/idobao/keymap.c +++ b/keyboards/idobao/id61/keymaps/idobao/keymap.c @@ -29,7 +29,7 @@ enum { KB_ARRW, // toggle right modifiers are arrows feature KB_RSFT, // right shift or up arrow KB_RALT, // right alt or left arrow - KB_RGUI, // right gui or down arrow + KB_RMNU, // menu or down arrow (Windows Menu) KB_RCOM, // right gui or left arrow (macOS Command) KB_ROPT, // right alt or down arrow (macOS Option) KB_RCTL, // right ctrl ot right arrow @@ -57,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ ↑Shift │ * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │Ctrl│Win │Alt │ │Fn1 │←Alt│↓Win│→Ctl│ + * │Ctrl│Win │Alt │ │Fn1 │←Alt│↓Mnu│→Ctl│ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ [0] = LAYOUT_61_ansi( @@ -65,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, SK_LT1C, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KB_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KB_RALT, KB_RGUI, KB_RCTL + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KB_RALT, KB_RMNU, KB_RCTL ), /* @@ -334,7 +334,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; - case KB_RGUI: + case KB_RMNU: if (user_config.in_arrow_mode) { if (record->event.pressed) { register_code(KC_DOWN); @@ -343,9 +343,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } else { if (record->event.pressed) { - register_code(KC_RGUI); + register_code(KC_MENU); } else { - unregister_code(KC_RGUI); + unregister_code(KC_MENU); } } return false; diff --git a/keyboards/idobao/id61/keymaps/via/keymap.c b/keyboards/idobao/id61/keymaps/via/keymap.c index 702a7a1b8077..f20f176c77db 100644 --- a/keyboards/idobao/id61/keymaps/via/keymap.c +++ b/keyboards/idobao/id61/keymaps/via/keymap.c @@ -14,7 +14,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ * │ Shift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shift │ * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │Ctrl│Win │Alt │ │ Fn │Alt │Win │Ctrl│ + * │Ctrl│Win │Alt │ │ Fn │Alt │Menu│Ctrl│ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ [0] = LAYOUT_61_ansi( @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RGUI, KC_RCTL + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_Menu, KC_RCTL ), /* From 69aa8e5c17d7387a6e98189ebd7d3a0f18c90751 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Thu, 9 Jun 2022 11:41:09 +1000 Subject: [PATCH 10/24] imgur --- keyboards/idobao/id61/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/idobao/id61/readme.md b/keyboards/idobao/id61/readme.md index 3dcb39d3f3c5..8c07d78b67e2 100644 --- a/keyboards/idobao/id61/readme.md +++ b/keyboards/idobao/id61/readme.md @@ -1,6 +1,6 @@ # IDOBAO ID61 -![IDOBAO ID61](https://idobao.github.io/assets/img/idobao-id61.png) +![IDOBAO ID61](https://i.imgur.com/Lu6SOyOh.png) *The ID61 Keyboard Kit brings a tailored gasket-mounted build to an ultra-compact 60% layout with a unique ribbed side texture.* From 40d5ad75e606f725006f9e583b6cf1309131d314 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Thu, 9 Jun 2022 16:33:46 +1000 Subject: [PATCH 11/24] ID61_process_special_k() function --- keyboards/idobao/id61/keymaps/idobao/keymap.c | 127 +++++------------- 1 file changed, 30 insertions(+), 97 deletions(-) diff --git a/keyboards/idobao/id61/keymaps/idobao/keymap.c b/keyboards/idobao/id61/keymaps/idobao/keymap.c index 0796ece7baeb..24d7d45ed1bf 100644 --- a/keyboards/idobao/id61/keymaps/idobao/keymap.c +++ b/keyboards/idobao/id61/keymaps/idobao/keymap.c @@ -8,10 +8,12 @@ typedef union { uint32_t raw; struct { bool in_arrow_mode:1; + #ifdef RGB_MATRIX_ENABLE bool rgb_disable_perkey:1; #ifndef ID61_DISABLE_UNDERGLOW bool rgb_disable_underglow:1; #endif // ID61_DISABLE_UNDERGLOW + #endif // RGB_MATRIX_ENABLE }; } user_config_t; @@ -127,9 +129,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; +user_config_t user_config; uint8_t mod_state; bool delkey_registered; +bool ID61_process_special_k(keyrecord_t *record, uint8_t k_norm, uint8_t k_spcl, uint8_t k_rasd) { + if (user_config.in_arrow_mode) { + if (record->event.pressed) { + register_code(k_spcl); + } else { + unregister_code(k_spcl); + } + } else { + if (record->event.pressed) { + register_code(k_norm); + } else { + unregister_code(k_norm); + } + } + return false; +} + #ifdef RGB_MATRIX_ENABLE /* @@ -150,8 +170,6 @@ bool delkey_registered; #define ID61_CAPS_LOCK_VAL_STEP RGB_MATRIX_VAL_STEP #endif -user_config_t user_config; - void ID61_update_rgb_mode(void) { uint8_t flags = LED_FLAG_ALL; @@ -302,101 +320,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; - case KB_RSFT: - if (user_config.in_arrow_mode) { - if (record->event.pressed) { - register_code(KC_UP); - } else { - unregister_code(KC_UP); - } - } else { - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - } - return false; - - case KB_RALT: - if (user_config.in_arrow_mode) { - if (record->event.pressed) { - register_code(KC_LEFT); - } else { - unregister_code(KC_LEFT); - } - } else { - if (record->event.pressed) { - register_code(KC_RALT); - } else { - unregister_code(KC_RALT); - } - } - return false; - - case KB_RMNU: - if (user_config.in_arrow_mode) { - if (record->event.pressed) { - register_code(KC_DOWN); - } else { - unregister_code(KC_DOWN); - } - } else { - if (record->event.pressed) { - register_code(KC_MENU); - } else { - unregister_code(KC_MENU); - } - } - return false; - - case KB_RCOM: - if (user_config.in_arrow_mode) { - if (record->event.pressed) { - register_code(KC_LEFT); - } else { - unregister_code(KC_LEFT); - } - } else { - if (record->event.pressed) { - register_code(KC_RGUI); - } else { - unregister_code(KC_RGUI); - } - } - return false; - - case KB_ROPT: - if (user_config.in_arrow_mode) { - if (record->event.pressed) { - register_code(KC_DOWN); - } else { - unregister_code(KC_DOWN); - } - } else { - if (record->event.pressed) { - register_code(KC_RALT); - } else { - unregister_code(KC_RALT); - } - } - return false; - - case KB_RCTL: - if (user_config.in_arrow_mode) { - if (record->event.pressed) { - register_code(KC_RIGHT); - } else { - unregister_code(KC_RIGHT); - } - } else { - if (record->event.pressed) { - register_code(KC_RCTL); - } else { - unregister_code(KC_RCTL); - } - } - return false; + case KB_RSFT: return ID61_process_special_k(record, KC_RSFT, KC_UP, KC_PGUP); + case KB_RALT: return ID61_process_special_k(record, KC_RALT, KC_LEFT, KC_HOME); + case KB_RMNU: return ID61_process_special_k(record, KC_MENU, KC_DOWN, KC_PGDN); + case KB_RCOM: return ID61_process_special_k(record, KC_RGUI, KC_LEFT, KC_HOME); + case KB_ROPT: return ID61_process_special_k(record, KC_RALT, KC_DOWN, KC_PGDN); + case KB_RCTL: return ID61_process_special_k(record, KC_RCTL, KC_RIGHT, KC_END); // print firmware version case KB_VRSN: @@ -411,12 +340,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case KC_MCON: if (record->event.pressed) { host_consumer_send(_AC_SHOW_ALL_WINDOWS); + } else { + host_consumer_send(0); } return false; case KC_LPAD: if (record->event.pressed) { host_consumer_send(_AC_SHOW_ALL_APPS); + } else { + host_consumer_send(0); } return false; From 330eb6beed798c6a0b070f3a54e0934b0345adb7 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Thu, 9 Jun 2022 18:10:55 +1000 Subject: [PATCH 12/24] KC_APP fix --- .../idobao/id61/keymaps/default/keymap.c | 2 +- keyboards/idobao/id61/keymaps/idobao/keymap.c | 68 ++++++++++++++----- keyboards/idobao/id61/keymaps/via/keymap.c | 2 +- 3 files changed, 52 insertions(+), 20 deletions(-) diff --git a/keyboards/idobao/id61/keymaps/default/keymap.c b/keyboards/idobao/id61/keymaps/default/keymap.c index 423081d88aba..b9dfed25987a 100644 --- a/keyboards/idobao/id61/keymaps/default/keymap.c +++ b/keyboards/idobao/id61/keymaps/default/keymap.c @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_Menu, KC_RCTL + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_APP, KC_RCTL ), /* diff --git a/keyboards/idobao/id61/keymaps/idobao/keymap.c b/keyboards/idobao/id61/keymaps/idobao/keymap.c index 24d7d45ed1bf..a1521248a8ca 100644 --- a/keyboards/idobao/id61/keymaps/idobao/keymap.c +++ b/keyboards/idobao/id61/keymaps/idobao/keymap.c @@ -31,7 +31,7 @@ enum { KB_ARRW, // toggle right modifiers are arrows feature KB_RSFT, // right shift or up arrow KB_RALT, // right alt or left arrow - KB_RMNU, // menu or down arrow (Windows Menu) + KB_RAPP, // menu or down arrow (Windows Menu) KB_RCOM, // right gui or left arrow (macOS Command) KB_ROPT, // right alt or down arrow (macOS Option) KB_RCTL, // right ctrl ot right arrow @@ -45,7 +45,7 @@ enum macos_consumer_usages { /* Special Keys */ #define SK_LT1C LT(_FN1, KC_CAPS) // Layer Tap 1, i.e., Tap = Caps Lock, Hold = Layer 1 -#define SK_LT2M LT(_FN2, KC_MENU) // Layer Tap 2, i.e., Tap = Menu, Hold = Layer 2 +#define SK_LT2M LT(_FN2, KC_APP) // Layer Tap 2, i.e., Tap = Menu, Hold = Layer 2 /* key matrix */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -67,7 +67,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, SK_LT1C, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KB_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KB_RALT, KB_RMNU, KB_RCTL + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KB_RALT, KB_RAPP, KB_RCTL ), /* @@ -132,19 +132,52 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { user_config_t user_config; uint8_t mod_state; bool delkey_registered; +bool keycode_raised[10]; -bool ID61_process_special_k(keyrecord_t *record, uint8_t k_norm, uint8_t k_spcl, uint8_t k_rasd) { - if (user_config.in_arrow_mode) { - if (record->event.pressed) { - register_code(k_spcl); +bool ID61_process_special_k(uint16_t keycode, keyrecord_t *record, uint8_t k_norm, uint8_t k_spcl, uint8_t k_altr) { + + bool is_raised = get_highest_layer(layer_state|default_layer_state) != 0; + + if (record->event.pressed) { + keycode_raised[keycode - USER00] = is_raised; // save for key release event + if (is_raised) { + // *** Fn keyed *** + if (user_config.in_arrow_mode) { + // alternate key + register_code(k_altr); + } else { + // special key + register_code(k_spcl); + } } else { - unregister_code(k_spcl); + // *** normal, un-Fn'ed *** + if (user_config.in_arrow_mode) { + // special key + register_code(k_spcl); + } else { + // normal key + register_code(k_norm); + } } } else { - if (record->event.pressed) { - register_code(k_norm); + if (keycode_raised[keycode - USER00]) { + // *** Fn keyed *** + if (user_config.in_arrow_mode) { + // alternate key + unregister_code(k_altr); + } else { + // special key + unregister_code(k_spcl); + } } else { - unregister_code(k_norm); + // *** normal, un-Fn'ed *** + if (user_config.in_arrow_mode) { + // special key + unregister_code(k_spcl); + } else { + // normal key + unregister_code(k_norm); + } } } return false; @@ -320,12 +353,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; - case KB_RSFT: return ID61_process_special_k(record, KC_RSFT, KC_UP, KC_PGUP); - case KB_RALT: return ID61_process_special_k(record, KC_RALT, KC_LEFT, KC_HOME); - case KB_RMNU: return ID61_process_special_k(record, KC_MENU, KC_DOWN, KC_PGDN); - case KB_RCOM: return ID61_process_special_k(record, KC_RGUI, KC_LEFT, KC_HOME); - case KB_ROPT: return ID61_process_special_k(record, KC_RALT, KC_DOWN, KC_PGDN); - case KB_RCTL: return ID61_process_special_k(record, KC_RCTL, KC_RIGHT, KC_END); + case KB_RSFT: return ID61_process_special_k(keycode, record, KC_RSFT, KC_UP, KC_PGUP); + case KB_RALT: return ID61_process_special_k(keycode, record, KC_RALT, KC_LEFT, KC_HOME); + case KB_RAPP: return ID61_process_special_k(keycode, record, KC_APP, KC_DOWN, KC_PGDN); + case KB_RCOM: return ID61_process_special_k(keycode, record, KC_RGUI, KC_LEFT, KC_HOME); + case KB_ROPT: return ID61_process_special_k(keycode, record, KC_RALT, KC_DOWN, KC_PGDN); + case KB_RCTL: return ID61_process_special_k(keycode, record, KC_RCTL, KC_RIGHT, KC_END); // print firmware version case KB_VRSN: @@ -361,7 +394,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { register_code(KC_DEL); delkey_registered = true; set_mods(mod_state); - return false; } } else { diff --git a/keyboards/idobao/id61/keymaps/via/keymap.c b/keyboards/idobao/id61/keymaps/via/keymap.c index f20f176c77db..6342b2496992 100644 --- a/keyboards/idobao/id61/keymaps/via/keymap.c +++ b/keyboards/idobao/id61/keymaps/via/keymap.c @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_Menu, KC_RCTL + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_APP, KC_RCTL ), /* From 03181987d4a6c7933a5a633b00f4ca5ba9fcadad Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Thu, 9 Jun 2022 21:06:57 +1000 Subject: [PATCH 13/24] Update keymap.c --- keyboards/idobao/id61/keymaps/idobao/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/idobao/id61/keymaps/idobao/keymap.c b/keyboards/idobao/id61/keymaps/idobao/keymap.c index a1521248a8ca..d7d2f5942bb5 100644 --- a/keyboards/idobao/id61/keymaps/idobao/keymap.c +++ b/keyboards/idobao/id61/keymaps/idobao/keymap.c @@ -45,7 +45,7 @@ enum macos_consumer_usages { /* Special Keys */ #define SK_LT1C LT(_FN1, KC_CAPS) // Layer Tap 1, i.e., Tap = Caps Lock, Hold = Layer 1 -#define SK_LT2M LT(_FN2, KC_APP) // Layer Tap 2, i.e., Tap = Menu, Hold = Layer 2 +#define SK_LT2A LT(_FN2, KC_APP) // Layer Tap 2, i.e., Tap = Menu, Hold = Layer 2 /* key matrix */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { From aa2af7d6702fe44eab67d13733a308e1d7851bb4 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Sun, 12 Jun 2022 11:57:04 +1000 Subject: [PATCH 14/24] pre-pr touchups --- keyboards/idobao/id61/keymaps/idobao/config.h | 4 ++-- keyboards/idobao/id61/keymaps/idobao/keymap.c | 8 -------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/keyboards/idobao/id61/keymaps/idobao/config.h b/keyboards/idobao/id61/keymaps/idobao/config.h index fa39749d6093..81568ec7ae99 100644 --- a/keyboards/idobao/id61/keymaps/idobao/config.h +++ b/keyboards/idobao/id61/keymaps/idobao/config.h @@ -1,7 +1,7 @@ // Copyright 2022 Vino Rodrigues (@vinorodrigues) // SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + /* Denwir D60 has solid back case - no underglow LED's are visible. */ #define ID61_DISABLE_UNDERGLOW - -#define DYNAMIC_KEYMAP_LAYER_COUNT 5 diff --git a/keyboards/idobao/id61/keymaps/idobao/keymap.c b/keyboards/idobao/id61/keymaps/idobao/keymap.c index d7d2f5942bb5..9b4a6e9c94a0 100644 --- a/keyboards/idobao/id61/keymaps/idobao/keymap.c +++ b/keyboards/idobao/id61/keymaps/idobao/keymap.c @@ -118,14 +118,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - - [4] = LAYOUT_61_ansi( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ ) }; From ddb83cdc69d1d58d7682e81511e4b1c0132869bd Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Sun, 26 Jun 2022 09:29:08 +1000 Subject: [PATCH 15/24] enum layouts --- keyboards/idobao/id61/keymaps/idobao/keymap.c | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/keyboards/idobao/id61/keymaps/idobao/keymap.c b/keyboards/idobao/id61/keymaps/idobao/keymap.c index 9b4a6e9c94a0..dbd6df7d8de2 100644 --- a/keyboards/idobao/id61/keymaps/idobao/keymap.c +++ b/keyboards/idobao/id61/keymaps/idobao/keymap.c @@ -21,8 +21,7 @@ enum { _BASE = 0, _FN1, _FN2, - _FN3, - _FN4 + _FN3 }; enum { @@ -62,12 +61,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │Ctrl│Win │Alt │ │Fn1 │←Alt│↓Mnu│→Ctl│ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [0] = LAYOUT_61_ansi( - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - SK_LT1C, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KB_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KB_RALT, KB_RAPP, KB_RCTL + [_BASE] = LAYOUT_61_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + SK_LT1C, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KB_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN1), KB_RALT, KB_RAPP, KB_RCTL ), /* @@ -83,7 +82,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ │ │ │ │ │ │ │ │ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [1] = LAYOUT_61_ansi( + [_FN1] = LAYOUT_61_ansi( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KB_ARRW, _______, KC_UP, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_PSCR, KC_HOME, KC_END, KC_INS, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, KC_PGUP, _______, @@ -104,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ │ │ │ │ │ │ │ │ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [2] = LAYOUT_61_ansi( + [_FN2] = LAYOUT_61_ansi( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -112,7 +111,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______ ), - [3] = LAYOUT_61_ansi( + [_FN3] = LAYOUT_61_ansi( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, From ccc0f5dca7a3c6367e94f5372b5d1c84af1fbcd2 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Sun, 3 Jul 2022 12:26:51 +1000 Subject: [PATCH 16/24] review changes recommended by tzarc --- keyboards/idobao/id61/id61.h | 16 ---------------- keyboards/idobao/id61/keymaps/idobao/keymap.c | 2 +- keyboards/idobao/id61/rules.mk | 3 ++- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/keyboards/idobao/id61/id61.h b/keyboards/idobao/id61/id61.h index 186c59972d49..d9bef6d02127 100644 --- a/keyboards/idobao/id61/id61.h +++ b/keyboards/idobao/id61/id61.h @@ -4,19 +4,3 @@ #pragma once #include "quantum.h" - -/* -#define LAYOUT( \ - k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k014, \ - k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, \ - k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k213, \ - k300, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, \ - k400, k401, k402, k406, k410, k411, k412, k413 \ -) { \ - { k000, k001, k002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, KC_NO, k014 }, \ - { k100, k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k113, KC_NO}, \ - { k200, k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, k211, KC_NO, k213, KC_NO}, \ - { k300, KC_NO, k302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, KC_NO, KC_NO}, \ - { k400, k401, k402, KC_NO, KC_NO, KC_NO, k406, KC_NO, KC_NO, KC_NO, k410, k411, k412, k413, KC_NO} \ -} -*/ diff --git a/keyboards/idobao/id61/keymaps/idobao/keymap.c b/keyboards/idobao/id61/keymaps/idobao/keymap.c index dbd6df7d8de2..da1f7b0d4ac8 100644 --- a/keyboards/idobao/id61/keymaps/idobao/keymap.c +++ b/keyboards/idobao/id61/keymaps/idobao/keymap.c @@ -71,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ - * │ ~ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ Del │ + * │ ' │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ Del │ * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ * │ │ │ ↑ │ │ │Tog│Hu+│Sa+│Br+│Sp+│PSc│Hom│End│ Ins │ * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ diff --git a/keyboards/idobao/id61/rules.mk b/keyboards/idobao/id61/rules.mk index eab741fd0aad..d034fbb12f62 100644 --- a/keyboards/idobao/id61/rules.mk +++ b/keyboards/idobao/id61/rules.mk @@ -1,4 +1,5 @@ -# This file intentionally left blank +# Copyright 2022 Vino Rodrigues (@vinorodrigues) +# SPDX-License-Identifier: GPL-2.0-or-later # ** settings are data driven & stored in `info.json` ** RGB_MATRIX_ENABLE = yes From 5353c7ec579fb797130c40093e63cd4aa0ffb537 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Sun, 24 Jul 2022 14:58:40 +1000 Subject: [PATCH 17/24] refactor special keys to common lib --- keyboards/idobao/id61/keymaps/idobao/keymap.c | 86 ++----------------- keyboards/idobao/id61/keymaps/idobao/rules.mk | 4 + keyboards/idobao/id61/specialk.c | 77 +++++++++++++++++ keyboards/idobao/id61/specialk.h | 15 ++++ 4 files changed, 104 insertions(+), 78 deletions(-) create mode 100644 keyboards/idobao/id61/specialk.c create mode 100644 keyboards/idobao/id61/specialk.h diff --git a/keyboards/idobao/id61/keymaps/idobao/keymap.c b/keyboards/idobao/id61/keymaps/idobao/keymap.c index da1f7b0d4ac8..ccc6dc668642 100644 --- a/keyboards/idobao/id61/keymaps/idobao/keymap.c +++ b/keyboards/idobao/id61/keymaps/idobao/keymap.c @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H +#include "specialk.h" #include "version.h" typedef union { @@ -121,58 +122,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; user_config_t user_config; -uint8_t mod_state; -bool delkey_registered; -bool keycode_raised[10]; - -bool ID61_process_special_k(uint16_t keycode, keyrecord_t *record, uint8_t k_norm, uint8_t k_spcl, uint8_t k_altr) { - - bool is_raised = get_highest_layer(layer_state|default_layer_state) != 0; - - if (record->event.pressed) { - keycode_raised[keycode - USER00] = is_raised; // save for key release event - if (is_raised) { - // *** Fn keyed *** - if (user_config.in_arrow_mode) { - // alternate key - register_code(k_altr); - } else { - // special key - register_code(k_spcl); - } - } else { - // *** normal, un-Fn'ed *** - if (user_config.in_arrow_mode) { - // special key - register_code(k_spcl); - } else { - // normal key - register_code(k_norm); - } - } - } else { - if (keycode_raised[keycode - USER00]) { - // *** Fn keyed *** - if (user_config.in_arrow_mode) { - // alternate key - unregister_code(k_altr); - } else { - // special key - unregister_code(k_spcl); - } - } else { - // *** normal, un-Fn'ed *** - if (user_config.in_arrow_mode) { - // special key - unregister_code(k_spcl); - } else { - // normal key - unregister_code(k_norm); - } - } - } - return false; -} #ifdef RGB_MATRIX_ENABLE @@ -271,9 +220,6 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { */ bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - mod_state = get_mods(); - switch (keycode) { // handle RGB toggle key - this ensures caps lock always works @@ -344,12 +290,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; - case KB_RSFT: return ID61_process_special_k(keycode, record, KC_RSFT, KC_UP, KC_PGUP); - case KB_RALT: return ID61_process_special_k(keycode, record, KC_RALT, KC_LEFT, KC_HOME); - case KB_RAPP: return ID61_process_special_k(keycode, record, KC_APP, KC_DOWN, KC_PGDN); - case KB_RCOM: return ID61_process_special_k(keycode, record, KC_RGUI, KC_LEFT, KC_HOME); - case KB_ROPT: return ID61_process_special_k(keycode, record, KC_RALT, KC_DOWN, KC_PGDN); - case KB_RCTL: return ID61_process_special_k(keycode, record, KC_RCTL, KC_RIGHT, KC_END); + case KB_RSFT: return ID61_process_special_k(keycode, record, user_config.in_arrow_mode, KC_RSFT, KC_UP, KC_PGUP); + case KB_RALT: return ID61_process_special_k(keycode, record, user_config.in_arrow_mode, KC_RALT, KC_LEFT, KC_HOME); + case KB_RAPP: return ID61_process_special_k(keycode, record, user_config.in_arrow_mode, KC_APP, KC_DOWN, KC_PGDN); + case KB_RCOM: return ID61_process_special_k(keycode, record, user_config.in_arrow_mode, KC_RGUI, KC_LEFT, KC_HOME); + case KB_ROPT: return ID61_process_special_k(keycode, record, user_config.in_arrow_mode, KC_RALT, KC_DOWN, KC_PGDN); + case KB_RCTL: return ID61_process_special_k(keycode, record, user_config.in_arrow_mode, KC_RCTL, KC_RIGHT, KC_END); // print firmware version case KB_VRSN: @@ -378,23 +324,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; // Shift + Backspace = Delete, see: https://docs.qmk.fm/#/feature_advanced_keycodes?id=shift-backspace-for-delete - case KC_BSPC: - if (record->event.pressed) { - if (mod_state & MOD_MASK_SHIFT) { - del_mods(MOD_MASK_SHIFT); - register_code(KC_DEL); - delkey_registered = true; - set_mods(mod_state); - return false; - } - } else { - if (delkey_registered) { - unregister_code(KC_DEL); - delkey_registered = false; - return false; - } - } - return true; + case KC_BSPC: return ID61_backspace_special(keycode, record); default: return true; /* Process all other keycodes normally */ diff --git a/keyboards/idobao/id61/keymaps/idobao/rules.mk b/keyboards/idobao/id61/keymaps/idobao/rules.mk index 974ef9966007..e18baf726141 100644 --- a/keyboards/idobao/id61/keymaps/idobao/rules.mk +++ b/keyboards/idobao/id61/keymaps/idobao/rules.mk @@ -1,3 +1,7 @@ +# Copyright 2022 Vino Rodrigues (@vinorodrigues) +# SPDX-License-Identifier: GPL-2.0-or-later LTO_ENABLE = yes VIA_ENABLE = yes + +SRC += specialk.c diff --git a/keyboards/idobao/id61/specialk.c b/keyboards/idobao/id61/specialk.c new file mode 100644 index 000000000000..a0bec83fb364 --- /dev/null +++ b/keyboards/idobao/id61/specialk.c @@ -0,0 +1,77 @@ +// Copyright 2022 Vino Rodrigues (@vinorodrigues) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "specialk.h" + +bool special_registered; +bool delkey_registered; +bool keycode_special[10]; + +bool ID61_process_special_k(uint16_t keycode, keyrecord_t *record, bool arrow_mode, uint8_t k_norm, uint8_t k_spcl, uint8_t k_altr) { + bool is_raised = get_highest_layer(layer_state|default_layer_state) != 0; + + if (record->event.pressed) { + keycode_special[keycode - USER00] = is_raised; // save for key release event + if (is_raised) { + // *** Fn keyed *** + if (arrow_mode) { + // alternate key + register_code(k_altr); + } else { + // special key + register_code(k_spcl); + } + } else { + // *** normal, un-Fn'ed *** + if (arrow_mode) { + // special key + register_code(k_spcl); + } else { + // normal key + register_code(k_norm); + } + } + } else { + if (keycode_special[keycode - USER00]) { + // *** Fn keyed *** + if (arrow_mode) { + // alternate key + unregister_code(k_altr); + } else { + // special key + unregister_code(k_spcl); + } + } else { + // *** normal, un-Fn'ed *** + if (arrow_mode) { + // special key + unregister_code(k_spcl); + } else { + // normal key + unregister_code(k_norm); + } + } + } + return false; +} + +bool ID61_backspace_special(uint16_t keycode, keyrecord_t *record) { + uint8_t mod_state = get_mods(); + + if (record->event.pressed) { + if (mod_state & MOD_MASK_SHIFT) { + del_mods(MOD_MASK_SHIFT); + register_code(KC_DEL); + delkey_registered = true; + set_mods(mod_state); + return false; + } + } else { + if (delkey_registered) { + unregister_code(KC_DEL); + delkey_registered = false; + return false; + } + } + return true; // normal backspace, pass on +} diff --git a/keyboards/idobao/id61/specialk.h b/keyboards/idobao/id61/specialk.h new file mode 100644 index 000000000000..f00ab04af6e5 --- /dev/null +++ b/keyboards/idobao/id61/specialk.h @@ -0,0 +1,15 @@ +// Copyright 2022 Vino Rodrigues (@vinorodrigues) +// SPDX-License-Identifier: GPL-2.0-or-later + +#ifndef _SPECIALK_H_ +#define _SPECIALK_H_ + +#include +#include +#include "util.h" +#include "quantum.h" + +bool ID61_process_special_k(uint16_t keycode, keyrecord_t *record, bool arrow_mode, uint8_t k_norm, uint8_t k_spcl, uint8_t k_altr); +bool ID61_backspace_special(uint16_t keycode, keyrecord_t *record); + +#endif /* _SPECIALK_H_ */ From b23d2f616b589936bf6dabb6f6405d24053db9a6 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Sun, 24 Jul 2022 19:41:46 +1000 Subject: [PATCH 18/24] rename layout and add info.json labels --- keyboards/idobao/id61/info.json | 124 +++++++++--------- .../idobao/id61/keymaps/default/keymap.c | 4 +- keyboards/idobao/id61/keymaps/idobao/keymap.c | 8 +- keyboards/idobao/id61/keymaps/via/keymap.c | 8 +- 4 files changed, 72 insertions(+), 72 deletions(-) diff --git a/keyboards/idobao/id61/info.json b/keyboards/idobao/id61/info.json index 06ef87b6524a..4c5270a9333f 100644 --- a/keyboards/idobao/id61/info.json +++ b/keyboards/idobao/id61/info.json @@ -27,73 +27,73 @@ "vid": "0x6964" }, "layouts": { - "LAYOUT_61_ansi": { + "LAYOUT_60_ansi_poker": { "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": [0, 12], "x":12, "y":0 }, - { "matrix": [0, 13], "x":13, "y":0, "w":2 }, + { "label": "Esc", "matrix": [0, 0], "x":0, "y":0 }, + { "label": "1!", "matrix": [0, 1], "x":1, "y":0 }, + { "label": "2@", "matrix": [0, 2], "x":2, "y":0 }, + { "label": "3#", "matrix": [0, 3], "x":3, "y":0 }, + { "label": "4$", "matrix": [0, 4], "x":4, "y":0 }, + { "label": "5%", "matrix": [0, 5], "x":5, "y":0 }, + { "label": "6^", "matrix": [0, 6], "x":6, "y":0 }, + { "label": "7&", "matrix": [0, 7], "x":7, "y":0 }, + { "label": "8*", "matrix": [0, 8], "x":8, "y":0 }, + { "label": "9(", "matrix": [0, 9], "x":9, "y":0 }, + { "label": "0)", "matrix": [0, 10], "x":10, "y":0 }, + { "label": "-_", "matrix": [0, 11], "x":11, "y":0 }, + { "label": "=+", "matrix": [0, 12], "x":12, "y":0 }, + { "label": "Backspace", "matrix": [0, 13], "x":13, "y":0, "w":2 }, - { "matrix": [1, 0], "x":0, "y":1, "w":1.5 }, - { "matrix": [1, 1], "x":1.5, "y":1 }, - { "matrix": [1, 2], "x":2.5, "y":1 }, - { "matrix": [1, 3], "x":3.5, "y":1 }, - { "matrix": [1, 4], "x":4.5, "y":1 }, - { "matrix": [1, 5], "x":5.5, "y":1 }, - { "matrix": [1, 6], "x":6.5, "y":1 }, - { "matrix": [1, 7], "x":7.5, "y":1 }, - { "matrix": [1, 8], "x":8.5, "y":1 }, - { "matrix": [1, 9], "x":9.5, "y":1 }, - { "matrix": [1, 10], "x":10.5, "y":1 }, - { "matrix": [1, 11], "x":11.5, "y":1 }, - { "matrix": [1, 12], "x":12.5, "y":1 }, - { "matrix": [1, 13], "x":13.5, "y":1, "w":1.5 }, + { "label": "Tab", "matrix": [1, 0], "x":0, "y":1, "w":1.5 }, + { "label": "Q", "matrix": [1, 1], "x":1.5, "y":1 }, + { "label": "W", "matrix": [1, 2], "x":2.5, "y":1 }, + { "label": "E", "matrix": [1, 3], "x":3.5, "y":1 }, + { "label": "R", "matrix": [1, 4], "x":4.5, "y":1 }, + { "label": "T", "matrix": [1, 5], "x":5.5, "y":1 }, + { "label": "Y", "matrix": [1, 6], "x":6.5, "y":1 }, + { "label": "U", "matrix": [1, 7], "x":7.5, "y":1 }, + { "label": "I", "matrix": [1, 8], "x":8.5, "y":1 }, + { "label": "O", "matrix": [1, 9], "x":9.5, "y":1 }, + { "label": "P", "matrix": [1, 10], "x":10.5, "y":1 }, + { "label": "[{", "matrix": [1, 11], "x":11.5, "y":1 }, + { "label": "]}", "matrix": [1, 12], "x":12.5, "y":1 }, + { "label": "\\|", "matrix": [1, 13], "x":13.5, "y":1, "w":1.5 }, - { "matrix": [2, 0], "x":0, "y":2, "w":1.75 }, - { "matrix": [2, 1], "x":1.75, "y":2 }, - { "matrix": [2, 2], "x":2.75, "y":2 }, - { "matrix": [2, 3], "x":3.75, "y":2 }, - { "matrix": [2, 4], "x":4.75, "y":2 }, - { "matrix": [2, 5], "x":5.75, "y":2 }, - { "matrix": [2, 6], "x":6.75, "y":2 }, - { "matrix": [2, 7], "x":7.75, "y":2 }, - { "matrix": [2, 8], "x":8.75, "y":2 }, - { "matrix": [2, 9], "x":9.75, "y":2 }, - { "matrix": [2, 10], "x":10.75, "y":2 }, - { "matrix": [2, 11], "x":11.75, "y":2 }, - { "matrix": [2, 12], "x":12.75, "y":2, "w":2.25 }, + { "label": "Caps Lock", "matrix": [2, 0], "x":0, "y":2, "w":1.75 }, + { "label": "A", "matrix": [2, 1], "x":1.75, "y":2 }, + { "label": "S", "matrix": [2, 2], "x":2.75, "y":2 }, + { "label": "D", "matrix": [2, 3], "x":3.75, "y":2 }, + { "label": "F", "matrix": [2, 4], "x":4.75, "y":2 }, + { "label": "G", "matrix": [2, 5], "x":5.75, "y":2 }, + { "label": "H", "matrix": [2, 6], "x":6.75, "y":2 }, + { "label": "J", "matrix": [2, 7], "x":7.75, "y":2 }, + { "label": "K", "matrix": [2, 8], "x":8.75, "y":2 }, + { "label": "L", "matrix": [2, 9], "x":9.75, "y":2 }, + { "label": ";:", "matrix": [2, 10], "x":10.75, "y":2 }, + { "label": "'\"", "matrix": [2, 11], "x":11.75, "y":2 }, + { "label": "Enter", "matrix": [2, 12], "x":12.75, "y":2, "w":2.25 }, - { "matrix": [3, 0], "x":0, "y":3, "w":2.25 }, - { "matrix": [3, 2], "x":2.25, "y":3 }, - { "matrix": [3, 3], "x":3.25, "y":3 }, - { "matrix": [3, 4], "x":4.25, "y":3 }, - { "matrix": [3, 5], "x":5.25, "y":3 }, - { "matrix": [3, 6], "x":6.25, "y":3 }, - { "matrix": [3, 7], "x":7.25, "y":3 }, - { "matrix": [3, 8], "x":8.25, "y":3 }, - { "matrix": [3, 9], "x":9.25, "y":3 }, - { "matrix": [3, 10], "x":10.25, "y":3 }, - { "matrix": [3, 11], "x":11.25, "y":3 }, - { "matrix": [3, 12], "x":12.25, "y":3, "w":2.75 }, + { "label": "Shift", "matrix": [3, 0], "x":0, "y":3, "w":2.25 }, + { "label": "Z", "matrix": [3, 2], "x":2.25, "y":3 }, + { "label": "X", "matrix": [3, 3], "x":3.25, "y":3 }, + { "label": "C", "matrix": [3, 4], "x":4.25, "y":3 }, + { "label": "V", "matrix": [3, 5], "x":5.25, "y":3 }, + { "label": "B", "matrix": [3, 6], "x":6.25, "y":3 }, + { "label": "N", "matrix": [3, 7], "x":7.25, "y":3 }, + { "label": "M", "matrix": [3, 8], "x":8.25, "y":3 }, + { "label": ",<", "matrix": [3, 9], "x":9.25, "y":3 }, + { "label": ".>", "matrix": [3, 10], "x":10.25, "y":3 }, + { "label": "/?", "matrix": [3, 11], "x":11.25, "y":3 }, + { "label": "Shift", "matrix": [3, 12], "x":12.25, "y":3, "w":2.75 }, - { "matrix": [4, 0], "x":0, "y":4, "w":1.25 }, - { "matrix": [4, 1], "x":1.25, "y":4, "w":1.25 }, - { "matrix": [4, 2], "x":2.5, "y":4, "w":1.25 }, - { "matrix": [4, 6], "x":3.75, "y":4, "w":6.25 }, - { "matrix": [4, 10], "x":10, "y":4, "w":1.25 }, - { "matrix": [4, 11], "x":11.25, "y":4, "w":1.25 }, - { "matrix": [4, 12], "x":12.5, "y":4, "w":1.25 }, - { "matrix": [4, 13], "x":13.75, "y":4, "w":1.25 } + { "label": "Ctrl", "matrix": [4, 0], "x":0, "y":4, "w":1.25 }, + { "label": "GUI", "matrix": [4, 1], "x":1.25, "y":4, "w":1.25 }, + { "label": "Alt", "matrix": [4, 2], "x":2.5, "y":4, "w":1.25 }, + { "label": "Space", "matrix": [4, 6], "x":3.75, "y":4, "w":6.25 }, + { "label": "Fn", "matrix": [4, 10], "x":10, "y":4, "w":1.25 }, + { "label": "Alt", "matrix": [4, 11], "x":11.25, "y":4, "w":1.25 }, + { "label": "Menu", "matrix": [4, 12], "x":12.5, "y":4, "w":1.25 }, + { "label": "Ctrl", "matrix": [4, 13], "x":13.75, "y":4, "w":1.25 } ] } } diff --git a/keyboards/idobao/id61/keymaps/default/keymap.c b/keyboards/idobao/id61/keymaps/default/keymap.c index b9dfed25987a..0663828968e3 100644 --- a/keyboards/idobao/id61/keymaps/default/keymap.c +++ b/keyboards/idobao/id61/keymaps/default/keymap.c @@ -17,7 +17,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │Ctrl│Win │Alt │ │ Fn │Alt │Menu│Ctrl│ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [0] = LAYOUT_61_ansi( + [0] = LAYOUT_60_ansi_poker( KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, @@ -38,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ │ │ │ │ │ │ │ │ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [1] = LAYOUT_61_ansi( + [1] = LAYOUT_60_ansi_poker( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_UP, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_PSCR, KC_HOME, KC_END, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_PGUP, KC_PGDN, _______, diff --git a/keyboards/idobao/id61/keymaps/idobao/keymap.c b/keyboards/idobao/id61/keymaps/idobao/keymap.c index ccc6dc668642..ba82e98a5a5d 100644 --- a/keyboards/idobao/id61/keymaps/idobao/keymap.c +++ b/keyboards/idobao/id61/keymaps/idobao/keymap.c @@ -62,7 +62,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │Ctrl│Win │Alt │ │Fn1 │←Alt│↓Mnu│→Ctl│ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [_BASE] = LAYOUT_61_ansi( + [_BASE] = LAYOUT_60_ansi_poker( KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, SK_LT1C, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, @@ -83,7 +83,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ │ │ │ │ │ │ │ │ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [_FN1] = LAYOUT_61_ansi( + [_FN1] = LAYOUT_60_ansi_poker( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KB_ARRW, _______, KC_UP, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_PSCR, KC_HOME, KC_END, KC_INS, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, KC_PGUP, _______, @@ -104,7 +104,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ │ │ │ │ │ │ │ │ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [_FN2] = LAYOUT_61_ansi( + [_FN2] = LAYOUT_60_ansi_poker( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -112,7 +112,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______ ), - [_FN3] = LAYOUT_61_ansi( + [_FN3] = LAYOUT_60_ansi_poker( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/idobao/id61/keymaps/via/keymap.c b/keyboards/idobao/id61/keymaps/via/keymap.c index 6342b2496992..5aca29fce8a8 100644 --- a/keyboards/idobao/id61/keymaps/via/keymap.c +++ b/keyboards/idobao/id61/keymaps/via/keymap.c @@ -17,7 +17,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │Ctrl│Win │Alt │ │ Fn │Alt │Menu│Ctrl│ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [0] = LAYOUT_61_ansi( + [0] = LAYOUT_60_ansi_poker( KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, @@ -38,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ │ │ │ │ │ │ │ │ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [1] = LAYOUT_61_ansi( + [1] = LAYOUT_60_ansi_poker( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_UP, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_PSCR, KC_HOME, KC_END, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_PGUP, KC_PGDN, _______, @@ -59,7 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ │ │ │ │ │ │ │ │ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [2] = LAYOUT_61_ansi( + [2] = LAYOUT_60_ansi_poker( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -67,7 +67,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______ ), - [3] = LAYOUT_61_ansi( + [3] = LAYOUT_60_ansi_poker( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, From 4c3e3ba54f86d696a5ddc7a51c2c78e026d8b5f9 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Sun, 24 Jul 2022 19:42:38 +1000 Subject: [PATCH 19/24] account for 15 possible USER keys --- keyboards/idobao/id61/specialk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/idobao/id61/specialk.c b/keyboards/idobao/id61/specialk.c index a0bec83fb364..818195c2d2d8 100644 --- a/keyboards/idobao/id61/specialk.c +++ b/keyboards/idobao/id61/specialk.c @@ -5,13 +5,13 @@ bool special_registered; bool delkey_registered; -bool keycode_special[10]; +bool keycode_raised[15]; bool ID61_process_special_k(uint16_t keycode, keyrecord_t *record, bool arrow_mode, uint8_t k_norm, uint8_t k_spcl, uint8_t k_altr) { bool is_raised = get_highest_layer(layer_state|default_layer_state) != 0; if (record->event.pressed) { - keycode_special[keycode - USER00] = is_raised; // save for key release event + keycode_raised[keycode - USER00] = is_raised; // save for key release event if (is_raised) { // *** Fn keyed *** if (arrow_mode) { @@ -32,7 +32,7 @@ bool ID61_process_special_k(uint16_t keycode, keyrecord_t *record, bool arrow_mo } } } else { - if (keycode_special[keycode - USER00]) { + if (keycode_raised[keycode - USER00]) { // *** Fn keyed *** if (arrow_mode) { // alternate key From 83d538077740162ebc3ee048f51e841a69748d6b Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Tue, 26 Jul 2022 18:47:22 +1000 Subject: [PATCH 20/24] post drashna review --- keyboards/idobao/id61/{ => keymaps/idobao}/specialk.c | 0 keyboards/idobao/id61/{ => keymaps/idobao}/specialk.h | 5 +---- 2 files changed, 1 insertion(+), 4 deletions(-) rename keyboards/idobao/id61/{ => keymaps/idobao}/specialk.c (100%) rename keyboards/idobao/id61/{ => keymaps/idobao}/specialk.h (84%) diff --git a/keyboards/idobao/id61/specialk.c b/keyboards/idobao/id61/keymaps/idobao/specialk.c similarity index 100% rename from keyboards/idobao/id61/specialk.c rename to keyboards/idobao/id61/keymaps/idobao/specialk.c diff --git a/keyboards/idobao/id61/specialk.h b/keyboards/idobao/id61/keymaps/idobao/specialk.h similarity index 84% rename from keyboards/idobao/id61/specialk.h rename to keyboards/idobao/id61/keymaps/idobao/specialk.h index f00ab04af6e5..a2ec124de8a9 100644 --- a/keyboards/idobao/id61/specialk.h +++ b/keyboards/idobao/id61/keymaps/idobao/specialk.h @@ -1,8 +1,7 @@ // Copyright 2022 Vino Rodrigues (@vinorodrigues) // SPDX-License-Identifier: GPL-2.0-or-later -#ifndef _SPECIALK_H_ -#define _SPECIALK_H_ +#pragma once #include #include @@ -11,5 +10,3 @@ bool ID61_process_special_k(uint16_t keycode, keyrecord_t *record, bool arrow_mode, uint8_t k_norm, uint8_t k_spcl, uint8_t k_altr); bool ID61_backspace_special(uint16_t keycode, keyrecord_t *record); - -#endif /* _SPECIALK_H_ */ From 3a89ec2124e1b1be0933e32aaff631698cf4b72d Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Sun, 4 Sep 2022 23:04:55 +1000 Subject: [PATCH 21/24] Fn Arrow keys added --- keyboards/idobao/id61/keymaps/default/keymap.c | 12 ++++++------ keyboards/idobao/id61/keymaps/via/keymap.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/keyboards/idobao/id61/keymaps/default/keymap.c b/keyboards/idobao/id61/keymaps/default/keymap.c index 0663828968e3..8f3680877963 100644 --- a/keyboards/idobao/id61/keymaps/default/keymap.c +++ b/keyboards/idobao/id61/keymaps/default/keymap.c @@ -29,20 +29,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ * │ ~ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │ * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │Up │ │ │Tog│Hu+│Sa+│Br+│Sp+│PSc│Hom│End│ │ + * │ │ │ ↑ │ │ │Tog│Hu+│Sa+│Br+│Sp+│PSc│Hom│End│ │ * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │Lf │Dn │Rt │ │Mod│Hu-│Sa-│Br-│Sp-│PUp│PDn│ │ + * │ │ ← │ ↓ │ → │ │Mod│Hu-│Sa-│Br-│Sp-│PUp│PDn│ │ * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │Rst│NKR│ │ │Ins│Del│ │ + * │ │ │ │ │ │Rst│NKR│ │ │Ins│Del│ ↑ │ * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ + * │ │ │ │ │ │ ← │ ↓ │ → │ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ [1] = LAYOUT_60_ansi_poker( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_UP, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_PSCR, KC_HOME, KC_END, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_PGUP, KC_PGDN, _______, - _______, _______, _______, _______, _______, QK_BOOT, NK_TOGG, _______, _______, KC_INS, KC_DEL, _______, - _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, QK_BOOT, NK_TOGG, _______, _______, KC_INS, KC_DEL, KC_UP, + _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT ) }; diff --git a/keyboards/idobao/id61/keymaps/via/keymap.c b/keyboards/idobao/id61/keymaps/via/keymap.c index 5aca29fce8a8..a20c937c62f6 100644 --- a/keyboards/idobao/id61/keymaps/via/keymap.c +++ b/keyboards/idobao/id61/keymaps/via/keymap.c @@ -29,21 +29,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ * │ ~ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │ * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │Up │ │ │Tog│Hu+│Sa+│Br+│Sp+│PSc│Hom│End│ │ + * │ │ │ ↑ │ │ │Tog│Hu+│Sa+│Br+│Sp+│PSc│Hom│End│ │ * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │Lf │Dn │Rt │ │Mod│Hu-│Sa-│Br-│Sp-│PUp│PDn│ │ + * │ │ ← │ ↓ │ → │ │Mod│Hu-│Sa-│Br-│Sp-│PUp│PDn│ │ * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ - * │ │ │ │ │ │Rst│NKR│ │ │Ins│Del│ │ + * │ │ │ │ │ │Rst│NKR│ │ │Ins│Del│ ↑ │ * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ - * │ │ │ │ │ │ │ │ │ + * │ │ │ │ │ │ ← │ ↓ │ → │ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ [1] = LAYOUT_60_ansi_poker( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_UP, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_PSCR, KC_HOME, KC_END, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_PGUP, KC_PGDN, _______, - _______, _______, _______, _______, _______, QK_BOOT, NK_TOGG, _______, _______, KC_INS, KC_DEL, _______, - _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, QK_BOOT, NK_TOGG, _______, _______, KC_INS, KC_DEL, KC_UP, + _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT ), /* From 673ed890cfd273606a57997b4210087a64e33264 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Mon, 5 Sep 2022 20:46:13 +1000 Subject: [PATCH 22/24] post review edits --- keyboards/idobao/id61/config.h | 4 ++-- keyboards/idobao/id61/{post.rules.mk => post_rules.mk} | 0 keyboards/idobao/id61/readme.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename keyboards/idobao/id61/{post.rules.mk => post_rules.mk} (100%) diff --git a/keyboards/idobao/id61/config.h b/keyboards/idobao/id61/config.h index 7ae1564bdd80..fb375de69ccb 100644 --- a/keyboards/idobao/id61/config.h +++ b/keyboards/idobao/id61/config.h @@ -21,11 +21,11 @@ #ifndef ID61_DISABLE_UNDERGLOW #define DRIVER_LED_TOTAL 71 #else - #define DRIVER_LED_TOTAL (71 - 10) + #define DRIVER_LED_TOTAL 61 // = 71 - 10 #endif #define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended - #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 180 // limits maximum brightness of LEDs to x out of 255. If not defined maximum brightness is set to 255 + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to {x} out of 255. If not defined maximum brightness is set to 255 #define RGB_MATRIX_KEYPRESSES diff --git a/keyboards/idobao/id61/post.rules.mk b/keyboards/idobao/id61/post_rules.mk similarity index 100% rename from keyboards/idobao/id61/post.rules.mk rename to keyboards/idobao/id61/post_rules.mk diff --git a/keyboards/idobao/id61/readme.md b/keyboards/idobao/id61/readme.md index 8c07d78b67e2..aa3821f6da43 100644 --- a/keyboards/idobao/id61/readme.md +++ b/keyboards/idobao/id61/readme.md @@ -2,7 +2,7 @@ ![IDOBAO ID61](https://i.imgur.com/Lu6SOyOh.png) -*The ID61 Keyboard Kit brings a tailored gasket-mounted build to an ultra-compact 60% layout with a unique ribbed side texture.* +The ID61 Keyboard Kit brings a tailored gasket-mounted build to an ultra-compact 60% layout with a unique ribbed side texture. ## ANSI Support From 5a28ef6264a0011f0f52cae206933a2c082c8f34 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues Date: Mon, 5 Sep 2022 21:38:33 +1000 Subject: [PATCH 23/24] use bitmask instead of bool array in specialk.c --- keyboards/idobao/id61/keymaps/idobao/keymap.c | 2 +- .../idobao/id61/keymaps/idobao/specialk.c | 21 ++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/keyboards/idobao/id61/keymaps/idobao/keymap.c b/keyboards/idobao/id61/keymaps/idobao/keymap.c index ba82e98a5a5d..1bc235d41d15 100644 --- a/keyboards/idobao/id61/keymaps/idobao/keymap.c +++ b/keyboards/idobao/id61/keymaps/idobao/keymap.c @@ -74,7 +74,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ * │ ' │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ Del │ * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ - * │ │ │ ↑ │ │ │Tog│Hu+│Sa+│Br+│Sp+│PSc│Hom│End│ Ins │ + * │ArwMd│ │ ↑ │ │ │Tog│Hu+│Sa+│Br+│Sp+│PSc│Hom│End│ Ins │ * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ * │ │ ← │ ↓ │ → │ │Mod│Hu-│Sa-│Br-│Sp-│ │PUp│ │ * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ diff --git a/keyboards/idobao/id61/keymaps/idobao/specialk.c b/keyboards/idobao/id61/keymaps/idobao/specialk.c index 818195c2d2d8..358d0cb76428 100644 --- a/keyboards/idobao/id61/keymaps/idobao/specialk.c +++ b/keyboards/idobao/id61/keymaps/idobao/specialk.c @@ -3,15 +3,26 @@ #include "specialk.h" -bool special_registered; -bool delkey_registered; -bool keycode_raised[15]; +bool delkey_registered = false; +uint32_t __keycode_raised = 0; + +bool get_keycode_raised(uint8_t n) { + return __keycode_raised & (1 << n); +} + +void set_keycode_raised(uint8_t n, bool b) { + if (b) { + __keycode_raised |= 1 << n; + } else { + __keycode_raised &= ~(1 << n); + } +} bool ID61_process_special_k(uint16_t keycode, keyrecord_t *record, bool arrow_mode, uint8_t k_norm, uint8_t k_spcl, uint8_t k_altr) { bool is_raised = get_highest_layer(layer_state|default_layer_state) != 0; if (record->event.pressed) { - keycode_raised[keycode - USER00] = is_raised; // save for key release event + set_keycode_raised(keycode - USER00, is_raised); // save for key release event if (is_raised) { // *** Fn keyed *** if (arrow_mode) { @@ -32,7 +43,7 @@ bool ID61_process_special_k(uint16_t keycode, keyrecord_t *record, bool arrow_mo } } } else { - if (keycode_raised[keycode - USER00]) { + if (get_keycode_raised(keycode - USER00)) { // *** Fn keyed *** if (arrow_mode) { // alternate key From d03f35d2e8683be183784d86f08b1595e8ca6148 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues <366673+vinorodrigues@users.noreply.github.com> Date: Sun, 9 Oct 2022 11:03:06 +1100 Subject: [PATCH 24/24] move to community layout --- keyboards/idobao/id61/info.json | 3 ++- keyboards/idobao/id61/keymaps/default/keymap.c | 4 ++-- keyboards/idobao/id61/keymaps/idobao/keymap.c | 8 ++++---- keyboards/idobao/id61/keymaps/via/keymap.c | 8 ++++---- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/keyboards/idobao/id61/info.json b/keyboards/idobao/id61/info.json index 4c5270a9333f..2980d0bfdc96 100644 --- a/keyboards/idobao/id61/info.json +++ b/keyboards/idobao/id61/info.json @@ -26,8 +26,9 @@ "pid": "0x0061", "vid": "0x6964" }, + "community_layouts": ["60_ansi"], "layouts": { - "LAYOUT_60_ansi_poker": { + "LAYOUT_60_ansi": { "layout": [ { "label": "Esc", "matrix": [0, 0], "x":0, "y":0 }, { "label": "1!", "matrix": [0, 1], "x":1, "y":0 }, diff --git a/keyboards/idobao/id61/keymaps/default/keymap.c b/keyboards/idobao/id61/keymaps/default/keymap.c index 8f3680877963..3d6fe4232f22 100644 --- a/keyboards/idobao/id61/keymaps/default/keymap.c +++ b/keyboards/idobao/id61/keymaps/default/keymap.c @@ -17,7 +17,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │Ctrl│Win │Alt │ │ Fn │Alt │Menu│Ctrl│ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [0] = LAYOUT_60_ansi_poker( + [0] = LAYOUT_60_ansi( KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, @@ -38,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ │ │ │ │ │ ← │ ↓ │ → │ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [1] = LAYOUT_60_ansi_poker( + [1] = LAYOUT_60_ansi( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_UP, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_PSCR, KC_HOME, KC_END, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_PGUP, KC_PGDN, _______, diff --git a/keyboards/idobao/id61/keymaps/idobao/keymap.c b/keyboards/idobao/id61/keymaps/idobao/keymap.c index 1bc235d41d15..8315d1498db1 100644 --- a/keyboards/idobao/id61/keymaps/idobao/keymap.c +++ b/keyboards/idobao/id61/keymaps/idobao/keymap.c @@ -62,7 +62,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │Ctrl│Win │Alt │ │Fn1 │←Alt│↓Mnu│→Ctl│ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [_BASE] = LAYOUT_60_ansi_poker( + [_BASE] = LAYOUT_60_ansi( KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, SK_LT1C, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, @@ -83,7 +83,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ │ │ │ │ │ │ │ │ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [_FN1] = LAYOUT_60_ansi_poker( + [_FN1] = LAYOUT_60_ansi( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KB_ARRW, _______, KC_UP, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_PSCR, KC_HOME, KC_END, KC_INS, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, KC_PGUP, _______, @@ -104,7 +104,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ │ │ │ │ │ │ │ │ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [_FN2] = LAYOUT_60_ansi_poker( + [_FN2] = LAYOUT_60_ansi( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -112,7 +112,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______ ), - [_FN3] = LAYOUT_60_ansi_poker( + [_FN3] = LAYOUT_60_ansi( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/idobao/id61/keymaps/via/keymap.c b/keyboards/idobao/id61/keymaps/via/keymap.c index a20c937c62f6..6935194df843 100644 --- a/keyboards/idobao/id61/keymaps/via/keymap.c +++ b/keyboards/idobao/id61/keymaps/via/keymap.c @@ -17,7 +17,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │Ctrl│Win │Alt │ │ Fn │Alt │Menu│Ctrl│ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [0] = LAYOUT_60_ansi_poker( + [0] = LAYOUT_60_ansi( KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, @@ -38,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ │ │ │ │ │ ← │ ↓ │ → │ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [1] = LAYOUT_60_ansi_poker( + [1] = LAYOUT_60_ansi( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_UP, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_PSCR, KC_HOME, KC_END, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_PGUP, KC_PGDN, _______, @@ -59,7 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ │ │ │ │ │ │ │ │ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ */ - [2] = LAYOUT_60_ansi_poker( + [2] = LAYOUT_60_ansi( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -67,7 +67,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______ ), - [3] = LAYOUT_60_ansi_poker( + [3] = LAYOUT_60_ansi( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,