From 7d54cc4885461014ea641d8b7214eee90817bde1 Mon Sep 17 00:00:00 2001 From: vinniefranco Date: Tue, 10 Dec 2024 15:19:39 -0600 Subject: [PATCH 01/48] Adding Crosses keeb --- keyboards/gggw/crosses/config.h | 50 ++ keyboards/gggw/crosses/crosses-font.c | 228 +++++++++ keyboards/gggw/crosses/halconf.h | 7 + keyboards/gggw/crosses/keyboard.json | 84 ++++ .../keymaps/default/features/achordion.c | 364 ++++++++++++++ .../keymaps/default/features/achordion.h | 190 +++++++ .../gggw/crosses/keymaps/default/keymap.c | 462 ++++++++++++++++++ .../gggw/crosses/keymaps/default/rules.mk | 4 + keyboards/gggw/crosses/mcuconf.h | 9 + keyboards/gggw/crosses/readme.md | 27 + keyboards/gggw/crosses/rules.mk | 3 + 11 files changed, 1428 insertions(+) create mode 100644 keyboards/gggw/crosses/config.h create mode 100644 keyboards/gggw/crosses/crosses-font.c create mode 100644 keyboards/gggw/crosses/halconf.h create mode 100644 keyboards/gggw/crosses/keyboard.json create mode 100644 keyboards/gggw/crosses/keymaps/default/features/achordion.c create mode 100644 keyboards/gggw/crosses/keymaps/default/features/achordion.h create mode 100644 keyboards/gggw/crosses/keymaps/default/keymap.c create mode 100644 keyboards/gggw/crosses/keymaps/default/rules.mk create mode 100644 keyboards/gggw/crosses/mcuconf.h create mode 100644 keyboards/gggw/crosses/readme.md create mode 100644 keyboards/gggw/crosses/rules.mk diff --git a/keyboards/gggw/crosses/config.h b/keyboards/gggw/crosses/config.h new file mode 100644 index 00000000000..0c2a8c2dbc5 --- /dev/null +++ b/keyboards/gggw/crosses/config.h @@ -0,0 +1,50 @@ +#pragma once + +#define SERIAL_PIO_USE_PIO1 + +/* + * PMW3360 Setup + */ + +#define SPLIT_POINTING_ENABLE + +#define POINTING_DEVICE_RIGHT +#define POINTING_DEVICE_INVERT_Y +#define POINTING_DEVICE_TASK_THROTTLE_MS 10 +#define POINTING_DEVICE_AUTO_MOUSE_ENABLE +#define AUTO_MOUSE_TIME 300 + +#define MASTER_LEFT + +#define SPI_SCK_PIN GP2 +#define SPI_MOSI_PIN GP3 +#define SPI_MISO_PIN GP0 +#define PMW33XX_CS_PIN GP6 + +#define MOUSE_EXTENDED_REPORT +#define POINTING_DEVICE_DEBUG + +#define SCROLL_DIVISOR_H 8.0 +#define SCROLL_DIVISOR_V 8.0 + +/* + * OLED + */ +#define I2C_DRIVER I2CD1 +#define I2C1_SCL_PIN GP15 +#define I2C1_SDA_PIN GP14 + +/* + * Reset + */ +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET + +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP17 +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 1000U +#define PERMISSIVE_HOLD +#define QUICK_TAP_TERM_PER_KEY + +/* + * Font + */ +#define OLED_FONT_H "crosses-font.c" diff --git a/keyboards/gggw/crosses/crosses-font.c b/keyboards/gggw/crosses/crosses-font.c new file mode 100644 index 00000000000..04d8239d408 --- /dev/null +++ b/keyboards/gggw/crosses/crosses-font.c @@ -0,0 +1,228 @@ +#include "progmem.h" + +static const unsigned char PROGMEM font[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, + 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, + 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, + 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, + 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, + 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, + 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x80, 0x80, 0x80, 0xF8, + 0xF8, 0xF8, 0x80, 0x80, 0x80, 0x80, + 0x00, 0x00, 0x00, 0xE0, 0xF0, 0xF8, + 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, + 0x38, 0x38, 0x78, 0x70, 0x60, 0x00, + 0x00, 0xF8, 0xF8, 0xF8, 0x38, 0x38, + 0x38, 0x38, 0x38, 0xB8, 0xF8, 0xF0, + 0xE0, 0x00, 0xE0, 0xF0, 0xF8, 0x38, + 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, + 0x38, 0xF8, 0xF0, 0xE0, 0x00, 0x00, + 0xF0, 0xF8, 0xF8, 0xB8, 0xB8, 0xB8, + 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0x00, + 0x00, 0x00, 0xE0, 0xF0, 0xF8, 0xB8, + 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, + 0xB8, 0x38, 0x00, 0x00, 0xB8, 0xB8, + 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, + 0xB8, 0xB8, 0xB8, 0x38, 0x00, 0x00, + 0xE0, 0xF0, 0xF8, 0xB8, 0xB8, 0xB8, + 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, + 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, + 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, + 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, + 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, + 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, + 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x03, 0x03, 0x03, 0x3B, + 0x3B, 0x3B, 0x03, 0x03, 0x03, 0x03, + 0x00, 0x00, 0x00, 0x0B, 0x1B, 0x3B, + 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, + 0x38, 0x38, 0x3C, 0x1C, 0x0C, 0x00, + 0x00, 0x3B, 0x3B, 0x3B, 0x03, 0x03, + 0x03, 0x0B, 0x1B, 0x3B, 0x39, 0x31, + 0x20, 0x00, 0x0B, 0x1B, 0x3B, 0x38, + 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, + 0x38, 0x3B, 0x1B, 0x0B, 0x00, 0x00, + 0x39, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, + 0x3B, 0x3B, 0x3B, 0x3B, 0x3F, 0x1F, + 0x0E, 0x00, 0x38, 0x39, 0x3B, 0x3B, + 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, + 0x3F, 0x1F, 0x0E, 0x00, 0x0F, 0x1F, + 0x3F, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, + 0x3B, 0x3B, 0x3B, 0x38, 0x38, 0x00, + 0x00, 0x39, 0x3B, 0x3B, 0x3B, 0x3B, + 0x3B, 0x3B, 0x3B, 0x3B, 0x3F, 0x1F, + 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/keyboards/gggw/crosses/halconf.h b/keyboards/gggw/crosses/halconf.h new file mode 100644 index 00000000000..56b3c1faffc --- /dev/null +++ b/keyboards/gggw/crosses/halconf.h @@ -0,0 +1,7 @@ +#pragma once + +#define HAL_USE_SPI TRUE +#define HAL_USE_I2C TRUE +#define PAL_USE_CALLBACKS TRUE + +#include_next "halconf.h" diff --git a/keyboards/gggw/crosses/keyboard.json b/keyboards/gggw/crosses/keyboard.json new file mode 100644 index 00000000000..3a0bd1f49d3 --- /dev/null +++ b/keyboards/gggw/crosses/keyboard.json @@ -0,0 +1,84 @@ +{ + "manufacturer": "Good Great Grand Wonderful", + "keyboard_name": "Crosses", + "maintainer": "vinniefranco", + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "command": false, + "console": true, + "extrakey": true, + "mousekey": true, + "nkro": true + }, + "matrix_pins": { + "cols": ["GP26", "GP22", "GP21", "GP23", "GP20"], + "rows": ["GP27", "GP28", "GP29", "GP9"] + }, + "processor": "RP2040", + "split": { + "enabled": true, + "serial": { + "driver": "vendor", + "pin": "GP4" + }, + "transport": { + "sync": { + "matrix_state": true, + "layer_state": true + } + } + }, + "tapping": { + "term": 195 + }, + "url": "", + "usb": { + "device_version": "0.3.0", + "pid": "0x5647", + "vid": "0x3034" + }, + "layouts": { + "LAYOUT_default": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0.25}, + {"matrix": [0, 1], "x": 1, "y": 0.125}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0.125}, + {"matrix": [0, 4], "x": 4, "y": 0.25}, + {"matrix": [4, 4], "x": 7, "y": 0.25}, + {"matrix": [4, 3], "x": 8, "y": 0.125}, + {"matrix": [4, 2], "x": 9, "y": 0}, + {"matrix": [4, 1], "x": 10, "y": 0.125}, + {"matrix": [4, 0], "x": 11, "y": 0.25}, + {"matrix": [1, 0], "x": 0, "y": 1.25}, + {"matrix": [1, 1], "x": 1, "y": 1.125}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1.125}, + {"matrix": [1, 4], "x": 4, "y": 1.25}, + {"matrix": [5, 4], "x": 7, "y": 1.25}, + {"matrix": [5, 3], "x": 8, "y": 1.125}, + {"matrix": [5, 2], "x": 9, "y": 1}, + {"matrix": [5, 1], "x": 10, "y": 1.125}, + {"matrix": [5, 0], "x": 11, "y": 1.25}, + {"matrix": [2, 0], "x": 0, "y": 2.25}, + {"matrix": [2, 1], "x": 1, "y": 2.125}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2.125}, + {"matrix": [2, 4], "x": 4, "y": 2.25}, + {"matrix": [6, 4], "x": 7, "y": 2.25}, + {"matrix": [6, 3], "x": 8, "y": 2.125}, + {"matrix": [6, 2], "x": 9, "y": 2}, + {"matrix": [6, 1], "x": 10, "y": 2.125}, + {"matrix": [6, 0], "x": 11, "y": 2.25}, + {"matrix": [3, 2], "x": 2.5, "y": 3.25}, + {"matrix": [3, 3], "x": 3.5, "y": 3.5}, + {"matrix": [3, 4], "x": 4.5, "y": 3.75}, + {"matrix": [7, 4], "x": 6.5, "y": 3.75}, + {"matrix": [7, 3], "x": 7.5, "y": 3.5}, + {"matrix": [7, 2], "x": 8.5, "y": 3.25} + ] + } + } +} diff --git a/keyboards/gggw/crosses/keymaps/default/features/achordion.c b/keyboards/gggw/crosses/keymaps/default/features/achordion.c new file mode 100644 index 00000000000..91e545e1466 --- /dev/null +++ b/keyboards/gggw/crosses/keymaps/default/features/achordion.c @@ -0,0 +1,364 @@ +// Copyright 2022-2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file achordion.c + * @brief Achordion implementation + * + * For full documentation, see + * + */ + +#include "achordion.h" + +#if !defined(IS_QK_MOD_TAP) +// Attempt to detect out-of-date QMK installation, which would fail with +// implicit-function-declaration errors in the code below. +# error "achordion: QMK version is too old to build. Please update QMK." +#else + +// Copy of the `record` and `keycode` args for the current active tap-hold key. +static keyrecord_t tap_hold_record; +static uint16_t tap_hold_keycode = KC_NO; +// Timeout timer. When it expires, the key is considered held. +static uint16_t hold_timer = 0; +// Eagerly applied mods, if any. +static uint8_t eager_mods = 0; +// Flag to determine whether another key is pressed within the timeout. +static bool pressed_another_key_before_release = false; + +# ifdef ACHORDION_STREAK +// Timer for typing streak +static uint16_t streak_timer = 0; +# else +// When disabled, is_streak is never true +# define is_streak false +# endif + +// Achordion's current state. +enum { + // A tap-hold key is pressed, but hasn't yet been settled as tapped or held. + STATE_UNSETTLED, + // Achordion is inactive. + STATE_RELEASED, + // Active tap-hold key has been settled as tapped. + STATE_TAPPING, + // Active tap-hold key has been settled as held. + STATE_HOLDING, + // This state is set while calling `process_record()`, which will recursively + // call `process_achordion()`. This state is checked so that we don't process + // events generated by Achordion and potentially create an infinite loop. + STATE_RECURSING, +}; +static uint8_t achordion_state = STATE_RELEASED; + +# ifdef ACHORDION_STREAK +static void update_streak_timer(uint16_t keycode, keyrecord_t* record) { + if (achordion_streak_continue(keycode)) { + // We use 0 to represent an unset timer, so `| 1` to force a nonzero value. + streak_timer = record->event.time | 1; + } else { + streak_timer = 0; + } +} +# endif + +// Presses or releases eager_mods through process_action(), which skips the +// usual event handling pipeline. The action is considered as a mod-tap hold or +// release, with Retro Tapping if enabled. +static void process_eager_mods_action(void) { + action_t action; + action.code = ACTION_MODS_TAP_KEY(eager_mods, QK_MOD_TAP_GET_TAP_KEYCODE(tap_hold_keycode)); + process_action(&tap_hold_record, action); +} + +// Calls `process_record()` with state set to RECURSING. +static void recursively_process_record(keyrecord_t* record, uint8_t state) { + achordion_state = STATE_RECURSING; +# if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) + int8_t mouse_key_tracker = get_auto_mouse_key_tracker(); +# endif + process_record(record); +# if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) + set_auto_mouse_key_tracker(mouse_key_tracker); +# endif + achordion_state = state; +} + +// Sends hold press event and settles the active tap-hold key as held. +static void settle_as_hold(void) { + if (eager_mods) { + // If eager mods are being applied, nothing needs to be done besides + // updating the state. + dprintln("Achordion: Settled eager mod as hold."); + achordion_state = STATE_HOLDING; + } else { + // Create hold press event. + dprintln("Achordion: Plumbing hold press."); + recursively_process_record(&tap_hold_record, STATE_HOLDING); + } +} + +// Sends tap press and release and settles the active tap-hold key as tapped. +static void settle_as_tap(void) { + if (eager_mods) { // Clear eager mods if set. +# if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) +# ifdef DUMMY_MOD_NEUTRALIZER_KEYCODE + neutralize_flashing_modifiers(get_mods()); +# endif // DUMMY_MOD_NEUTRALIZER_KEYCODE +# endif // defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) + tap_hold_record.event.pressed = false; + // To avoid falsely triggering Retro Tapping, process eager mods release as + // a regular mods release rather than a mod-tap release. + action_t action; + action.code = ACTION_MODS(eager_mods); + process_action(&tap_hold_record, action); + eager_mods = 0; + } + + dprintln("Achordion: Plumbing tap press."); + tap_hold_record.event.pressed = true; + tap_hold_record.tap.count = 1; // Revise event as a tap. + tap_hold_record.tap.interrupted = true; + // Plumb tap press event. + recursively_process_record(&tap_hold_record, STATE_TAPPING); + + send_keyboard_report(); +# if TAP_CODE_DELAY > 0 + wait_ms(TAP_CODE_DELAY); +# endif // TAP_CODE_DELAY > 0 + + dprintln("Achordion: Plumbing tap release."); + tap_hold_record.event.pressed = false; + // Plumb tap release event. + recursively_process_record(&tap_hold_record, STATE_TAPPING); +} + +bool process_achordion(uint16_t keycode, keyrecord_t* record) { + // Don't process events that Achordion generated. + if (achordion_state == STATE_RECURSING) { + return true; + } + + // Determine whether the current event is for a mod-tap or layer-tap key. + const bool is_mt = IS_QK_MOD_TAP(keycode); + const bool is_tap_hold = is_mt || IS_QK_LAYER_TAP(keycode); + // Check that this is a normal key event, don't act on combos. + const bool is_key_event = IS_KEYEVENT(record->event); + + // Event while no tap-hold key is active. + if (achordion_state == STATE_RELEASED) { + if (is_tap_hold && record->tap.count == 0 && record->event.pressed && is_key_event) { + // A tap-hold key is pressed and considered by QMK as "held". + const uint16_t timeout = achordion_timeout(keycode); + if (timeout > 0) { + achordion_state = STATE_UNSETTLED; + // Save info about this key. + tap_hold_keycode = keycode; + tap_hold_record = *record; + hold_timer = record->event.time + timeout; + pressed_another_key_before_release = false; + eager_mods = 0; + + if (is_mt) { // Apply mods immediately if they are "eager." + const uint8_t mod = mod_config(QK_MOD_TAP_GET_MODS(keycode)); + if ( +# if defined(CAPS_WORD_ENABLE) && defined(CAPS_WORD_INVERT_ON_SHIFT) + // Since eager mods bypass normal event handling, eager Shift does + // not work with CAPS_WORD_INVERT_ON_SHIFT. So if this option is + // enabled, we don't apply Shift eagerly when Caps Word is on. + !(is_caps_word_on() && (mod & MOD_LSFT) != 0) && +# endif // defined(CAPS_WORD_ENABLE) && defined(CAPS_WORD_INVERT_ON_SHIFT) + achordion_eager_mod(mod)) { + eager_mods = mod; + process_eager_mods_action(); + } + } + + dprintf("Achordion: Key 0x%04X pressed.%s\n", keycode, eager_mods ? " Set eager mods." : ""); + return false; // Skip default handling. + } + } + +# ifdef ACHORDION_STREAK + update_streak_timer(keycode, record); +# endif + return true; // Otherwise, continue with default handling. + } else if (record->event.pressed && tap_hold_keycode != keycode) { + // Track whether another key was pressed while using a tap-hold key. + pressed_another_key_before_release = true; + } + + // Release of the active tap-hold key. + if (keycode == tap_hold_keycode && !record->event.pressed) { + if (eager_mods) { + dprintln("Achordion: Key released. Clearing eager mods."); + tap_hold_record.event.pressed = false; + process_eager_mods_action(); + } else if (achordion_state == STATE_HOLDING) { + dprintln("Achordion: Key released. Plumbing hold release."); + tap_hold_record.event.pressed = false; + // Plumb hold release event. + recursively_process_record(&tap_hold_record, STATE_RELEASED); + } else if (!pressed_another_key_before_release) { + // No other key was pressed between the press and release of the tap-hold + // key, plumb a hold press and then a release. + dprintln("Achordion: Key released. Plumbing hold press and release."); + recursively_process_record(&tap_hold_record, STATE_HOLDING); + tap_hold_record.event.pressed = false; + recursively_process_record(&tap_hold_record, STATE_RELEASED); + } else { + dprintln("Achordion: Key released."); + } + + achordion_state = STATE_RELEASED; + tap_hold_keycode = KC_NO; + return false; + } + + if (achordion_state == STATE_UNSETTLED && record->event.pressed) { +# ifdef ACHORDION_STREAK + const uint16_t s_timeout = achordion_streak_chord_timeout(tap_hold_keycode, keycode); + const bool is_streak = streak_timer && s_timeout && !timer_expired(record->event.time, (streak_timer + s_timeout)); +# endif + + // Press event occurred on a key other than the active tap-hold key. + + // If the other key is *also* a tap-hold key and considered by QMK to be + // held, then we settle the active key as held. This way, things like + // chording multiple home row modifiers will work, but let's our logic + // consider simply a single tap-hold key as "active" at a time. + // + // Otherwise, we call `achordion_chord()` to determine whether to settle the + // tap-hold key as tapped vs. held. We implement the tap or hold by plumbing + // events back into the handling pipeline so that QMK features and other + // user code can see them. This is done by calling `process_record()`, which + // in turn calls most handlers including `process_record_user()`. + if (!is_streak && (!is_key_event || (is_tap_hold && record->tap.count == 0) || achordion_chord(tap_hold_keycode, &tap_hold_record, keycode, record))) { + settle_as_hold(); + +# ifdef REPEAT_KEY_ENABLE + // Edge case involving LT + Repeat Key: in a sequence of "LT down, other + // down" where "other" is on the other layer in the same position as + // Repeat or Alternate Repeat, the repeated keycode is set instead of the + // the one on the switched-to layer. Here we correct that. + if (get_repeat_key_count() != 0 && IS_QK_LAYER_TAP(tap_hold_keycode)) { + record->keycode = KC_NO; // Forget the repeated keycode. + clear_weak_mods(); + } +# endif // REPEAT_KEY_ENABLE + } else { + settle_as_tap(); + +# ifdef ACHORDION_STREAK + update_streak_timer(keycode, record); + if (is_streak && is_key_event && is_tap_hold && record->tap.count == 0) { + // If we are in a streak and resolved the current tap-hold key as a tap + // consider the next tap-hold key as active to be resolved next. + update_streak_timer(tap_hold_keycode, &tap_hold_record); + const uint16_t timeout = achordion_timeout(keycode); + tap_hold_keycode = keycode; + tap_hold_record = *record; + hold_timer = record->event.time + timeout; + achordion_state = STATE_UNSETTLED; + pressed_another_key_before_release = false; + return false; + } +# endif + } + + recursively_process_record(record, achordion_state); // Re-process event. + return false; // Block the original event. + } + +# ifdef ACHORDION_STREAK + // update idle timer on regular keys event + update_streak_timer(keycode, record); +# endif + return true; +} + +void achordion_task(void) { + if (achordion_state == STATE_UNSETTLED && timer_expired(timer_read(), hold_timer)) { + settle_as_hold(); // Timeout expired, settle the key as held. + } + +# ifdef ACHORDION_STREAK +# define MAX_STREAK_TIMEOUT 800 + if (streak_timer && timer_expired(timer_read(), (streak_timer + MAX_STREAK_TIMEOUT))) { + streak_timer = 0; // Expired. + } +# endif +} + +// Returns true if `pos` on the left hand of the keyboard, false if right. +static bool on_left_hand(keypos_t pos) { +# ifdef SPLIT_KEYBOARD + return pos.row < MATRIX_ROWS / 2; +# else + return (MATRIX_COLS > MATRIX_ROWS) ? pos.col < MATRIX_COLS / 2 : pos.row < MATRIX_ROWS / 2; +# endif +} + +bool achordion_opposite_hands(const keyrecord_t* tap_hold_record, const keyrecord_t* other_record) { + return on_left_hand(tap_hold_record->event.key) != on_left_hand(other_record->event.key); +} + +// By default, use the BILATERAL_COMBINATIONS rule to consider the tap-hold key +// "held" only when it and the other key are on opposite hands. +__attribute__((weak)) bool achordion_chord(uint16_t tap_hold_keycode, keyrecord_t* tap_hold_record, uint16_t other_keycode, keyrecord_t* other_record) { + return achordion_opposite_hands(tap_hold_record, other_record); +} + +// By default, the timeout is 1000 ms for all keys. +__attribute__((weak)) uint16_t achordion_timeout(uint16_t tap_hold_keycode) { + return 1000; +} + +// By default, Shift and Ctrl mods are eager, and Alt and GUI are not. +__attribute__((weak)) bool achordion_eager_mod(uint8_t mod) { + return (mod & (MOD_LALT | MOD_LGUI)) == 0; +} + +# ifdef ACHORDION_STREAK +__attribute__((weak)) bool achordion_streak_continue(uint16_t keycode) { + // If any mods other than shift or AltGr are held, don't continue the streak + if (get_mods() & (MOD_MASK_CG | MOD_BIT_LALT)) return false; + // This function doesn't get called for holds, so convert to tap version of + // keycodes + if (IS_QK_MOD_TAP(keycode)) keycode = QK_MOD_TAP_GET_TAP_KEYCODE(keycode); + if (IS_QK_LAYER_TAP(keycode)) keycode = QK_LAYER_TAP_GET_TAP_KEYCODE(keycode); + // Regular letters and punctuation continue the streak. + if (keycode >= KC_A && keycode <= KC_Z) return true; + switch (keycode) { + case KC_DOT: + case KC_COMMA: + case KC_QUOTE: + case KC_SPACE: + return true; + } + // All other keys end the streak + return false; +} + +__attribute__((weak)) uint16_t achordion_streak_chord_timeout(uint16_t tap_hold_keycode, uint16_t next_keycode) { + return achordion_streak_timeout(tap_hold_keycode); +} + +__attribute__((weak)) uint16_t achordion_streak_timeout(uint16_t tap_hold_keycode) { + return 200; +} +# endif + +#endif // version check diff --git a/keyboards/gggw/crosses/keymaps/default/features/achordion.h b/keyboards/gggw/crosses/keymaps/default/features/achordion.h new file mode 100644 index 00000000000..47f86fc243e --- /dev/null +++ b/keyboards/gggw/crosses/keymaps/default/features/achordion.h @@ -0,0 +1,190 @@ +// Copyright 2022-2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file achordion.h + * @brief Achordion: Customizing the tap-hold decision. + * + * Overview + * -------- + * + * This library customizes when tap-hold keys are considered held vs. tapped + * based on the next pressed key, like Manna Harbour's Bilateral Combinations or + * ZMK's positional hold. The library works on top of QMK's existing tap-hold + * implementation. You define mod-tap and layer-tap keys as usual and use + * Achordion to fine-tune the behavior. + * + * When QMK settles a tap-hold key as held, Achordion intercepts the event. + * Achordion then revises the event as a tap or passes it along as a hold: + * + * * Chord condition: On the next key press, a customizable `achordion_chord()` + * function is called, which takes the tap-hold key and the next key pressed + * as args. When the function returns true, the tap-hold key is settled as + * held, and otherwise as tapped. + * + * * Timeout: If no other key press occurs within a timeout, the tap-hold key + * is settled as held. This is customizable with `achordion_timeout()`. + * + * Achordion only changes the behavior when QMK considered the key held. It + * changes some would-be holds to taps, but no taps to holds. + * + * @note Some QMK features handle events before the point where Achordion can + * intercept them, particularly: Combos, Key Lock, and Dynamic Macros. It's + * still possible to use these features and Achordion in your keymap, but beware + * they might behave poorly when used simultaneously with tap-hold keys. + * + * + * For full documentation, see + * + */ + +#pragma once + +#include "quantum.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Handler function for Achordion. + * + * Call this function from `process_record_user()` as + * + * #include "features/achordion.h" + * + * bool process_record_user(uint16_t keycode, keyrecord_t* record) { + * if (!process_achordion(keycode, record)) { return false; } + * // Your macros... + * return true; + * } + */ +bool process_achordion(uint16_t keycode, keyrecord_t* record); + +/** + * Matrix task function for Achordion. + * + * Call this function from `matrix_scan_user()` as + * + * void matrix_scan_user(void) { + * achordion_task(); + * } + */ +void achordion_task(void); + +/** + * Optional callback to customize which key chords are considered "held". + * + * In your keymap.c, define the callback + * + * bool achordion_chord(uint16_t tap_hold_keycode, + * keyrecord_t* tap_hold_record, + * uint16_t other_keycode, + * keyrecord_t* other_record) { + * // Conditions... + * } + * + * This callback is called if while `tap_hold_keycode` is pressed, + * `other_keycode` is pressed. Return true if the tap-hold key should be + * considered held, or false to consider it tapped. + * + * @param tap_hold_keycode Keycode of the tap-hold key. + * @param tap_hold_record keyrecord_t from the tap-hold press event. + * @param other_keycode Keycode of the other key. + * @param other_record keyrecord_t from the other key's press event. + * @return True if the tap-hold key should be considered held. + */ +bool achordion_chord(uint16_t tap_hold_keycode, keyrecord_t* tap_hold_record, uint16_t other_keycode, keyrecord_t* other_record); + +/** + * Optional callback to define a timeout duration per keycode. + * + * In your keymap.c, define the callback + * + * uint16_t achordion_timeout(uint16_t tap_hold_keycode) { + * // ... + * } + * + * The callback determines Achordion's timeout duration for `tap_hold_keycode` + * in units of milliseconds. The timeout be in the range 0 to 32767 ms (upper + * bound is due to 16-bit timer limitations). Use a timeout of 0 to bypass + * Achordion. + * + * @param tap_hold_keycode Keycode of the tap-hold key. + * @return Timeout duration in milliseconds in the range 0 to 32767. + */ +uint16_t achordion_timeout(uint16_t tap_hold_keycode); + +/** + * Optional callback defining which mods are "eagerly" applied. + * + * This callback defines which mods are "eagerly" applied while a mod-tap + * key is still being settled. This is helpful to reduce delay particularly when + * using mod-tap keys with an external mouse. + * + * Define this callback in your keymap.c. The default callback is eager for + * Shift and Ctrl, and not for Alt and GUI: + * + * bool achordion_eager_mod(uint8_t mod) { + * return (mod & (MOD_LALT | MOD_LGUI)) == 0; + * } + * + * @note `mod` should be compared with `MOD_` prefixed codes, not `KC_` codes, + * described at . + * + * @param mod Modifier `MOD_` code. + * @return True if the modifier should be eagerly applied. + */ +bool achordion_eager_mod(uint8_t mod); + +/** + * Returns true if the args come from keys on opposite hands. + * + * @param tap_hold_record keyrecord_t from the tap-hold key's event. + * @param other_record keyrecord_t from the other key's event. + * @return True if the keys are on opposite hands. + */ +bool achordion_opposite_hands(const keyrecord_t* tap_hold_record, const keyrecord_t* other_record); + +/** + * Suppress tap-hold mods within a *typing streak* by defining + * ACHORDION_STREAK. This can help preventing accidental mod + * activation when performing a fast tapping sequence. + * This is inspired by + * https://sunaku.github.io/home-row-mods.html#typing-streaks + * + * Enable with: + * + * #define ACHORDION_STREAK + * + * Adjust the maximum time between key events before modifiers can be enabled + * by defining the following callback in your keymap.c: + * + * uint16_t achordion_streak_chord_timeout( + * uint16_t tap_hold_keycode, uint16_t next_keycode) { + * return 200; // Default of 200 ms. + * } + */ +#ifdef ACHORDION_STREAK +uint16_t achordion_streak_chord_timeout(uint16_t tap_hold_keycode, uint16_t next_keycode); + +bool achordion_streak_continue(uint16_t keycode); + +/** @deprecated Use `achordion_streak_chord_timeout()` instead. */ +uint16_t achordion_streak_timeout(uint16_t tap_hold_keycode); +#endif + +#ifdef __cplusplus +} +#endif diff --git a/keyboards/gggw/crosses/keymaps/default/keymap.c b/keyboards/gggw/crosses/keymaps/default/keymap.c new file mode 100644 index 00000000000..c73437f224f --- /dev/null +++ b/keyboards/gggw/crosses/keymaps/default/keymap.c @@ -0,0 +1,462 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +#include "features/achordion.h" + +#ifdef CONSOLE_ENABLE +# include "print.h" +#endif /* ifdef CONSOLE_ENABLE */ + +/* + * Keycodes, combos, and layers! oh my! + */ + +enum CROSSES_LAYERS { + _BASE, + _NUM, + _NAV, + _MEDIA, + _FUNC, + _MOUS, +}; + +enum my_keycodes { + VIMS = SAFE_RANGE, + LARR, + FARR, + EPIP, + LVBC, + RVBC, + BARR, + MSE_INC, + MSE_DEC, + DRAG_SCROLL, +}; + +/* + * Pointer Storage + */ +typedef union { + uint32_t raw; + struct { + uint16_t mse_cpi : 16; + } __attribute__((packed)); +} global_user_config_t; + +global_user_config_t global_user_config = {0}; + +const uint16_t MIN_DEFAULT_DPI = 400; +const uint16_t MAX_DEFAULT_DPI = 10000; + +void write_config_to_eeprom(global_user_config_t* config) { + eeconfig_update_user(config->raw); +} + +uint16_t get_pointer_dpi(global_user_config_t* config) { + uint16_t current = config->mse_cpi; + + if (current < MIN_DEFAULT_DPI) { + return MIN_DEFAULT_DPI; + } + + if (current > MAX_DEFAULT_DPI) { + return MAX_DEFAULT_DPI; + } + + return current; +} + +void update_pointer_cpi(global_user_config_t* config) { + pointing_device_set_cpi(get_pointer_dpi(config)); +} + +void change_pointer_dpi(global_user_config_t* config, bool inc) { + uint16_t current = config->mse_cpi; + uint16_t requested = current += inc ? 50 : -50; + + if (requested < MIN_DEFAULT_DPI) { + +#ifdef CONSOLE_ENABLE + dprintf("%u is beyond bounds - omitting operation", requested); +#endif // CONSOLE_ENABLE + return; + } + + if (requested > MAX_DEFAULT_DPI) { +#ifdef CONSOLE_ENABLE + dprintf("%u is beyond bounds - omitting operation", requested); +#endif // CONSOLE_ENABLE + return; + } + + config->mse_cpi += inc ? 10 : -10; + pointing_device_set_cpi(get_pointer_dpi(config)); + write_config_to_eeprom(&global_user_config); +} + + +void debug_config_to_console(global_user_config_t* config) { +#ifdef CONSOLE_ENABLE + dprintf("(crosses) process_record_user: config = {\n" + "\traw = 0x%lu,\n" + "\t{\n" + "\t\tmse_cpi=0x%X (%u)\n" + "\t}\n" + "}\n", + (unsigned long)config->raw, config->mse_cpi, get_pointer_dpi(config)); +#endif // CONSOLE_ENABLE +} + +void eeconfig_init_user(void) { + global_user_config.raw = 0; + global_user_config.mse_cpi = MIN_DEFAULT_DPI; + + write_config_to_eeprom(&global_user_config); + debug_config_to_console(&global_user_config); +} + +/* + * Pointing Device Config + */ + +bool set_scrolling = false; + +float scroll_acc_h = 0; +float scroll_acc_v = 0; + +report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { + if (set_scrolling) { + // Calculate and accumulate scroll values based on mouse movement and divisors + scroll_acc_h += (float)mouse_report.x / SCROLL_DIVISOR_H; + scroll_acc_v += (float)mouse_report.y / SCROLL_DIVISOR_V; + + // Assign integer parts of accumulated scroll values to the mouse report + mouse_report.h = (int8_t)scroll_acc_h; + mouse_report.v = (int8_t)scroll_acc_v; + + // Update accumulated scroll values by subtracting the integer parts + scroll_acc_h -= (int8_t)scroll_acc_h; + scroll_acc_v -= (int8_t)scroll_acc_v; + + // Clear the X and Y values of the mouse report + mouse_report.x = 0; + mouse_report.y = 0; + } + + return mouse_report; +} + +layer_state_t layer_state_set_user(layer_state_t state) { + if (get_highest_layer(state) != 5) { + set_scrolling = false; + } + + return state; +} + +void pointing_device_init_user(void) { + set_auto_mouse_layer(_MOUS); + set_auto_mouse_enable(true); +} + +enum combos { + WY_TAB, + DH_CAPS, + HCOMA_MINS, + WSPC_VIM, + FU_QUOTE, + PL_DQUOTE, + CCOM_LARR, + XDOT_FARR, + GM_EPIP, + COMD_UNDERS, + ZDOT_BARR, +}; + +const uint16_t PROGMEM wy_combo[] = {KC_W, KC_Y, COMBO_END}; +const uint16_t PROGMEM dh_combo[] = {KC_D, KC_H, COMBO_END}; +const uint16_t PROGMEM hcomma_combo[] = {KC_H, KC_COMM, COMBO_END}; +const uint16_t PROGMEM wspc_combo[] = {KC_W, KC_SPC, COMBO_END}; +const uint16_t PROGMEM fu_combo[] = {KC_F, KC_U, COMBO_END}; +const uint16_t PROGMEM pl_combo[] = {KC_P, KC_L, COMBO_END}; +const uint16_t PROGMEM ccom_combo[] = {KC_C, KC_COMM, COMBO_END}; +const uint16_t PROGMEM xdot_combo[] = {KC_X, KC_DOT, COMBO_END}; +const uint16_t PROGMEM gm_combo[] = {KC_G, KC_M, COMBO_END}; +const uint16_t PROGMEM comd_combo[] = {KC_COMM, KC_DOT, COMBO_END}; +const uint16_t PROGMEM zdot_combo[] = {KC_Z, KC_DOT, COMBO_END}; + +combo_t key_combos[] = { + [WY_TAB] = COMBO(wy_combo, KC_TAB), + [DH_CAPS] = COMBO(dh_combo, CW_TOGG), + [HCOMA_MINS] = COMBO(hcomma_combo, KC_MINS), + [WSPC_VIM] = COMBO(wspc_combo, VIMS), + [FU_QUOTE] = COMBO(fu_combo, KC_QUOT), + [PL_DQUOTE] = COMBO(pl_combo, S(KC_QUOT)), + [CCOM_LARR] = COMBO(ccom_combo, LARR), + [XDOT_FARR] = COMBO(xdot_combo, FARR), + [GM_EPIP] = COMBO(gm_combo, EPIP), + [COMD_UNDERS] = COMBO(comd_combo, S(KC_MINS)), + [ZDOT_BARR] = COMBO(zdot_combo, BARR), +}; + +/* + * Keymaps! + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// ┌───────────┬───────────┬───────────┬───────────┬────────────┐ ┌──────┬───────────┬───────────┬───────────┬───────────┐ +// │ q │ w │ f │ p │ b │ │ j │ l │ u │ y │ ; │ +// ├───────────┼───────────┼───────────┼───────────┼────────────┤ ├──────┼───────────┼───────────┼───────────┼───────────┤ +// │ LGUI_T(a) │ LALT_T(r) │ LCTL_T(s) │ LSFT_T(t) │ g │ │ m │ RSFT_T(n) │ RCTL_T(e) │ RALT_T(i) │ RGUI_T(o) │ +// ├───────────┼───────────┼───────────┼───────────┼────────────┤ ├──────┼───────────┼───────────┼───────────┼───────────┤ +// │ z │ x │ c │ d │ v │ │ k │ h │ , │ . │ LT(3, /) │ +// └───────────┴───────────┴───────────┼───────────┼────────────┼─────┐ ┌────────────┼──────┼───────────┼───────────┴───────────┴───────────┘ +// │ MO(5) │ LT(2, esc) │ spc │ │ LT(1, ent) │ bspc │ MO(4) │ +// └───────────┴────────────┴─────┘ └────────────┴──────┴───────────┘ +[_BASE] = LAYOUT_default( + KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , + LGUI_T(KC_A) , LALT_T(KC_R) , LCTL_T(KC_S) , LSFT_T(KC_T) , KC_G , KC_M , RSFT_T(KC_N) , RCTL_T(KC_E) , RALT_T(KC_I) , RGUI_T(KC_O) , + KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , LT(3, KC_SLSH), + MO(5) , LT(2, KC_ESC) , KC_SPC , LT(1, KC_ENT) , KC_BSPC , MO(4) +), + +// ┌──────┬───┬───┬───────────┬──────┐ ┌──────┬───────────┬───────────┬──────┬─────┐ +// │ S(8) │ 7 │ 8 │ 9 │ / │ │ \ │ S(9) │ S(0) │ S(\) │ │ +// ├──────┼───┼───┼───────────┼──────┤ ├──────┼───────────┼───────────┼──────┼─────┤ +// │ - │ 4 │ 5 │ LSFT_T(6) │ S(=) │ │ S(5) │ RSFT_T([) │ RCTL_T(]) │ S(;) │ ; │ +// ├──────┼───┼───┼───────────┼──────┤ ├──────┼───────────┼───────────┼──────┼─────┤ +// │ ` │ 1 │ 2 │ 3 │ = │ │ [ │ ] │ │ │ │ +// └──────┴───┴───┼───────────┼──────┼─────┐ ┌─────┼──────┼───────────┼───────────┴──────┴─────┘ +// │ │ 0 │ │ │ │ │ │ +// └───────────┴──────┴─────┘ └─────┴──────┴───────────┘ +[_NUM] = LAYOUT_default( + S(KC_8) , KC_7 , KC_8 , KC_9 , KC_SLSH , KC_BSLS , S(KC_9) , S(KC_0) , S(KC_BSLS) , KC_TRNS, + KC_MINS , KC_4 , KC_5 , LSFT_T(KC_6) , S(KC_EQL) , S(KC_5) , RSFT_T(KC_LBRC) , RCTL_T(KC_RBRC) , S(KC_SCLN) , KC_SCLN, + KC_GRV , KC_1 , KC_2 , KC_3 , KC_EQL , KC_LBRC , KC_RBRC , KC_TRNS , KC_TRNS , KC_TRNS, + KC_TRNS , KC_0 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS +), + +// ┌──────┬──────┬──────┬───────┬─────┐ ┌─────┬──────┬──────┬──────┬──────┐ +// │ │ │ │ │ │ │ │ │ │ │ │ +// ├──────┼──────┼──────┼───────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ +// │ lgui │ lalt │ lctl │ lsft │ │ │ │ left │ down │ up │ rght │ +// ├──────┼──────┼──────┼───────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ +// │ │ │ copy │ paste │ │ │ │ home │ end │ pgdn │ pgup │ +// └──────┴──────┴──────┼───────┼─────┼─────┐ ┌─────┼─────┼──────┼──────┴──────┴──────┘ +// │ │ │ │ │ │ │ │ +// └───────┴─────┴─────┘ └─────┴─────┴──────┘ +[_NAV] = LAYOUT_default( + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, + KC_LGUI , KC_LALT , KC_LCTL , KC_LSFT , KC_TRNS , KC_TRNS , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT, + KC_TRNS , KC_TRNS , KC_COPY , KC_PSTE , KC_TRNS , KC_TRNS , KC_HOME , KC_END , KC_PGDN , KC_PGUP, + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS +), + +// ┌──────┬──────┬──────┬──────┬──────┐ ┌─────┬─────┬─────┬─────┬─────┐ +// │ │ │ │ │ │ │ │ │ │ │ │ +// ├──────┼──────┼──────┼──────┼──────┤ ├─────┼─────┼─────┼─────┼─────┤ +// │ mprv │ vold │ mply │ volu │ mnxt │ │ │ │ │ │ │ +// ├──────┼──────┼──────┼──────┼──────┤ ├─────┼─────┼─────┼─────┼─────┤ +// │ │ │ │ │ │ │ │ │ │ │ │ +// └──────┴──────┴──────┼──────┼──────┼─────┐ ┌─────┼─────┼─────┼─────┴─────┴─────┘ +// │ │ │ │ │ │ │ │ +// └──────┴──────┴─────┘ └─────┴─────┴─────┘ +[_MEDIA] = LAYOUT_default( + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, + KC_MPRV , KC_VOLD , KC_MPLY , KC_VOLU , KC_MNXT , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS +), + +// ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬──────┬──────┬──────┬──────┐ +// │ f11 │ f12 │ f13 │ f14 │ f15 │ │ │ │ │ │ │ +// ├─────┼─────┼─────┼─────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ +// │ f6 │ f7 │ f8 │ f9 │ f10 │ │ │ rsft │ rctl │ ralt │ rgui │ +// ├─────┼─────┼─────┼─────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ +// │ f1 │ f2 │ f3 │ f4 │ f5 │ │ │ │ │ │ │ +// └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼──────┼──────┴──────┴──────┘ +// │ │ │ │ │ │ │ │ +// └─────┴─────┴─────┘ └─────┴─────┴──────┘ +[_FUNC] = LAYOUT_default( + KC_F11 , KC_F12 , KC_F13 , KC_F14 , KC_F15 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, + KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_TRNS , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, + KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS +), + +// ┌──────┬─────────┬─────────┬─────────────┬────┐ ┌────────┬─────────┬─────────┬────┬─────────┐ +// │ lsft │ lalt │ no │ no │ no │ │ EE_CLR │ MSE_INC │ MSE_DEC │ no │ no │ +// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼────┼─────────┤ +// │ lctl │ MS_BTN3 │ MS_BTN2 │ MS_BTN1 │ no │ │ no │ no │ no │ no │ no │ +// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼────┼─────────┤ +// │ no │ no │ no │ DRAG_SCROLL │ no │ │ no │ no │ no │ no │ DB_TOGG │ +// └──────┴─────────┴─────────┼─────────────┼────┼────┐ ┌────┼────────┼─────────┼─────────┴────┴─────────┘ +// │ │ no │ no │ │ no │ no │ no │ +// └─────────────┴────┴────┘ └────┴────────┴─────────┘ +[_MOUS] = LAYOUT_default( + KC_LSFT , KC_LALT , KC_NO , KC_NO , KC_NO , EE_CLR , MSE_INC , MSE_DEC , KC_NO , KC_NO , + KC_LCTL , MS_BTN3 , MS_BTN2 , MS_BTN1 , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , + KC_NO , KC_NO , KC_NO , DRAG_SCROLL , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , DB_TOGG, + KC_TRNS , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO +) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t* record) { + if (!process_achordion(keycode, record)) { + return false; + } + switch (keycode) { + case RSFT_T(KC_LBRC): + if (record->tap.count && record->event.pressed) { + tap_code16(S(KC_LBRC)); + return false; + } + break; + + case RCTL_T(KC_RBRC): + if (record->tap.count && record->event.pressed) { + tap_code16(S(KC_RBRC)); + return false; + } + break; + + case VIMS: + if (record->event.pressed) { + tap_code16(KC_ESC); + SEND_STRING(":w\n"); + + return false; + } + break; + + case EPIP: + if (record->event.pressed) { + SEND_STRING("|> "); + + return false; + } + break; + + case LARR: + if (record->event.pressed) { + SEND_STRING("-> "); + + return false; + } + break; + + case FARR: + if (record->event.pressed) { + SEND_STRING("=> "); + + return false; + } + break; + + case BARR: + if (record->event.pressed) { + SEND_STRING("<- "); + + return false; + } + break; + case MSE_INC: + if (record->event.pressed) { + change_pointer_dpi(&global_user_config, true); + debug_config_to_console(&global_user_config); + + return false; + } + break; + case MSE_DEC: + if (record->event.pressed) { + change_pointer_dpi(&global_user_config, false); + debug_config_to_console(&global_user_config); + + return false; + } + break; + case DRAG_SCROLL: + set_scrolling = record->event.pressed; + break; + } + + return true; +} + +bool achordion_chord(uint16_t tap_hold_keycode, keyrecord_t* tap_hold_record, uint16_t other_keycode, keyrecord_t* other_record) { + switch (tap_hold_keycode) { + case 0x4128: + return true; + break; + } + + return achordion_opposite_hands(tap_hold_record, other_record); +} + +void matrix_scan_user(void) { + achordion_task(); +} + +#ifdef OLED_ENABLE + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (!is_keyboard_master()) { + return rotation; + } + + return OLED_ROTATION_180; +} + +static void render_logo(void) { + static const char PROGMEM qmk_logo[] = { + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, + 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, + 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, + 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, + 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, + 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, + 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00 + }; + + oled_write_P(qmk_logo, false); +} + +bool oled_task_user(void) { + render_logo(); + + switch (get_highest_layer(layer_state)) { + case _BASE: + oled_write_P(PSTR(">>> BASE "), false); + break; + case _NUM: + oled_write_P(PSTR(">>> PROG "), false); + break; + case _NAV: + oled_write_P(PSTR(">>> NAVI "), false); + break; + case _MEDIA: + oled_write_P(PSTR(">>> MEDIA"), false); + break; + case _FUNC: + oled_write_P(PSTR(">>> FUNC "), false); + break; + case _MOUS: + oled_write_P(PSTR(">>> MOUSE"), false); + break; + default: + break; + } + // oled_write_ln_P(get_u16_str(get_pointer_dpi(&global_user_config), '0'), false); + return false; +} +#endif /* ifdef OLED_ENABLE */ + +void keyboard_post_init_user(void) { + global_user_config.raw = eeconfig_read_user(); + update_pointer_cpi(&global_user_config); + write_config_to_eeprom(&global_user_config); +} diff --git a/keyboards/gggw/crosses/keymaps/default/rules.mk b/keyboards/gggw/crosses/keymaps/default/rules.mk new file mode 100644 index 00000000000..e79d84cfacb --- /dev/null +++ b/keyboards/gggw/crosses/keymaps/default/rules.mk @@ -0,0 +1,4 @@ +COMBO_ENABLE = yes +CAPS_WORD_ENABLE = yes +SRC += features/achordion.c +WEAR_LEVELING_DRIVER = rp2040_flash diff --git a/keyboards/gggw/crosses/mcuconf.h b/keyboards/gggw/crosses/mcuconf.h new file mode 100644 index 00000000000..cb774770edf --- /dev/null +++ b/keyboards/gggw/crosses/mcuconf.h @@ -0,0 +1,9 @@ +#pragma once + +#include_next + +#undef RP_SPI_USE_SPI0 +#define RP_SPI_USE_SPI0 TRUE + +#undef RP_I2C_USE_I2C1 +#define RP_I2C_USE_I2C1 TRUE diff --git a/keyboards/gggw/crosses/readme.md b/keyboards/gggw/crosses/readme.md new file mode 100644 index 00000000000..fd805d53773 --- /dev/null +++ b/keyboards/gggw/crosses/readme.md @@ -0,0 +1,27 @@ +# crosses + +![crosses](imgur.com image replace me!) + +*A short description of the keyboard/project* + +* Keyboard Maintainer: [Vincent Franco](https://github.com/vinniefranco) +* Hardware Supported: *The PCBs, controllers supported* +* Hardware Availability: *Links to where you can find this hardware* + +Make example for this keyboard (after setting up your build environment): + + make crosses:default + +Flashing example for this keyboard: + + make crosses: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 key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available diff --git a/keyboards/gggw/crosses/rules.mk b/keyboards/gggw/crosses/rules.mk new file mode 100644 index 00000000000..ce160248716 --- /dev/null +++ b/keyboards/gggw/crosses/rules.mk @@ -0,0 +1,3 @@ +POINTING_DEVICE_ENABLE = yes +POINTING_DEVICE_DRIVER = pmw3360 +OLED_ENABLE = yes From d1ef845a500d4468501a97160cd6efe7ac68e50c Mon Sep 17 00:00:00 2001 From: vinniefranco Date: Thu, 26 Dec 2024 12:41:40 -0600 Subject: [PATCH 02/48] Prepping for different matrix sizes --- keyboards/gggw/crosses/3x5/config.h | 1 + .../gggw/crosses/{ => 3x5}/keyboard.json | 4 ++-- .../{ => 3x5}/keymaps/default/keymap.c | 22 +++++++++---------- .../gggw/crosses/3x5/keymaps/default/rules.mk | 2 ++ keyboards/gggw/crosses/config.h | 10 ++++----- .../gggw/crosses/keymaps/default/rules.mk | 4 ---- .../default/features => lib}/achordion.c | 0 .../default/features => lib}/achordion.h | 3 ++- .../gggw/crosses/{ => lib}/crosses-font.c | 0 keyboards/gggw/crosses/lib/crosses.c | 1 + keyboards/gggw/crosses/lib/crosses.h | 12 ++++++++++ keyboards/gggw/crosses/rules.mk | 3 +++ keymap.json | 2 ++ 13 files changed, 41 insertions(+), 23 deletions(-) create mode 100644 keyboards/gggw/crosses/3x5/config.h rename keyboards/gggw/crosses/{ => 3x5}/keyboard.json (97%) rename keyboards/gggw/crosses/{ => 3x5}/keymaps/default/keymap.c (96%) create mode 100644 keyboards/gggw/crosses/3x5/keymaps/default/rules.mk delete mode 100644 keyboards/gggw/crosses/keymaps/default/rules.mk rename keyboards/gggw/crosses/{keymaps/default/features => lib}/achordion.c (100%) rename keyboards/gggw/crosses/{keymaps/default/features => lib}/achordion.h (98%) rename keyboards/gggw/crosses/{ => lib}/crosses-font.c (100%) create mode 100644 keyboards/gggw/crosses/lib/crosses.c create mode 100644 keyboards/gggw/crosses/lib/crosses.h create mode 100644 keymap.json diff --git a/keyboards/gggw/crosses/3x5/config.h b/keyboards/gggw/crosses/3x5/config.h new file mode 100644 index 00000000000..6f70f09beec --- /dev/null +++ b/keyboards/gggw/crosses/3x5/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/keyboards/gggw/crosses/keyboard.json b/keyboards/gggw/crosses/3x5/keyboard.json similarity index 97% rename from keyboards/gggw/crosses/keyboard.json rename to keyboards/gggw/crosses/3x5/keyboard.json index 3a0bd1f49d3..22dc8fe9d8a 100644 --- a/keyboards/gggw/crosses/keyboard.json +++ b/keyboards/gggw/crosses/3x5/keyboard.json @@ -1,6 +1,6 @@ { - "manufacturer": "Good Great Grand Wonderful", - "keyboard_name": "Crosses", + "manufacturer": "Good Great Grand Wonderful LLC", + "keyboard_name": "Crosses 3x5", "maintainer": "vinniefranco", "bootloader": "rp2040", "diode_direction": "COL2ROW", diff --git a/keyboards/gggw/crosses/keymaps/default/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c similarity index 96% rename from keyboards/gggw/crosses/keymaps/default/keymap.c rename to keyboards/gggw/crosses/3x5/keymaps/default/keymap.c index c73437f224f..9c44ecc1525 100644 --- a/keyboards/gggw/crosses/keymaps/default/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c @@ -3,7 +3,7 @@ #include QMK_KEYBOARD_H -#include "features/achordion.h" +#include "lib/achordion.h" #ifdef CONSOLE_ENABLE # include "print.h" @@ -286,19 +286,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS ), -// ┌──────┬─────────┬─────────┬─────────────┬────┐ ┌────────┬─────────┬─────────┬────┬─────────┐ -// │ lsft │ lalt │ no │ no │ no │ │ EE_CLR │ MSE_INC │ MSE_DEC │ no │ no │ -// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼────┼─────────┤ -// │ lctl │ MS_BTN3 │ MS_BTN2 │ MS_BTN1 │ no │ │ no │ no │ no │ no │ no │ -// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼────┼─────────┤ -// │ no │ no │ no │ DRAG_SCROLL │ no │ │ no │ no │ no │ no │ DB_TOGG │ -// └──────┴─────────┴─────────┼─────────────┼────┼────┐ ┌────┼────────┼─────────┼─────────┴────┴─────────┘ +// ┌──────┬─────────┬─────────┬─────────────┬────┐ ┌────────┬─────────┬─────────┬──────┬─────────┐ +// │ lsft │ lalt │ no │ no │ no │ │ EE_CLR │ MSE_INC │ MSE_DEC │ no │ no │ +// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼──────┼─────────┤ +// │ lctl │ MS_BTN3 │ MS_BTN2 │ MS_BTN1 │ no │ │ no │ rsft │ rctl │ ralt │ rgui │ +// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼──────┼─────────┤ +// │ lgui │ no │ no │ DRAG_SCROLL │ no │ │ no │ no │ no │ no │ DB_TOGG │ +// └──────┴─────────┴─────────┼─────────────┼────┼────┐ ┌────┼────────┼─────────┼─────────┴──────┴─────────┘ // │ │ no │ no │ │ no │ no │ no │ // └─────────────┴────┴────┘ └────┴────────┴─────────┘ [_MOUS] = LAYOUT_default( - KC_LSFT , KC_LALT , KC_NO , KC_NO , KC_NO , EE_CLR , MSE_INC , MSE_DEC , KC_NO , KC_NO , - KC_LCTL , MS_BTN3 , MS_BTN2 , MS_BTN1 , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , - KC_NO , KC_NO , KC_NO , DRAG_SCROLL , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , DB_TOGG, + KC_LSFT , KC_LALT , KC_NO , KC_NO , KC_NO , EE_CLR , MSE_INC , MSE_DEC , KC_NO , KC_NO , + KC_LCTL , MS_BTN3 , MS_BTN2 , MS_BTN1 , KC_NO , KC_NO , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, + KC_LGUI , KC_NO , KC_NO , DRAG_SCROLL , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , DB_TOGG, KC_TRNS , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO ) }; diff --git a/keyboards/gggw/crosses/3x5/keymaps/default/rules.mk b/keyboards/gggw/crosses/3x5/keymaps/default/rules.mk new file mode 100644 index 00000000000..665ec1d6930 --- /dev/null +++ b/keyboards/gggw/crosses/3x5/keymaps/default/rules.mk @@ -0,0 +1,2 @@ +COMBO_ENABLE = yes +CAPS_WORD_ENABLE = yes diff --git a/keyboards/gggw/crosses/config.h b/keyboards/gggw/crosses/config.h index 0c2a8c2dbc5..11eb4ed5527 100644 --- a/keyboards/gggw/crosses/config.h +++ b/keyboards/gggw/crosses/config.h @@ -12,9 +12,9 @@ #define POINTING_DEVICE_INVERT_Y #define POINTING_DEVICE_TASK_THROTTLE_MS 10 #define POINTING_DEVICE_AUTO_MOUSE_ENABLE -#define AUTO_MOUSE_TIME 300 +#define AUTO_MOUSE_TIME 600 -#define MASTER_LEFT +#define MASTER_RIGHT #define SPI_SCK_PIN GP2 #define SPI_MOSI_PIN GP3 @@ -24,8 +24,8 @@ #define MOUSE_EXTENDED_REPORT #define POINTING_DEVICE_DEBUG -#define SCROLL_DIVISOR_H 8.0 -#define SCROLL_DIVISOR_V 8.0 +#define SCROLL_DIVISOR_H 10.0 +#define SCROLL_DIVISOR_V 10.0 /* * OLED @@ -47,4 +47,4 @@ /* * Font */ -#define OLED_FONT_H "crosses-font.c" +#define OLED_FONT_H "lib/crosses-font.c" diff --git a/keyboards/gggw/crosses/keymaps/default/rules.mk b/keyboards/gggw/crosses/keymaps/default/rules.mk deleted file mode 100644 index e79d84cfacb..00000000000 --- a/keyboards/gggw/crosses/keymaps/default/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -COMBO_ENABLE = yes -CAPS_WORD_ENABLE = yes -SRC += features/achordion.c -WEAR_LEVELING_DRIVER = rp2040_flash diff --git a/keyboards/gggw/crosses/keymaps/default/features/achordion.c b/keyboards/gggw/crosses/lib/achordion.c similarity index 100% rename from keyboards/gggw/crosses/keymaps/default/features/achordion.c rename to keyboards/gggw/crosses/lib/achordion.c diff --git a/keyboards/gggw/crosses/keymaps/default/features/achordion.h b/keyboards/gggw/crosses/lib/achordion.h similarity index 98% rename from keyboards/gggw/crosses/keymaps/default/features/achordion.h rename to keyboards/gggw/crosses/lib/achordion.h index 47f86fc243e..775390eb19d 100644 --- a/keyboards/gggw/crosses/keymaps/default/features/achordion.h +++ b/keyboards/gggw/crosses/lib/achordion.h @@ -1,6 +1,7 @@ // Copyright 2022-2024 Google LLC // -// Licensed under the Apache License, Version 2.0 (the "License"); +// +// Licensed under the Apache License, Version 1.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // diff --git a/keyboards/gggw/crosses/crosses-font.c b/keyboards/gggw/crosses/lib/crosses-font.c similarity index 100% rename from keyboards/gggw/crosses/crosses-font.c rename to keyboards/gggw/crosses/lib/crosses-font.c diff --git a/keyboards/gggw/crosses/lib/crosses.c b/keyboards/gggw/crosses/lib/crosses.c new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/keyboards/gggw/crosses/lib/crosses.c @@ -0,0 +1 @@ + diff --git a/keyboards/gggw/crosses/lib/crosses.h b/keyboards/gggw/crosses/lib/crosses.h new file mode 100644 index 00000000000..2c0fa986404 --- /dev/null +++ b/keyboards/gggw/crosses/lib/crosses.h @@ -0,0 +1,12 @@ + +#pragma once + +#include "quantum.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +# endi diff --git a/keyboards/gggw/crosses/rules.mk b/keyboards/gggw/crosses/rules.mk index ce160248716..dfdb73e04c7 100644 --- a/keyboards/gggw/crosses/rules.mk +++ b/keyboards/gggw/crosses/rules.mk @@ -1,3 +1,6 @@ POINTING_DEVICE_ENABLE = yes POINTING_DEVICE_DRIVER = pmw3360 OLED_ENABLE = yes + +SRC += lib/achordion.c +WEAR_LEVELING_DRIVER = rp2040_flash diff --git a/keymap.json b/keymap.json new file mode 100644 index 00000000000..7ad4c889f4f --- /dev/null +++ b/keymap.json @@ -0,0 +1,2 @@ +{"keyboard": "gggw/crosses", "keymap": "default", "layout": "LAYOUT_default", "layers": [["KC_Q", "KC_W", "KC_F", "KC_P", "KC_B", "KC_J", "KC_L", "KC_U", "KC_Y", "KC_SCLN", "LGUI_T(KC_A)", "LALT_T(KC_R)", "LCTL_T(KC_S)", "LSFT_T(KC_T)", "KC_G", "KC_M", "RSFT_T(KC_N)", "RCTL_T(KC_E)", "RALT_T(KC_I)", "RGUI_T(KC_O)", "KC_Z", "KC_X", "KC_C", "KC_D", "KC_V", "KC_K", "KC_H", "KC_COMM", "KC_DOT", "LT(3, KC_SLSH)", "MO(5)", "LT(2, KC_ESC)", "KC_SPC", "LT(1, KC_ENT)", "KC_BSPC", "MO(4)"], ["S(KC_8)", "KC_7", "KC_8", "KC_9", "KC_SLSH", "KC_BSLS", "S(KC_9)", "S(KC_0)", "S(KC_BSLS)", "KC_TRNS", "KC_MINS", "KC_4", "KC_5", "LSFT_T(KC_6)", "S(KC_EQL)", "S(KC_5)", "RSFT_T(KC_LBRC)", "RCTL_T(KC_RBRC)", "S(KC_SCLN)", "KC_SCLN", "KC_GRV", "KC_1", "KC_2", "KC_3", "KC_EQL", "KC_LBRC", "KC_RBRC", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_0", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_LGUI", "KC_LALT", "KC_LCTL", "KC_LSFT", "KC_TRNS", "KC_TRNS", "KC_LEFT", "KC_DOWN", "KC_UP", "KC_RGHT", "KC_TRNS", "KC_TRNS", "KC_COPY", "KC_PSTE", "KC_TRNS", "KC_TRNS", "KC_HOME", "KC_END", "KC_PGDN", "KC_PGUP", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_MPRV", "KC_VOLD", "KC_MPLY", "KC_VOLU", "KC_MNXT", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_F11", "KC_F12", "KC_F13", "KC_F14", "KC_F15", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_F6", "KC_F7", "KC_F8", "KC_F9", "KC_F10", "KC_TRNS", "KC_RSFT", "KC_RCTL", "KC_RALT", "KC_RGUI", "KC_F1", "KC_F2", "KC_F3", "KC_F4", "KC_F5", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_LSFT", "KC_LALT", "KC_NO", "KC_NO", "KC_NO", "EE_CLR", "MSE_INC", "MSE_DEC", "KC_NO", "KC_NO", "KC_LCTL", "MS_BTN3", "MS_BTN2", "MS_BTN1", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "DRAG_SCROLL", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "DB_TOGG", "KC_TRNS", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO"]]} + From a1c54238582ac067d35579590eb05a47f654d6a9 Mon Sep 17 00:00:00 2001 From: vinniefranco Date: Thu, 26 Dec 2024 19:44:41 -0600 Subject: [PATCH 03/48] More file organization --- keyboards/gggw/crosses/3x5/config.h | 19 +++ .../gggw/crosses/3x5/keymaps/default/keymap.c | 132 +----------------- keyboards/gggw/crosses/config.h | 1 + keyboards/gggw/crosses/lib/crosses.c | 116 +++++++++++++++ keyboards/gggw/crosses/lib/crosses.h | 50 ++++++- keyboards/gggw/crosses/rules.mk | 1 + 6 files changed, 192 insertions(+), 127 deletions(-) diff --git a/keyboards/gggw/crosses/3x5/config.h b/keyboards/gggw/crosses/3x5/config.h index 6f70f09beec..212d4ff99bd 100644 --- a/keyboards/gggw/crosses/3x5/config.h +++ b/keyboards/gggw/crosses/3x5/config.h @@ -1 +1,20 @@ +/* +This is the c configuration file for the keymap + +Copyright 2024 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ #pragma once + diff --git a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c index 9c44ecc1525..78b08a0472d 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c @@ -3,7 +3,9 @@ #include QMK_KEYBOARD_H + #include "lib/achordion.h" +#include "lib/crosses.h" #ifdef CONSOLE_ENABLE # include "print.h" @@ -35,131 +37,6 @@ enum my_keycodes { DRAG_SCROLL, }; -/* - * Pointer Storage - */ -typedef union { - uint32_t raw; - struct { - uint16_t mse_cpi : 16; - } __attribute__((packed)); -} global_user_config_t; - -global_user_config_t global_user_config = {0}; - -const uint16_t MIN_DEFAULT_DPI = 400; -const uint16_t MAX_DEFAULT_DPI = 10000; - -void write_config_to_eeprom(global_user_config_t* config) { - eeconfig_update_user(config->raw); -} - -uint16_t get_pointer_dpi(global_user_config_t* config) { - uint16_t current = config->mse_cpi; - - if (current < MIN_DEFAULT_DPI) { - return MIN_DEFAULT_DPI; - } - - if (current > MAX_DEFAULT_DPI) { - return MAX_DEFAULT_DPI; - } - - return current; -} - -void update_pointer_cpi(global_user_config_t* config) { - pointing_device_set_cpi(get_pointer_dpi(config)); -} - -void change_pointer_dpi(global_user_config_t* config, bool inc) { - uint16_t current = config->mse_cpi; - uint16_t requested = current += inc ? 50 : -50; - - if (requested < MIN_DEFAULT_DPI) { - -#ifdef CONSOLE_ENABLE - dprintf("%u is beyond bounds - omitting operation", requested); -#endif // CONSOLE_ENABLE - return; - } - - if (requested > MAX_DEFAULT_DPI) { -#ifdef CONSOLE_ENABLE - dprintf("%u is beyond bounds - omitting operation", requested); -#endif // CONSOLE_ENABLE - return; - } - - config->mse_cpi += inc ? 10 : -10; - pointing_device_set_cpi(get_pointer_dpi(config)); - write_config_to_eeprom(&global_user_config); -} - - -void debug_config_to_console(global_user_config_t* config) { -#ifdef CONSOLE_ENABLE - dprintf("(crosses) process_record_user: config = {\n" - "\traw = 0x%lu,\n" - "\t{\n" - "\t\tmse_cpi=0x%X (%u)\n" - "\t}\n" - "}\n", - (unsigned long)config->raw, config->mse_cpi, get_pointer_dpi(config)); -#endif // CONSOLE_ENABLE -} - -void eeconfig_init_user(void) { - global_user_config.raw = 0; - global_user_config.mse_cpi = MIN_DEFAULT_DPI; - - write_config_to_eeprom(&global_user_config); - debug_config_to_console(&global_user_config); -} - -/* - * Pointing Device Config - */ - -bool set_scrolling = false; - -float scroll_acc_h = 0; -float scroll_acc_v = 0; - -report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { - if (set_scrolling) { - // Calculate and accumulate scroll values based on mouse movement and divisors - scroll_acc_h += (float)mouse_report.x / SCROLL_DIVISOR_H; - scroll_acc_v += (float)mouse_report.y / SCROLL_DIVISOR_V; - - // Assign integer parts of accumulated scroll values to the mouse report - mouse_report.h = (int8_t)scroll_acc_h; - mouse_report.v = (int8_t)scroll_acc_v; - - // Update accumulated scroll values by subtracting the integer parts - scroll_acc_h -= (int8_t)scroll_acc_h; - scroll_acc_v -= (int8_t)scroll_acc_v; - - // Clear the X and Y values of the mouse report - mouse_report.x = 0; - mouse_report.y = 0; - } - - return mouse_report; -} - -layer_state_t layer_state_set_user(layer_state_t state) { - if (get_highest_layer(state) != 5) { - set_scrolling = false; - } - - return state; -} - -void pointing_device_init_user(void) { - set_auto_mouse_layer(_MOUS); - set_auto_mouse_enable(true); -} enum combos { WY_TAB, @@ -460,3 +337,8 @@ void keyboard_post_init_user(void) { update_pointer_cpi(&global_user_config); write_config_to_eeprom(&global_user_config); } + +void pointing_device_init_user(void) { + set_auto_mouse_layer(_MOUS); + set_auto_mouse_enable(true); +} diff --git a/keyboards/gggw/crosses/config.h b/keyboards/gggw/crosses/config.h index 11eb4ed5527..5952ba03206 100644 --- a/keyboards/gggw/crosses/config.h +++ b/keyboards/gggw/crosses/config.h @@ -20,6 +20,7 @@ #define SPI_MOSI_PIN GP3 #define SPI_MISO_PIN GP0 #define PMW33XX_CS_PIN GP6 +#define PMW33XX_LIFTOFF_DISTANCE 0x02 #define MOUSE_EXTENDED_REPORT #define POINTING_DEVICE_DEBUG diff --git a/keyboards/gggw/crosses/lib/crosses.c b/keyboards/gggw/crosses/lib/crosses.c index 8b137891791..b715034a11e 100644 --- a/keyboards/gggw/crosses/lib/crosses.c +++ b/keyboards/gggw/crosses/lib/crosses.c @@ -1 +1,117 @@ +#include "crosses.h" + +bool set_scrolling = false; + +float scroll_acc_h = 0.0; +float scroll_acc_v = 0.0; + +const uint16_t MIN_DEFAULT_DPI = 400; +const uint16_t MAX_DEFAULT_DPI = 10000; + + +/* + * Pointer Storage + */ + +global_user_config_t global_user_config = {0}; + +void write_config_to_eeprom(global_user_config_t* config) { + eeconfig_update_user(config->raw); +} + +uint16_t get_pointer_dpi(global_user_config_t* config) { + uint16_t current = config->mse_cpi; + + if (current < MIN_DEFAULT_DPI) { + return MIN_DEFAULT_DPI; + } + + if (current > MAX_DEFAULT_DPI) { + return MAX_DEFAULT_DPI; + } + + return current; +} + +void update_pointer_cpi(global_user_config_t* config) { + pointing_device_set_cpi(get_pointer_dpi(config)); +} + +void change_pointer_dpi(global_user_config_t* config, bool inc) { + uint16_t current = config->mse_cpi; + uint16_t requested = current += inc ? 50 : -50; + + if (requested < MIN_DEFAULT_DPI) { +#ifdef CONSOLE_ENABLE + dprintf("%u is beyond bounds - omitting operation", requested); +#endif // CONSOLE_ENABLE + return; + } + + if (requested > MAX_DEFAULT_DPI) { +#ifdef CONSOLE_ENABLE + dprintf("%u is beyond bounds - omitting operation", requested); +#endif // CONSOLE_ENABLE + return; + } + + config->mse_cpi += inc ? 10 : -10; + pointing_device_set_cpi(get_pointer_dpi(config)); + write_config_to_eeprom(&global_user_config); +} + +void debug_config_to_console(global_user_config_t* config) { +#ifdef CONSOLE_ENABLE + dprintf("(crosses) process_record_user: config = {\n" + "\traw = 0x%lu,\n" + "\t{\n" + "\t\tmse_cpi=0x%X (%u)\n" + "\t}\n" + "}\n", + (unsigned long)config->raw, config->mse_cpi, get_pointer_dpi(config)); +#endif // CONSOLE_ENABLE +} + +void eeconfig_init_user(void) { + global_user_config.raw = 0; + global_user_config.mse_cpi = MIN_DEFAULT_DPI; + + write_config_to_eeprom(&global_user_config); + debug_config_to_console(&global_user_config); +} + +/* + * Pointing Device Config + */ + +report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { + if (set_scrolling) { + // Calculate and accumulate scroll values based on mouse movement and divisors + scroll_acc_h += (float)mouse_report.x / SCROLL_DIVISOR_H; + scroll_acc_v += (float)mouse_report.y / SCROLL_DIVISOR_V; + + // Assign integer parts of accumulated scroll values to the mouse report + mouse_report.h = (int8_t)scroll_acc_h; + mouse_report.v = (int8_t)scroll_acc_v; + + // Update accumulated scroll values by subtracting the integer parts + scroll_acc_h -= (int8_t)scroll_acc_h; + scroll_acc_v -= (int8_t)scroll_acc_v; + + // Clear the X and Y values of the mouse report + mouse_report.x = 0; + mouse_report.y = 0; + } + + return mouse_report; +} + +layer_state_t layer_state_set_user(layer_state_t state) { + if (get_highest_layer(state) != 5) { + set_scrolling = false; + } + + return state; +} + diff --git a/keyboards/gggw/crosses/lib/crosses.h b/keyboards/gggw/crosses/lib/crosses.h index 2c0fa986404..8650246752f 100644 --- a/keyboards/gggw/crosses/lib/crosses.h +++ b/keyboards/gggw/crosses/lib/crosses.h @@ -1,12 +1,58 @@ - #pragma once + #include "quantum.h" #ifdef __cplusplus extern "C" { #endif +#ifndef CROSSES_CORE_H +#define CROSSES_CORE_H + +/* + * Pointer Storage + */ +typedef union { + uint32_t raw; + struct { + uint16_t mse_cpi : 16; + } __attribute__((packed)); +} global_user_config_t; + +extern global_user_config_t global_user_config; + +extern const uint16_t MIN_DEFAULT_DPI; +extern const uint16_t MAX_DEFAULT_DPI; + +void write_config_to_eeprom(global_user_config_t* config); + +uint16_t get_pointer_dpi(global_user_config_t* config); + +void update_pointer_cpi(global_user_config_t* config); + +void change_pointer_dpi(global_user_config_t* config, bool inc); + +void debug_config_to_console(global_user_config_t* config); + +void eeconfig_init_user(void); + +/* + * Pointing Device Config + */ + +extern bool set_scrolling; + +extern float scroll_acc_h; +extern float scroll_acc_v; + +report_mouse_t pointing_device_task_user(report_mouse_t mouse_report); + +layer_state_t layer_state_set_user(layer_state_t state); + +#endif // CROSSES_CORE_H + #ifdef __cplusplus } -# endi +#endif + diff --git a/keyboards/gggw/crosses/rules.mk b/keyboards/gggw/crosses/rules.mk index dfdb73e04c7..5d475608e79 100644 --- a/keyboards/gggw/crosses/rules.mk +++ b/keyboards/gggw/crosses/rules.mk @@ -3,4 +3,5 @@ POINTING_DEVICE_DRIVER = pmw3360 OLED_ENABLE = yes SRC += lib/achordion.c +SRC += lib/crosses.c WEAR_LEVELING_DRIVER = rp2040_flash From e734788ae6a45cd8c56a042ca14476b245e2ef60 Mon Sep 17 00:00:00 2001 From: vinniefranco Date: Thu, 26 Dec 2024 20:16:17 -0600 Subject: [PATCH 04/48] Fixup wheel scrolling --- keyboards/gggw/crosses/config.h | 5 +++-- keyboards/gggw/crosses/lib/crosses.c | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/keyboards/gggw/crosses/config.h b/keyboards/gggw/crosses/config.h index 5952ba03206..54d0e8b35eb 100644 --- a/keyboards/gggw/crosses/config.h +++ b/keyboards/gggw/crosses/config.h @@ -23,10 +23,11 @@ #define PMW33XX_LIFTOFF_DISTANCE 0x02 #define MOUSE_EXTENDED_REPORT +#define WHEEL_EXTENDED_REPORT #define POINTING_DEVICE_DEBUG -#define SCROLL_DIVISOR_H 10.0 -#define SCROLL_DIVISOR_V 10.0 +#define SCROLL_DIVISOR_H 30.0 +#define SCROLL_DIVISOR_V 30.0 /* * OLED diff --git a/keyboards/gggw/crosses/lib/crosses.c b/keyboards/gggw/crosses/lib/crosses.c index b715034a11e..72324919774 100644 --- a/keyboards/gggw/crosses/lib/crosses.c +++ b/keyboards/gggw/crosses/lib/crosses.c @@ -92,12 +92,12 @@ report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { scroll_acc_v += (float)mouse_report.y / SCROLL_DIVISOR_V; // Assign integer parts of accumulated scroll values to the mouse report - mouse_report.h = (int8_t)scroll_acc_h; - mouse_report.v = (int8_t)scroll_acc_v; + mouse_report.h = (int16_t)scroll_acc_h; + mouse_report.v = (int16_t)scroll_acc_v; // Update accumulated scroll values by subtracting the integer parts - scroll_acc_h -= (int8_t)scroll_acc_h; - scroll_acc_v -= (int8_t)scroll_acc_v; + scroll_acc_h -= (int16_t)scroll_acc_h; + scroll_acc_v -= (int16_t)scroll_acc_v; // Clear the X and Y values of the mouse report mouse_report.x = 0; From 3f1d0394210881ad2e0bf4e324ad986120fb026d Mon Sep 17 00:00:00 2001 From: vinniefranco Date: Sat, 28 Dec 2024 17:30:19 -0600 Subject: [PATCH 05/48] [MINOR] Dual trackball firmware --- .../gggw/crosses/3x5/keymaps/default/keymap.c | 61 +++++++------- keyboards/gggw/crosses/config.h | 29 +++++-- keyboards/gggw/crosses/lib/crosses.c | 84 +++++++++++++++++-- keyboards/gggw/crosses/lib/crosses.h | 10 ++- keyboards/gggw/crosses/readme.md | 16 ++-- 5 files changed, 145 insertions(+), 55 deletions(-) diff --git a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c index 78b08a0472d..7da5fd1a304 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c @@ -3,14 +3,9 @@ #include QMK_KEYBOARD_H - #include "lib/achordion.h" #include "lib/crosses.h" -#ifdef CONSOLE_ENABLE -# include "print.h" -#endif /* ifdef CONSOLE_ENABLE */ - /* * Keycodes, combos, and layers! oh my! */ @@ -115,36 +110,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS , KC_0 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS ), -// ┌──────┬──────┬──────┬───────┬─────┐ ┌─────┬──────┬──────┬──────┬──────┐ -// │ │ │ │ │ │ │ │ │ │ │ │ -// ├──────┼──────┼──────┼───────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ -// │ lgui │ lalt │ lctl │ lsft │ │ │ │ left │ down │ up │ rght │ -// ├──────┼──────┼──────┼───────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ -// │ │ │ copy │ paste │ │ │ │ home │ end │ pgdn │ pgup │ -// └──────┴──────┴──────┼───────┼─────┼─────┐ ┌─────┼─────┼──────┼──────┴──────┴──────┘ -// │ │ │ │ │ │ │ │ -// └───────┴─────┴─────┘ └─────┴─────┴──────┘ +// ┌──────┬──────┬──────┬───────┬────┐ ┌────┬──────┬──────┬──────┬──────┐ +// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ +// ├──────┼──────┼──────┼───────┼────┤ ├────┼──────┼──────┼──────┼──────┤ +// │ lgui │ lalt │ lctl │ lsft │ no │ │ no │ left │ down │ up │ rght │ +// ├──────┼──────┼──────┼───────┼────┤ ├────┼──────┼──────┼──────┼──────┤ +// │ no │ no │ copy │ paste │ no │ │ no │ home │ end │ pgdn │ pgup │ +// └──────┴──────┴──────┼───────┼────┼────┐ ┌────┼────┼──────┼──────┴──────┴──────┘ +// │ no │ no │ no │ │ no │ no │ no │ +// └───────┴────┴────┘ └────┴────┴──────┘ [_NAV] = LAYOUT_default( - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, - KC_LGUI , KC_LALT , KC_LCTL , KC_LSFT , KC_TRNS , KC_TRNS , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT, - KC_TRNS , KC_TRNS , KC_COPY , KC_PSTE , KC_TRNS , KC_TRNS , KC_HOME , KC_END , KC_PGDN , KC_PGUP, - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS + KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , + KC_LGUI , KC_LALT , KC_LCTL , KC_LSFT , KC_NO , KC_NO , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT, + KC_NO , KC_NO , KC_COPY , KC_PSTE , KC_NO , KC_NO , KC_HOME , KC_END , KC_PGDN , KC_PGUP, + KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO ), -// ┌──────┬──────┬──────┬──────┬──────┐ ┌─────┬─────┬─────┬─────┬─────┐ -// │ │ │ │ │ │ │ │ │ │ │ │ -// ├──────┼──────┼──────┼──────┼──────┤ ├─────┼─────┼─────┼─────┼─────┤ -// │ mprv │ vold │ mply │ volu │ mnxt │ │ │ │ │ │ │ -// ├──────┼──────┼──────┼──────┼──────┤ ├─────┼─────┼─────┼─────┼─────┤ -// │ │ │ │ │ │ │ │ │ │ │ │ -// └──────┴──────┴──────┼──────┼──────┼─────┐ ┌─────┼─────┼─────┼─────┴─────┴─────┘ -// │ │ │ │ │ │ │ │ -// └──────┴──────┴─────┘ └─────┴─────┴─────┘ +// ┌──────┬──────┬──────┬──────┬──────┐ ┌────┬────┬────┬────┬────┐ +// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ +// ├──────┼──────┼──────┼──────┼──────┤ ├────┼────┼────┼────┼────┤ +// │ mprv │ vold │ mply │ volu │ mnxt │ │ no │ no │ no │ no │ no │ +// ├──────┼──────┼──────┼──────┼──────┤ ├────┼────┼────┼────┼────┤ +// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ +// └──────┴──────┴──────┼──────┼──────┼────┐ ┌────┼────┼────┼────┴────┴────┘ +// │ no │ no │ no │ │ no │ no │ no │ +// └──────┴──────┴────┘ └────┴────┴────┘ [_MEDIA] = LAYOUT_default( - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, - KC_MPRV , KC_VOLD , KC_MPLY , KC_VOLU , KC_MNXT , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS + KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, + KC_MPRV , KC_VOLD , KC_MPLY , KC_VOLU , KC_MNXT , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, + KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, + KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO ), // ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬──────┬──────┬──────┬──────┐ @@ -281,10 +276,10 @@ void matrix_scan_user(void) { oled_rotation_t oled_init_user(oled_rotation_t rotation) { if (!is_keyboard_master()) { - return rotation; + return OLED_ROTATION_180; } - return OLED_ROTATION_180; + return rotation; } static void render_logo(void) { diff --git a/keyboards/gggw/crosses/config.h b/keyboards/gggw/crosses/config.h index 54d0e8b35eb..c801e22e887 100644 --- a/keyboards/gggw/crosses/config.h +++ b/keyboards/gggw/crosses/config.h @@ -2,14 +2,33 @@ #define SERIAL_PIO_USE_PIO1 -/* - * PMW3360 Setup - */ +/****************************************************************** + * Trackball Setup + ******************************************************************/ +// Enable if you have a trackball #define SPLIT_POINTING_ENABLE -#define POINTING_DEVICE_RIGHT -#define POINTING_DEVICE_INVERT_Y +/* + * Undomment ONLY ONE of the following defines + */ +// Using a single trackball on the right hand side +// #define POINTING_DEVICE_RIGHT + +// Using a sinble trackball on the left hand side +// #define POINTING_DEVICE_LEFT + +// Rocking dual trackballs! +#define POINTING_DEVICE_COMBINED + +#ifdef POINTING_DEVICE_COMBINED +# define POINTING_DEVICE_INVERT_Y_RIGHT +#endif // POINTING_DEVICE_COMBINED + // +#ifdef POINTING_DEVICE_RIGHT +# define POINTING_DEVICE_INVERT_Y +#endif // POINTING_DEVICE_RIGHT + #define POINTING_DEVICE_TASK_THROTTLE_MS 10 #define POINTING_DEVICE_AUTO_MOUSE_ENABLE #define AUTO_MOUSE_TIME 600 diff --git a/keyboards/gggw/crosses/lib/crosses.c b/keyboards/gggw/crosses/lib/crosses.c index 72324919774..b2bdd00127a 100644 --- a/keyboards/gggw/crosses/lib/crosses.c +++ b/keyboards/gggw/crosses/lib/crosses.c @@ -1,6 +1,28 @@ +/* +This is the c library for EEPROM and other Crosses features. +You should not need to modify it as config comes from config.h +Copyright 2024 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ #include "crosses.h" +#ifdef CONSOLE_ENABLE +# include "print.h" +#endif /* ifdef CONSOLE_ENABLE */ + bool set_scrolling = false; float scroll_acc_h = 0.0; @@ -9,10 +31,9 @@ float scroll_acc_v = 0.0; const uint16_t MIN_DEFAULT_DPI = 400; const uint16_t MAX_DEFAULT_DPI = 10000; - -/* - * Pointer Storage - */ +/*********************************************************************** + * Pointer Stroage + ***********************************************************************/ global_user_config_t global_user_config = {0}; @@ -35,7 +56,14 @@ uint16_t get_pointer_dpi(global_user_config_t* config) { } void update_pointer_cpi(global_user_config_t* config) { +#ifdef POINTING_DEVICE_COMBINED + pointing_device_set_cpi_on_side(true, 1000); + pointing_device_set_cpi_on_side(false, get_pointer_dpi(config)); +#endif /* ifdef POINTING_DEVICE_COMBINED */ + +#ifndef POINTING_DEVICE_COMBINED pointing_device_set_cpi(get_pointer_dpi(config)); +#endif /* ifndef POINTING_DEVICE_COMBINED */ } void change_pointer_dpi(global_user_config_t* config, bool inc) { @@ -57,7 +85,14 @@ void change_pointer_dpi(global_user_config_t* config, bool inc) { } config->mse_cpi += inc ? 10 : -10; + +#ifdef POINTING_DEVICE_COMBINED + pointing_device_set_cpi_on_side(false, get_pointer_dpi(config)); +#endif /* ifdef POINTING_DEVICE_COMBINED */ + +#ifndef POINTING_DEVICE_COMBINED pointing_device_set_cpi(get_pointer_dpi(config)); +#endif /* ifndef POINTING_DEVICE_COMBINED */ write_config_to_eeprom(&global_user_config); } @@ -81,9 +116,11 @@ void eeconfig_init_user(void) { debug_config_to_console(&global_user_config); } -/* - * Pointing Device Config - */ +/*********************************************************************** + * Single Trackball Config + ***********************************************************************/ + +#ifndef POINTING_DEVICE_COMBINED report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { if (set_scrolling) { @@ -107,11 +144,42 @@ report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { return mouse_report; } +#endif /* ifndef POINTING_DEVICE_COMBINED */ + +/*********************************************************************** + * Dual Trackball Config + ***********************************************************************/ + +#ifdef POINTING_DEVICE_COMBINED + +report_mouse_t pointing_device_task_combined_user(report_mouse_t left_report, report_mouse_t right_report) { + // Calculate and accumulate scroll values based on mouse movement and divisors + scroll_acc_h += (float)left_report.x / SCROLL_DIVISOR_H; + scroll_acc_v += (float)left_report.y / SCROLL_DIVISOR_V; + + // Assign integer parts of accumulated scroll values to the mouse report + left_report.h = (int16_t)scroll_acc_h; + left_report.v = (int16_t)scroll_acc_v; + + // Update accumulated scroll values by subtracting the integer parts + scroll_acc_h -= (int16_t)scroll_acc_h; + scroll_acc_v -= (int16_t)scroll_acc_v; + + // Clear the X and Y values of the mouse report + left_report.x = 0; + left_report.y = 0; + + return pointing_device_combine_reports(left_report, right_report); +} + +#endif /* ifdef POINTING_DEVICE_COMBINED */ + layer_state_t layer_state_set_user(layer_state_t state) { +#ifndef POINTING_DEVICE_COMBINED if (get_highest_layer(state) != 5) { set_scrolling = false; } +#endif /* ifndef POINTING_DEVICE_COMBINED */ return state; } - diff --git a/keyboards/gggw/crosses/lib/crosses.h b/keyboards/gggw/crosses/lib/crosses.h index 8650246752f..480ce2b7295 100644 --- a/keyboards/gggw/crosses/lib/crosses.h +++ b/keyboards/gggw/crosses/lib/crosses.h @@ -1,6 +1,5 @@ #pragma once - #include "quantum.h" #ifdef __cplusplus @@ -8,7 +7,7 @@ extern "C" { #endif #ifndef CROSSES_CORE_H -#define CROSSES_CORE_H +# define CROSSES_CORE_H /* * Pointer Storage @@ -46,7 +45,13 @@ extern bool set_scrolling; extern float scroll_acc_h; extern float scroll_acc_v; +# ifndef POINTING_DEVICE_COMBINED report_mouse_t pointing_device_task_user(report_mouse_t mouse_report); +# endif // !POINTING_DEVICE_COMBINED + // +# ifdef POINTING_DEVICE_COMBINED +report_mouse_t pointing_device_task_combined_user(report_mouse_t left_report, report_mouse_t right_report); +# endif // POINTINTG_DEVICE_COMBINED layer_state_t layer_state_set_user(layer_state_t state); @@ -55,4 +60,3 @@ layer_state_t layer_state_set_user(layer_state_t state); #ifdef __cplusplus } #endif - diff --git a/keyboards/gggw/crosses/readme.md b/keyboards/gggw/crosses/readme.md index fd805d53773..0840490062b 100644 --- a/keyboards/gggw/crosses/readme.md +++ b/keyboards/gggw/crosses/readme.md @@ -1,20 +1,24 @@ -# crosses +# Crosses by Good Great Grand Wonderful ![crosses](imgur.com image replace me!) *A short description of the keyboard/project* -* Keyboard Maintainer: [Vincent Franco](https://github.com/vinniefranco) -* Hardware Supported: *The PCBs, controllers supported* +* Keyboard Maintainer: [Good Great Grand Wonderful LLC](https://github.com/Good-Great-Grand-Wonderful) +* Hardware Supported: + * Matrix configurations in: 3x5, 3x6, 4x6 boards with a three key thumb cluster. + * Trackballs! + * OLED Displays + * Any SPI / I2C breakout using a 6P JST SH for SPI and a 2.57 breakout for I2C. * Hardware Availability: *Links to where you can find this hardware* Make example for this keyboard (after setting up your build environment): - make crosses:default + qmk compile -kb gggw/crosses/ -km default Flashing example for this keyboard: - make crosses:default:flash + qmk flash -kb gggw/crosses/ -km default See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). @@ -23,5 +27,5 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to Enter the bootloader in 3 ways: * **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard -* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead +* **Physical reset button**: Double-tap the reset button on the RP2040 * **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available From 8ac2d228e1ee40b779924c82180824f291223857 Mon Sep 17 00:00:00 2001 From: vinniefranco Date: Wed, 1 Jan 2025 22:34:53 -0600 Subject: [PATCH 06/48] Adding sweepy keymap --- .../gggw/crosses/3x5/keymaps/sweepy/keymap.c | 210 ++++++++++++++++++ .../gggw/crosses/3x5/keymaps/sweepy/rules.mk | 2 + 2 files changed, 212 insertions(+) create mode 100644 keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c create mode 100644 keyboards/gggw/crosses/3x5/keymaps/sweepy/rules.mk diff --git a/keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c new file mode 100644 index 00000000000..1d00746a542 --- /dev/null +++ b/keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c @@ -0,0 +1,210 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +#include "lib/crosses.h" + +enum CROSSES_LAYERS { + _BASE, + _MOUS, + _NAV, + _SYM, + _BRC, + _FUNC, + _NUM, + _MISC, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// ┌───────────┬───────────┬───────────┬──────────┬──────┐ ┌────────────┬──────────┬───────────┬───────────┬───────────┐ +// │ q │ w │ e │ r │ t │ │ y │ u │ i │ o │ p │ +// ├───────────┼───────────┼───────────┼──────────┼──────┤ ├────────────┼──────────┼───────────┼───────────┼───────────┤ +// │ LSFT_T(a) │ LT(5, s) │ LT(1, d) │ LT(3, f) │ g │ │ h │ LT(4, j) │ LT(2, k) │ LT(6, l) │ LSFT_T(;) │ +// ├───────────┼───────────┼───────────┼──────────┼──────┤ ├────────────┼──────────┼───────────┼───────────┼───────────┤ +// │ z │ LCTL_T(x) │ LALT_T(c) │ v │ b │ │ n │ m │ LALT_T(,) │ LCTL_T(.) │ / │ +// └───────────┴───────────┴───────────┼──────────┼──────┼────────────┐ ┌──────┼────────────┼──────────┼───────────┴───────────┴───────────┘ +// │ kp_0 │ bspc │ LT(7, spc) │ │ kp_1 │ LT(7, spc) │ kp_1 │ +// └──────────┴──────┴────────────┘ └──────┴────────────┴──────────┘ +[_BASE] = LAYOUT_default( + KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , + LSFT_T(KC_A) , LT(5, KC_S) , LT(1, KC_D) , LT(3, KC_F) , KC_G , KC_H , LT(4, KC_J) , LT(2, KC_K) , LT(6, KC_L) , LSFT_T(KC_SCLN), + KC_Z , LCTL_T(KC_X) , LALT_T(KC_C) , KC_V , KC_B , KC_N , KC_M , LALT_T(KC_COMM) , LCTL_T(KC_DOT) , KC_SLSH , + KC_P0 , KC_BSPC , LT(7, KC_SPC) , KC_P1 , LT(7, KC_SPC) , KC_P1 +), + +// ┌─────┬──────┬─────┬──────┬─────┐ ┌─────┬──────┬──────┬──────┬──────┐ +// │ │ │ │ │ │ │ │ btn1 │ wh_u │ btn2 │ │ +// ├─────┼──────┼─────┼──────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ +// │ │ btn2 │ no │ btn1 │ │ │ │ ms_l │ ms_d │ ms_u │ ms_r │ +// ├─────┼──────┼─────┼──────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ +// │ │ │ │ │ │ │ │ wh_l │ wh_d │ wh_r │ │ +// └─────┴──────┴─────┼──────┼─────┼─────┐ ┌─────┼─────┼──────┼──────┴──────┴──────┘ +// │ │ │ │ │ │ no │ no │ +// └──────┴─────┴─────┘ └─────┴─────┴──────┘ +[_MOUS] = LAYOUT_default( + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_BTN1 , KC_WH_U , KC_BTN2 , KC_TRNS, + KC_TRNS , KC_BTN2 , KC_NO , KC_BTN1 , KC_TRNS , KC_TRNS , KC_MS_L , KC_MS_D , KC_MS_U , KC_MS_R, + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_WH_L , KC_WH_D , KC_WH_R , KC_TRNS, + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_NO , KC_NO +), + +// ┌──────┬──────┬──────┬──────┬─────┐ ┌─────┬──────┬─────┬────────────┬───────────┐ +// │ │ │ pgup │ │ │ │ │ │ │ │ │ +// ├──────┼──────┼──────┼──────┼─────┤ ├─────┼──────┼─────┼────────────┼───────────┤ +// │ left │ up │ down │ rght │ │ │ │ lgui │ no │ LCTL(lalt) │ LCA(lsft) │ +// ├──────┼──────┼──────┼──────┼─────┤ ├─────┼──────┼─────┼────────────┼───────────┤ +// │ │ home │ pgdn │ end │ │ │ │ │ │ │ │ +// └──────┴──────┴──────┼──────┼─────┼─────┐ ┌─────┼─────┼──────┼─────┴────────────┴───────────┘ +// │ │ │ │ │ │ no │ no │ +// └──────┴─────┴─────┘ └─────┴─────┴──────┘ +[_NAV] = LAYOUT_default( + KC_TRNS , KC_TRNS , KC_PGUP , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , + KC_LEFT , KC_UP , KC_DOWN , KC_RGHT , KC_TRNS , KC_TRNS , KC_LGUI , KC_NO , LCTL(KC_LALT) , LCA(KC_LSFT), + KC_TRNS , KC_HOME , KC_PGDN , KC_END , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_NO , KC_NO +), + +// ┌─────┬─────┬─────┬─────────┬─────┐ ┌─────┬────┬───┬───┬─────┐ +// │ │ │ │ │ │ │ │ _ │ | │ ' │ │ +// ├─────┼─────┼─────┼─────────┼─────┤ ├─────┼────┼───┼───┼─────┤ +// │ ^ │ * │ & │ no │ │ │ # │ ~ │ / │ " │ $ │ +// ├─────┼─────┼─────┼─────────┼─────┤ ├─────┼────┼───┼───┼─────┤ +// │ │ │ │ │ │ │ │ - │ \ │ ` │ │ +// └─────┴─────┴─────┼─────────┼─────┼─────┐ ┌─────────┼─────┼────┼───┴───┴─────┘ +// │ RM_PREV │ │ │ │ RM_NEXT │ no │ no │ +// └─────────┴─────┴─────┘ └─────────┴─────┴────┘ +[_SYM] = LAYOUT_default( + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_UNDS , KC_PIPE , KC_QUOT , KC_TRNS, + KC_CIRC , KC_ASTR , KC_AMPR , KC_NO , KC_TRNS , KC_HASH , KC_TILD , KC_SLSH , KC_DQUO , KC_DLR , + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_MINS , KC_BSLS , KC_GRV , KC_TRNS, + RM_PREV , KC_TRNS , KC_TRNS , RM_NEXT , KC_NO , KC_NO +), + +// ┌─────┬───┬───┬──────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ +// │ │ : │ < │ > │ ; │ │ │ │ │ │ │ +// ├─────┼───┼───┼──────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ +// │ { │ } │ ( │ ) │ @ │ │ │ no │ = │ + │ % │ +// ├─────┼───┼───┼──────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ +// │ │ ! │ [ │ ] │ │ │ │ │ │ │ │ +// └─────┴───┴───┼──────┼─────┼─────┐ ┌──────┼─────┼─────┼─────┴─────┴─────┘ +// │ vold │ │ │ │ volu │ no │ no │ +// └──────┴─────┴─────┘ └──────┴─────┴─────┘ +[_BRC] = LAYOUT_default( + KC_TRNS , KC_COLN , KC_LT , KC_GT , KC_SCLN , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, + KC_LCBR , KC_RCBR , KC_LPRN , KC_RPRN , KC_AT , KC_TRNS , KC_NO , KC_EQL , KC_PLUS , KC_PERC, + KC_TRNS , KC_EXLM , KC_LBRC , KC_RBRC , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, + KC_VOLD , KC_TRNS , KC_TRNS , KC_VOLU , KC_NO , KC_NO +), + +// ┌─────┬─────┬────────────┬─────┬─────┐ ┌─────┬────┬────┬────┬─────┐ +// │ │ │ │ │ │ │ │ f7 │ f8 │ f9 │ f10 │ +// ├─────┼─────┼────────────┼─────┼─────┤ ├─────┼────┼────┼────┼─────┤ +// │ │ no │ LCTL(lalt) │ │ │ │ │ f4 │ f5 │ f6 │ f11 │ +// ├─────┼─────┼────────────┼─────┼─────┤ ├─────┼────┼────┼────┼─────┤ +// │ │ │ │ │ │ │ │ f1 │ f2 │ f3 │ f12 │ +// └─────┴─────┴────────────┼─────┼─────┼─────┐ ┌─────┼─────┼────┼────┴────┴─────┘ +// │ │ │ │ │ │ no │ no │ +// └─────┴─────┴─────┘ └─────┴─────┴────┘ +[_FUNC] = LAYOUT_default( + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_F7 , KC_F8 , KC_F9 , KC_F10, + KC_TRNS , KC_NO , LCTL(KC_LALT) , KC_TRNS , KC_TRNS , KC_TRNS , KC_F4 , KC_F5 , KC_F6 , KC_F11, + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_F1 , KC_F2 , KC_F3 , KC_F12, + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_NO , KC_NO +), + +// ┌──────┬───┬───┬─────┬──────┐ ┌─────┬─────┬─────┬─────┬─────┐ +// │ kp_/ │ 7 │ 8 │ 9 │ kp_+ │ │ │ │ │ │ │ +// ├──────┼───┼───┼─────┼──────┤ ├─────┼─────┼─────┼─────┼─────┤ +// │ 0 │ 1 │ 2 │ 3 │ kp_- │ │ │ │ │ no │ │ +// ├──────┼───┼───┼─────┼──────┤ ├─────┼─────┼─────┼─────┼─────┤ +// │ kp_* │ 4 │ 5 │ 6 │ kp_= │ │ │ │ │ │ │ +// └──────┴───┴───┼─────┼──────┼─────┐ ┌─────┼─────┼─────┼─────┴─────┴─────┘ +// │ │ │ │ │ │ no │ no │ +// └─────┴──────┴─────┘ └─────┴─────┴─────┘ +[_NUM] = LAYOUT_default( + KC_PSLS , KC_7 , KC_8 , KC_9 , KC_PPLS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, + KC_0 , KC_1 , KC_2 , KC_3 , KC_PMNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_NO , KC_TRNS, + KC_PAST , KC_4 , KC_5 , KC_6 , KC_PEQL , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_NO , KC_NO +), + +// ┌─────┬─────┬─────┬─────┬─────┐ ┌───────┬──────┬───────────┬───────────┬─────────┐ +// │ │ │ : │ esc │ │ │ │ │ │ │ del │ +// ├─────┼─────┼─────┼─────┼─────┤ ├───────┼──────┼───────────┼───────────┼─────────┤ +// │ │ % │ / │ ent │ │ │ DF(1) │ lgui │ │ │ │ +// ├─────┼─────┼─────┼─────┼─────┤ ├───────┼──────┼───────────┼───────────┼─────────┤ +// │ │ │ │ ! │ │ │ DF(0) │ │ RALT_T(,) │ RCTL_T(.) │ QK_BOOT │ +// └─────┴─────┴─────┼─────┼─────┼────┐ ┌─────┼───────┼──────┼───────────┴───────────┴─────────┘ +// │ │ tab │ no │ │ │ no │ no │ +// └─────┴─────┴────┘ └─────┴───────┴──────┘ +[_MISC] = LAYOUT_default( + KC_TRNS , KC_TRNS , KC_COLN , KC_ESC , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_DEL , + KC_TRNS , KC_PERC , KC_SLSH , KC_ENT , KC_TRNS , DF(1) , KC_LGUI , KC_TRNS , KC_TRNS , KC_TRNS, + KC_TRNS , KC_TRNS , KC_TRNS , KC_EXLM , KC_TRNS , DF(0) , KC_TRNS , RALT_T(KC_COMM) , RCTL_T(KC_DOT) , QK_BOOT, + KC_TRNS , KC_TAB , KC_NO , KC_TRNS , KC_NO , KC_NO +) +}; + +#ifdef OLED_ENABLE + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (!is_keyboard_master()) { + return OLED_ROTATION_180; + } + + return rotation; +} + +static void render_logo(void) { + static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; + + oled_write_P(qmk_logo, false); +} + +bool oled_task_user(void) { + render_logo(); + + switch (get_highest_layer(layer_state)) { + case _BASE: + oled_write_P(PSTR(">>> BASE "), false); + break; + case _MOUS: + oled_write_P(PSTR(">>> MOUSE "), false); + break; + case _NAV: + oled_write_P(PSTR(">>> NAVI "), false); + break; + case _SYM: + oled_write_P(PSTR(">>> SYM"), false); + break; + case _BRC: + oled_write_P(PSTR(">>> BRC"), false); + break; + case _FUNC: + oled_write_P(PSTR(">>> FUNC "), false); + break; + case _NUM: + oled_write_P(PSTR(">>> NUM"), false); + break; + case _MISC: + oled_write_P(PSTR(">>> MISC"), false); + break; + default: + break; + } + // oled_write_ln_P(get_u16_str(get_pointer_dpi(&global_user_config), '0'), false); + return false; +} +#endif /* ifdef OLED_ENABLE */ + +void keyboard_post_init_user(void) { + global_user_config.raw = eeconfig_read_user(); + update_pointer_cpi(&global_user_config); + write_config_to_eeprom(&global_user_config); +} + +void pointing_device_init_user(void) { + set_auto_mouse_layer(_MOUS); + set_auto_mouse_enable(true); +} diff --git a/keyboards/gggw/crosses/3x5/keymaps/sweepy/rules.mk b/keyboards/gggw/crosses/3x5/keymaps/sweepy/rules.mk new file mode 100644 index 00000000000..9d9e625c983 --- /dev/null +++ b/keyboards/gggw/crosses/3x5/keymaps/sweepy/rules.mk @@ -0,0 +1,2 @@ +COMBO_ENABLE = no +CAPS_WORD_ENABLE = yes From db93476245e39a48645d1d31f5b29b73c313fbcd Mon Sep 17 00:00:00 2001 From: vinniefranco Date: Wed, 1 Jan 2025 22:36:48 -0600 Subject: [PATCH 07/48] fixup --- keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c index 1d00746a542..4df6fee0e4e 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c @@ -193,7 +193,6 @@ bool oled_task_user(void) { default: break; } - // oled_write_ln_P(get_u16_str(get_pointer_dpi(&global_user_config), '0'), false); return false; } #endif /* ifdef OLED_ENABLE */ From f889a0bb30da545f94200c0687945b4459217cad Mon Sep 17 00:00:00 2001 From: vinniefranco Date: Wed, 1 Jan 2025 22:37:17 -0600 Subject: [PATCH 08/48] fixup --- keyboards/gggw/crosses/3x5/keymaps/default/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c index 7da5fd1a304..60598358209 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c @@ -322,7 +322,7 @@ bool oled_task_user(void) { default: break; } - // oled_write_ln_P(get_u16_str(get_pointer_dpi(&global_user_config), '0'), false); + return false; } #endif /* ifdef OLED_ENABLE */ From fdf4baa0c5e38be6f0e5c44d8ffd476b23ccac2e Mon Sep 17 00:00:00 2001 From: vinniefranco Date: Wed, 1 Jan 2025 22:57:28 -0600 Subject: [PATCH 09/48] fixup --- .../gggw/crosses/3x5/keymaps/default/keymap.c | 33 ++++++---------- .../gggw/crosses/3x5/keymaps/sweepy/keymap.c | 39 ++++++------------- 2 files changed, 22 insertions(+), 50 deletions(-) diff --git a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c index 60598358209..6aa55d86f9c 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c @@ -1,6 +1,7 @@ // Copyright 2023 QMK // SPDX-License-Identifier: GPL-2.0-or-later +#include "action_layer.h" #include QMK_KEYBOARD_H #include "lib/achordion.h" @@ -300,28 +301,16 @@ static void render_logo(void) { bool oled_task_user(void) { render_logo(); - switch (get_highest_layer(layer_state)) { - case _BASE: - oled_write_P(PSTR(">>> BASE "), false); - break; - case _NUM: - oled_write_P(PSTR(">>> PROG "), false); - break; - case _NAV: - oled_write_P(PSTR(">>> NAVI "), false); - break; - case _MEDIA: - oled_write_P(PSTR(">>> MEDIA"), false); - break; - case _FUNC: - oled_write_P(PSTR(">>> FUNC "), false); - break; - case _MOUS: - oled_write_P(PSTR(">>> MOUSE"), false); - break; - default: - break; - } + const char *layer_names[] = { + [ _BASE ] = ">> BASE ", + [ _NUM ] = ">> PROG ", + [ _NAV ] = ">> NAVI ", + [ _MEDIA ] = ">>> MEDIA ", + [ _FUNC ] = ">>> FUNC ", + [ _MOUS ] = ">>> MOUSE ", + }; + + oled_write_P(PSTR(layer_names[get_highest_layer(layer_state)]), false); return false; } diff --git a/keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c index 4df6fee0e4e..c14b590ea02 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c @@ -164,35 +164,18 @@ static void render_logo(void) { bool oled_task_user(void) { render_logo(); + const char *layer_names[] = { + [ _BASE ] = ">>> BASE ", + [ _MOUS ] = ">>> MOUSE ", + [ _NAV ] = ">>> NAVI ", + [ _SYM ] = ">>> SYM", + [ _BRC ] = ">>> BRC", + [ _FUNC ] = ">>> FUNC ", + [ _NUM ] = ">>> NUM", + [ _MISC ] = ">>> MISC" + }; - switch (get_highest_layer(layer_state)) { - case _BASE: - oled_write_P(PSTR(">>> BASE "), false); - break; - case _MOUS: - oled_write_P(PSTR(">>> MOUSE "), false); - break; - case _NAV: - oled_write_P(PSTR(">>> NAVI "), false); - break; - case _SYM: - oled_write_P(PSTR(">>> SYM"), false); - break; - case _BRC: - oled_write_P(PSTR(">>> BRC"), false); - break; - case _FUNC: - oled_write_P(PSTR(">>> FUNC "), false); - break; - case _NUM: - oled_write_P(PSTR(">>> NUM"), false); - break; - case _MISC: - oled_write_P(PSTR(">>> MISC"), false); - break; - default: - break; - } + oled_write_P(PSTR(layer_names[get_highest_layer(layer_state)]), false); return false; } #endif /* ifdef OLED_ENABLE */ From 4fa0346089be63fede11d45e1de27716f3edbbea Mon Sep 17 00:00:00 2001 From: vinniefranco Date: Fri, 10 Jan 2025 13:38:14 -0600 Subject: [PATCH 10/48] Final --- keyboards/gggw/crosses/3x5/keyboard.json | 2 +- .../gggw/crosses/3x5/keymaps/default/keymap.c | 51 ++++++++----------- 2 files changed, 21 insertions(+), 32 deletions(-) diff --git a/keyboards/gggw/crosses/3x5/keyboard.json b/keyboards/gggw/crosses/3x5/keyboard.json index 22dc8fe9d8a..9edbb3b5544 100644 --- a/keyboards/gggw/crosses/3x5/keyboard.json +++ b/keyboards/gggw/crosses/3x5/keyboard.json @@ -33,7 +33,7 @@ "tapping": { "term": 195 }, - "url": "", + "url": "https://ergokeyboards.com", "usb": { "device_version": "0.3.0", "pid": "0x5647", diff --git a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c index 6aa55d86f9c..f0cd86db14c 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c @@ -33,7 +33,6 @@ enum my_keycodes { DRAG_SCROLL, }; - enum combos { WY_TAB, DH_CAPS, @@ -60,6 +59,8 @@ const uint16_t PROGMEM gm_combo[] = {KC_G, KC_M, COMBO_END}; const uint16_t PROGMEM comd_combo[] = {KC_COMM, KC_DOT, COMBO_END}; const uint16_t PROGMEM zdot_combo[] = {KC_Z, KC_DOT, COMBO_END}; +// clang-format off +// combo_t key_combos[] = { [WY_TAB] = COMBO(wy_combo, KC_TAB), [DH_CAPS] = COMBO(dh_combo, CW_TOGG), @@ -79,20 +80,20 @@ combo_t key_combos[] = { */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -// ┌───────────┬───────────┬───────────┬───────────┬────────────┐ ┌──────┬───────────┬───────────┬───────────┬───────────┐ -// │ q │ w │ f │ p │ b │ │ j │ l │ u │ y │ ; │ -// ├───────────┼───────────┼───────────┼───────────┼────────────┤ ├──────┼───────────┼───────────┼───────────┼───────────┤ -// │ LGUI_T(a) │ LALT_T(r) │ LCTL_T(s) │ LSFT_T(t) │ g │ │ m │ RSFT_T(n) │ RCTL_T(e) │ RALT_T(i) │ RGUI_T(o) │ -// ├───────────┼───────────┼───────────┼───────────┼────────────┤ ├──────┼───────────┼───────────┼───────────┼───────────┤ -// │ z │ x │ c │ d │ v │ │ k │ h │ , │ . │ LT(3, /) │ -// └───────────┴───────────┴───────────┼───────────┼────────────┼─────┐ ┌────────────┼──────┼───────────┼───────────┴───────────┴───────────┘ -// │ MO(5) │ LT(2, esc) │ spc │ │ LT(1, ent) │ bspc │ MO(4) │ -// └───────────┴────────────┴─────┘ └────────────┴──────┴───────────┘ +// ┌───────────┬───────────┬───────────┬───────────┬────────────┐ ┌──────┬────────────┬───────────┬───────────┬───────────┐ +// │ q │ w │ f │ p │ b │ │ j │ l │ u │ y │ ; │ +// ├───────────┼───────────┼───────────┼───────────┼────────────┤ ├──────┼────────────┼───────────┼───────────┼───────────┤ +// │ LGUI_T(a) │ LALT_T(r) │ LCTL_T(s) │ LSFT_T(t) │ g │ │ m │ RSFT_T(n) │ RCTL_T(e) │ RALT_T(i) │ RGUI_T(o) │ +// ├───────────┼───────────┼───────────┼───────────┼────────────┤ ├──────┼────────────┼───────────┼───────────┼───────────┤ +// │ z │ x │ c │ d │ v │ │ k │ h │ , │ . │ LT(3, /) │ +// └───────────┴───────────┴───────────┼───────────┼────────────┼─────┐ ┌────────────┼──────┼────────────┼───────────┴───────────┴───────────┘ +// │ MO(5) │ LT(2, esc) │ spc │ │ LT(1, ent) │ bspc │ LT(4, del) │ +// └───────────┴────────────┴─────┘ └────────────┴──────┴────────────┘ [_BASE] = LAYOUT_default( - KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , - LGUI_T(KC_A) , LALT_T(KC_R) , LCTL_T(KC_S) , LSFT_T(KC_T) , KC_G , KC_M , RSFT_T(KC_N) , RCTL_T(KC_E) , RALT_T(KC_I) , RGUI_T(KC_O) , - KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , LT(3, KC_SLSH), - MO(5) , LT(2, KC_ESC) , KC_SPC , LT(1, KC_ENT) , KC_BSPC , MO(4) + KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , + LGUI_T(KC_A) , LALT_T(KC_R) , LCTL_T(KC_S) , LSFT_T(KC_T) , KC_G , KC_M , RSFT_T(KC_N) , RCTL_T(KC_E) , RALT_T(KC_I) , RGUI_T(KC_O) , + KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , LT(3, KC_SLSH), + MO(5) , LT(2, KC_ESC) , KC_SPC , LT(1, KC_ENT) , KC_BSPC , LT(4, KC_DEL) ), // ┌──────┬───┬───┬───────────┬──────┐ ┌──────┬───────────┬───────────┬──────┬─────┐ @@ -176,6 +177,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; +// clang-format on + bool process_record_user(uint16_t keycode, keyrecord_t* record) { if (!process_achordion(keycode, record)) { return false; @@ -284,16 +287,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) { } static void render_logo(void) { - static const char PROGMEM qmk_logo[] = { - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, - 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, - 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, - 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, - 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, - 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, - 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00 - }; + static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; oled_write_P(qmk_logo, false); } @@ -301,13 +295,8 @@ static void render_logo(void) { bool oled_task_user(void) { render_logo(); - const char *layer_names[] = { - [ _BASE ] = ">> BASE ", - [ _NUM ] = ">> PROG ", - [ _NAV ] = ">> NAVI ", - [ _MEDIA ] = ">>> MEDIA ", - [ _FUNC ] = ">>> FUNC ", - [ _MOUS ] = ">>> MOUSE ", + const char* layer_names[] = { + [_BASE] = ">> BASE ", [_NUM] = ">> PROG ", [_NAV] = ">> NAVI ", [_MEDIA] = ">>> MEDIA ", [_FUNC] = ">>> FUNC ", [_MOUS] = ">>> MOUSE ", }; oled_write_P(PSTR(layer_names[get_highest_layer(layer_state)]), false); From 68526d89e777dec9d12c6f1fbdc8c287e22c8568 Mon Sep 17 00:00:00 2001 From: Elkhair Date: Fri, 17 Jan 2025 15:52:03 -0600 Subject: [PATCH 11/48] Add Keymap for 3x6 --- keyboards/gggw/crosses/3x6/config.h | 20 + keyboards/gggw/crosses/3x6/keyboard.json | 396 ++++++++++++++++++ .../gggw/crosses/3x6/keymaps/default/keymap.c | 317 ++++++++++++++ .../gggw/crosses/3x6/keymaps/default/rules.mk | 2 + 4 files changed, 735 insertions(+) create mode 100644 keyboards/gggw/crosses/3x6/config.h create mode 100644 keyboards/gggw/crosses/3x6/keyboard.json create mode 100644 keyboards/gggw/crosses/3x6/keymaps/default/keymap.c create mode 100644 keyboards/gggw/crosses/3x6/keymaps/default/rules.mk diff --git a/keyboards/gggw/crosses/3x6/config.h b/keyboards/gggw/crosses/3x6/config.h new file mode 100644 index 00000000000..212d4ff99bd --- /dev/null +++ b/keyboards/gggw/crosses/3x6/config.h @@ -0,0 +1,20 @@ +/* +This is the c configuration file for the keymap + +Copyright 2024 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +#pragma once + diff --git a/keyboards/gggw/crosses/3x6/keyboard.json b/keyboards/gggw/crosses/3x6/keyboard.json new file mode 100644 index 00000000000..371da0d50aa --- /dev/null +++ b/keyboards/gggw/crosses/3x6/keyboard.json @@ -0,0 +1,396 @@ +{ + "manufacturer": "Good Great Grand Wonderful LLC", + "keyboard_name": "Crosses 3x6 rev1", + "maintainer": "vinniefranco", + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "command": false, + "console": true, + "extrakey": true, + "mousekey": true, + "nkro": true + }, + "matrix_pins": { + "cols": [ + "GP13", + "GP26", + "GP22", + "GP21", + "GP23", + "GP20" + ], + "rows": [ + "GP27", + "GP28", + "GP29", + "GP9" + ] + }, + "processor": "RP2040", + "split": { + "enabled": true, + "serial": { + "driver": "vendor", + "pin": "GP4" + }, + "transport": { + "sync": { + "matrix_state": true, + "layer_state": true + } + } + }, + "tapping": { + "term": 195 + }, + "url": "https://ergokeyboards.com", + "usb": { + "device_version": "0.3.0", + "pid": "0x5648", + "vid": "0x3034" + }, + "layouts": { + "LAYOUT_3x6": { + "layout": [ + { + "matrix": [ + 0, + 0 + ], + "x": 0, + "y": 1 + }, + { + "matrix": [ + 0, + 1 + ], + "x": 1, + "y": 1 + }, + { + "matrix": [ + 0, + 2 + ], + "x": 2, + "y": 0.5 + }, + { + "matrix": [ + 0, + 3 + ], + "x": 3, + "y": 0 + }, + { + "matrix": [ + 0, + 4 + ], + "x": 4, + "y": 0.25 + }, + { + "matrix": [ + 0, + 5 + ], + "x": 5, + "y": 0.5 + }, + { + "matrix": [ + 4, + 5 + ], + "x": 9, + "y": 0.5 + }, + { + "matrix": [ + 4, + 4 + ], + "x": 10, + "y": 0.25 + }, + { + "matrix": [ + 4, + 3 + ], + "x": 11, + "y": 0 + }, + { + "matrix": [ + 4, + 2 + ], + "x": 12, + "y": 0.5 + }, + { + "matrix": [ + 4, + 1 + ], + "x": 13, + "y": 1 + }, + { + "matrix": [ + 4, + 0 + ], + "x": 14, + "y": 1 + }, + { + "matrix": [ + 1, + 0 + ], + "x": 0, + "y": 2 + }, + { + "matrix": [ + 1, + 1 + ], + "x": 1, + "y": 2 + }, + { + "matrix": [ + 1, + 2 + ], + "x": 2, + "y": 1.5 + }, + { + "matrix": [ + 1, + 3 + ], + "x": 3, + "y": 1 + }, + { + "matrix": [ + 1, + 4 + ], + "x": 4, + "y": 1.25 + }, + { + "matrix": [ + 1, + 5 + ], + "x": 5, + "y": 1.5 + }, + { + "matrix": [ + 5, + 5 + ], + "x": 9, + "y": 1.5 + }, + { + "matrix": [ + 5, + 4 + ], + "x": 10, + "y": 1.25 + }, + { + "matrix": [ + 5, + 3 + ], + "x": 11, + "y": 1 + }, + { + "matrix": [ + 5, + 2 + ], + "x": 12, + "y": 1.5 + }, + { + "matrix": [ + 5, + 1 + ], + "x": 13, + "y": 2 + }, + { + "matrix": [ + 5, + 0 + ], + "x": 14, + "y": 2 + }, + { + "matrix": [ + 2, + 0 + ], + "x": 0, + "y": 3 + }, + { + "matrix": [ + 2, + 1 + ], + "x": 1, + "y": 3 + }, + { + "matrix": [ + 2, + 2 + ], + "x": 2, + "y": 2.5 + }, + { + "matrix": [ + 2, + 3 + ], + "x": 3, + "y": 2 + }, + { + "matrix": [ + 2, + 4 + ], + "x": 4, + "y": 2.25 + }, + { + "matrix": [ + 2, + 5 + ], + "x": 5, + "y": 2.5 + }, + { + "matrix": [ + 6, + 5 + ], + "x": 9, + "y": 2.5 + }, + { + "matrix": [ + 6, + 4 + ], + "x": 10, + "y": 2.25 + }, + { + "matrix": [ + 6, + 3 + ], + "x": 11, + "y": 2 + }, + { + "matrix": [ + 6, + 2 + ], + "x": 12, + "y": 2.5 + }, + { + "matrix": [ + 6, + 1 + ], + "x": 13, + "y": 3 + }, + { + "matrix": [ + 6, + 0 + ], + "x": 14, + "y": 3 + }, + { + "matrix": [ + 3, + 3 + ], + "x": 3, + "y": 4 + }, + { + "matrix": [ + 3, + 4 + ], + "x": 4, + "y": 4 + }, + { + "matrix": [ + 3, + 5 + ], + "x": 5, + "y": 4 + }, + { + "matrix": [ + 7, + 5 + ], + "x": 9, + "y": 4 + }, + { + "matrix": [ + 7, + 4 + ], + "x": 10, + "y": 4 + }, + { + "matrix": [ + 7, + 3 + ], + "x": 11, + "y": 4 + } + ] + } + } +} diff --git a/keyboards/gggw/crosses/3x6/keymaps/default/keymap.c b/keyboards/gggw/crosses/3x6/keymaps/default/keymap.c new file mode 100644 index 00000000000..1e0d3923b6b --- /dev/null +++ b/keyboards/gggw/crosses/3x6/keymaps/default/keymap.c @@ -0,0 +1,317 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "action_layer.h" +#include QMK_KEYBOARD_H + +#include "lib/achordion.h" +#include "lib/crosses.h" + +/* + * Keycodes, combos, and layers! oh my! + */ + +enum CROSSES_LAYERS { + _BASE, + _NUM, + _NAV, + _MEDIA, + _FUNC, + _MOUS, +}; + +enum my_keycodes { + VIMS = SAFE_RANGE, + LARR, + FARR, + EPIP, + LVBC, + RVBC, + BARR, + MSE_INC, + MSE_DEC, + DRAG_SCROLL, +}; + +enum combos { + WY_TAB, + DH_CAPS, + HCOMA_MINS, + WSPC_VIM, + FU_QUOTE, + PL_DQUOTE, + CCOM_LARR, + XDOT_FARR, + GM_EPIP, + COMD_UNDERS, + ZDOT_BARR, +}; + +const uint16_t PROGMEM wy_combo[] = {KC_W, KC_Y, COMBO_END}; +const uint16_t PROGMEM dh_combo[] = {KC_D, KC_H, COMBO_END}; +const uint16_t PROGMEM hcomma_combo[] = {KC_H, KC_COMM, COMBO_END}; +const uint16_t PROGMEM wspc_combo[] = {KC_W, KC_SPC, COMBO_END}; +const uint16_t PROGMEM fu_combo[] = {KC_F, KC_U, COMBO_END}; +const uint16_t PROGMEM pl_combo[] = {KC_P, KC_L, COMBO_END}; +const uint16_t PROGMEM ccom_combo[] = {KC_C, KC_COMM, COMBO_END}; +const uint16_t PROGMEM xdot_combo[] = {KC_X, KC_DOT, COMBO_END}; +const uint16_t PROGMEM gm_combo[] = {KC_G, KC_M, COMBO_END}; +const uint16_t PROGMEM comd_combo[] = {KC_COMM, KC_DOT, COMBO_END}; +const uint16_t PROGMEM zdot_combo[] = {KC_Z, KC_DOT, COMBO_END}; + +// clang-format off +// +combo_t key_combos[] = { + [WY_TAB] = COMBO(wy_combo, KC_TAB), + [DH_CAPS] = COMBO(dh_combo, CW_TOGG), + [HCOMA_MINS] = COMBO(hcomma_combo, KC_MINS), + [WSPC_VIM] = COMBO(wspc_combo, VIMS), + [FU_QUOTE] = COMBO(fu_combo, KC_QUOT), + [PL_DQUOTE] = COMBO(pl_combo, S(KC_QUOT)), + [CCOM_LARR] = COMBO(ccom_combo, LARR), + [XDOT_FARR] = COMBO(xdot_combo, FARR), + [GM_EPIP] = COMBO(gm_combo, EPIP), + [COMD_UNDERS] = COMBO(comd_combo, S(KC_MINS)), + [ZDOT_BARR] = COMBO(zdot_combo, BARR), +}; + +/* + * Keymaps! + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// ┌───────────┌───────────┬───────────┬───────────┬───────────┬────────────┐ ┌──────┬────────────┬───────────┬───────────┬───────────┬───────────┐ +// │ esc │ q │ w │ f │ p │ b │ │ j │ l │ u │ y │ ; │ bkspc │ +// ├───────────├───────────┼───────────┼───────────┼───────────┼────────────┤ ├──────┼────────────┼───────────┼───────────┼───────────┼───────────┤ +// │ tab │ LGUI_T(a) │ LALT_T(r) │ LCTL_T(s) │ LSFT_T(t) │ g │ │ m │ RSFT_T(n) │ RCTL_T(e) │ RALT_T(i) │ RGUI_T(o) │ enter │ +// ├───────────├───────────┼───────────┼───────────┼───────────┼────────────┤ ├──────┼────────────┼───────────┼───────────┼───────────┼───────────┤ +// │ shift │ z │ x │ c │ d │ v │ │ k │ h │ , │ . │ LT(3, /) │ shift │ +// └───────────└───────────┴───────────┴───────────┼───────────┼────────────┼─────┐ ┌────────────┼──────┼────────────┼───────────┴───────────┴───────────┴───────────┘ +// │ MO(5) │ LT(2, esc) │ spc │ │ LT(1, ent) │ bspc │ LT(4, del) │ +// └───────────┴────────────┴─────┘ └────────────┴──────┴────────────┘ +[_BASE] = LAYOUT_3x6( + KC_ESC ,KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , KC_BSPC, + KC_TAB ,LGUI_T(KC_A) , LALT_T(KC_R) , LCTL_T(KC_S) , LSFT_T(KC_T) , KC_G , KC_M , RSFT_T(KC_N) , RCTL_T(KC_E) , RALT_T(KC_I) , RGUI_T(KC_O) , KC_ENTER, + KC_LSFT ,KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , LT(3, KC_SLSH), KC_RSFT, + MO(5) , LT(2, KC_ESC) , KC_SPC , LT(1, KC_ENT) , KC_BSPC , LT(4, KC_DEL) +), + +// ┌──────┬───┬───┬───────────┬──────┐ ┌──────┬───────────┬───────────┬──────┬─────┐ +// │ S(8) │ 7 │ 8 │ 9 │ / │ │ \ │ S(9) │ S(0) │ S(\) │ │ +// ├──────┼───┼───┼───────────┼──────┤ ├──────┼───────────┼───────────┼──────┼─────┤ +// │ - │ 4 │ 5 │ LSFT_T(6) │ S(=) │ │ S(5) │ RSFT_T([) │ RCTL_T(]) │ S(;) │ ; │ +// ├──────┼───┼───┼───────────┼──────┤ ├──────┼───────────┼───────────┼──────┼─────┤ +// │ ` │ 1 │ 2 │ 3 │ = │ │ [ │ ] │ │ │ │ +// └──────┴───┴───┼───────────┼──────┼─────┐ ┌─────┼──────┼───────────┼───────────┴──────┴─────┘ +// │ │ 0 │ │ │ │ │ │ +// └───────────┴──────┴─────┘ └─────┴──────┴───────────┘ +[_NUM] = LAYOUT_3x6( + KC_NO, S(KC_8) , KC_7 , KC_8 , KC_9 , KC_SLSH , KC_BSLS , S(KC_9) , S(KC_0) , S(KC_BSLS) , KC_TRNS, KC_NO, + KC_NO, KC_MINS , KC_4 , KC_5 , LSFT_T(KC_6) , S(KC_EQL) , S(KC_5) , RSFT_T(KC_LBRC) , RCTL_T(KC_RBRC) , S(KC_SCLN) , KC_SCLN, KC_NO, + KC_NO, KC_GRV , KC_1 , KC_2 , KC_3 , KC_EQL , KC_LBRC , KC_RBRC , KC_TRNS , KC_TRNS , KC_TRNS, KC_NO, + KC_TRNS , KC_0 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS +), + +// ┌──────┬──────┬──────┬───────┬────┐ ┌────┬──────┬──────┬──────┬──────┐ +// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ +// ├──────┼──────┼──────┼───────┼────┤ ├────┼──────┼──────┼──────┼──────┤ +// │ lgui │ lalt │ lctl │ lsft │ no │ │ no │ left │ down │ up │ rght │ +// ├──────┼──────┼──────┼───────┼────┤ ├────┼──────┼──────┼──────┼──────┤ +// │ no │ no │ copy │ paste │ no │ │ no │ home │ end │ pgdn │ pgup │ +// └──────┴──────┴──────┼───────┼────┼────┐ ┌────┼────┼──────┼──────┴──────┴──────┘ +// │ no │ no │ no │ │ no │ no │ no │ +// └───────┴────┴────┘ └────┴────┴──────┘ +[_NAV] = LAYOUT_3x6( + KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, + KC_NO, KC_LGUI , KC_LALT , KC_LCTL , KC_LSFT , KC_NO , KC_NO , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT, KC_NO, + KC_NO, KC_NO , KC_NO , KC_COPY , KC_PSTE , KC_NO , KC_NO , KC_HOME , KC_END , KC_PGDN , KC_PGUP, KC_NO, + KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO +), + +// ┌──────┬──────┬──────┬──────┬──────┐ ┌────┬────┬────┬────┬────┐ +// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ +// ├──────┼──────┼──────┼──────┼──────┤ ├────┼────┼────┼────┼────┤ +// │ mprv │ vold │ mply │ volu │ mnxt │ │ no │ no │ no │ no │ no │ +// ├──────┼──────┼──────┼──────┼──────┤ ├────┼────┼────┼────┼────┤ +// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ +// └──────┴──────┴──────┼──────┼──────┼────┐ ┌────┼────┼────┼────┴────┴────┘ +// │ no │ no │ no │ │ no │ no │ no │ +// └──────┴──────┴────┘ └────┴────┴────┘ +[_MEDIA] = LAYOUT_3x6( + KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, KC_NO, + KC_NO, KC_MPRV , KC_VOLD , KC_MPLY , KC_VOLU , KC_MNXT , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, KC_NO, + KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, KC_NO, + KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO +), + +// ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬──────┬──────┬──────┬──────┐ +// │ f11 │ f12 │ f13 │ f14 │ f15 │ │ │ │ │ │ │ +// ├─────┼─────┼─────┼─────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ +// │ f6 │ f7 │ f8 │ f9 │ f10 │ │ │ rsft │ rctl │ ralt │ rgui │ +// ├─────┼─────┼─────┼─────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ +// │ f1 │ f2 │ f3 │ f4 │ f5 │ │ │ │ │ │ │ +// └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼──────┼──────┴──────┴──────┘ +// │ │ │ │ │ │ │ │ +// └─────┴─────┴─────┘ └─────┴─────┴──────┘ +[_FUNC] = LAYOUT_3x6( + KC_NO, KC_F11 , KC_F12 , KC_F13 , KC_F14 , KC_F15 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, KC_NO, + KC_NO, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_TRNS , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, KC_NO, + KC_NO, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, KC_NO, + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS +), + +// ┌──────┬─────────┬─────────┬─────────────┬────┐ ┌────────┬─────────┬─────────┬──────┬─────────┐ +// │ lsft │ lalt │ no │ no │ no │ │ EE_CLR │ MSE_INC │ MSE_DEC │ no │ no │ +// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼──────┼─────────┤ +// │ lctl │ MS_BTN3 │ MS_BTN2 │ MS_BTN1 │ no │ │ no │ rsft │ rctl │ ralt │ rgui │ +// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼──────┼─────────┤ +// │ lgui │ no │ no │ DRAG_SCROLL │ no │ │ no │ no │ no │ no │ DB_TOGG │ +// └──────┴─────────┴─────────┼─────────────┼────┼────┐ ┌────┼────────┼─────────┼─────────┴──────┴─────────┘ +// │ │ no │ no │ │ no │ no │ no │ +// └─────────────┴────┴────┘ └────┴────────┴─────────┘ +[_MOUS] = LAYOUT_3x6( + KC_NO, KC_LSFT , KC_LALT , KC_NO , KC_NO , KC_NO , EE_CLR , MSE_INC , MSE_DEC , KC_NO , KC_NO , KC_NO, + KC_NO, KC_LCTL , MS_BTN3 , MS_BTN2 , MS_BTN1 , KC_NO , KC_NO , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, KC_NO, + KC_NO, KC_LGUI , KC_NO , KC_NO , DRAG_SCROLL , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , DB_TOGG, KC_NO, + KC_TRNS , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO +) +}; + +// clang-format on + +bool process_record_user(uint16_t keycode, keyrecord_t* record) { + if (!process_achordion(keycode, record)) { + return false; + } + switch (keycode) { + case RSFT_T(KC_LBRC): + if (record->tap.count && record->event.pressed) { + tap_code16(S(KC_LBRC)); + return false; + } + break; + + case RCTL_T(KC_RBRC): + if (record->tap.count && record->event.pressed) { + tap_code16(S(KC_RBRC)); + return false; + } + break; + + case VIMS: + if (record->event.pressed) { + tap_code16(KC_ESC); + SEND_STRING(":w\n"); + + return false; + } + break; + + case EPIP: + if (record->event.pressed) { + SEND_STRING("|> "); + + return false; + } + break; + + case LARR: + if (record->event.pressed) { + SEND_STRING("-> "); + + return false; + } + break; + + case FARR: + if (record->event.pressed) { + SEND_STRING("=> "); + + return false; + } + break; + + case BARR: + if (record->event.pressed) { + SEND_STRING("<- "); + + return false; + } + break; + case MSE_INC: + if (record->event.pressed) { + change_pointer_dpi(&global_user_config, true); + debug_config_to_console(&global_user_config); + + return false; + } + break; + case MSE_DEC: + if (record->event.pressed) { + change_pointer_dpi(&global_user_config, false); + debug_config_to_console(&global_user_config); + + return false; + } + break; + case DRAG_SCROLL: + set_scrolling = record->event.pressed; + break; + } + + return true; +} + +bool achordion_chord(uint16_t tap_hold_keycode, keyrecord_t* tap_hold_record, uint16_t other_keycode, keyrecord_t* other_record) { + switch (tap_hold_keycode) { + case 0x4128: + return true; + break; + } + + return achordion_opposite_hands(tap_hold_record, other_record); +} + +void matrix_scan_user(void) { + achordion_task(); +} + +#ifdef OLED_ENABLE + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (!is_keyboard_master()) { + return OLED_ROTATION_180; + } + + return rotation; +} + +static void render_logo(void) { + static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; + + oled_write_P(qmk_logo, false); +} + +bool oled_task_user(void) { + render_logo(); + + const char* layer_names[] = { + [_BASE] = ">> BASE ", [_NUM] = ">> PROG ", [_NAV] = ">> NAVI ", [_MEDIA] = ">>> MEDIA ", [_FUNC] = ">>> FUNC ", [_MOUS] = ">>> MOUSE ", + }; + + oled_write_P(PSTR(layer_names[get_highest_layer(layer_state)]), false); + + return false; +} +#endif /* ifdef OLED_ENABLE */ + +void keyboard_post_init_user(void) { + global_user_config.raw = eeconfig_read_user(); + update_pointer_cpi(&global_user_config); + write_config_to_eeprom(&global_user_config); +} + +void pointing_device_init_user(void) { + set_auto_mouse_layer(_MOUS); + set_auto_mouse_enable(true); +} diff --git a/keyboards/gggw/crosses/3x6/keymaps/default/rules.mk b/keyboards/gggw/crosses/3x6/keymaps/default/rules.mk new file mode 100644 index 00000000000..665ec1d6930 --- /dev/null +++ b/keyboards/gggw/crosses/3x6/keymaps/default/rules.mk @@ -0,0 +1,2 @@ +COMBO_ENABLE = yes +CAPS_WORD_ENABLE = yes From 1ae5bb1ceda065d2265a261b8d12dcb36a6938ed Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Mon, 20 Jan 2025 19:36:03 -0600 Subject: [PATCH 12/48] Cleanup --- .../gggw/crosses/3x5/keymaps/default/keymap.c | 40 +++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c index f0cd86db14c..9ab45afd2b5 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c @@ -31,6 +31,7 @@ enum my_keycodes { MSE_INC, MSE_DEC, DRAG_SCROLL, + MSE_TOGG, }; enum combos { @@ -160,19 +161,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS ), -// ┌──────┬─────────┬─────────┬─────────────┬────┐ ┌────────┬─────────┬─────────┬──────┬─────────┐ -// │ lsft │ lalt │ no │ no │ no │ │ EE_CLR │ MSE_INC │ MSE_DEC │ no │ no │ -// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼──────┼─────────┤ -// │ lctl │ MS_BTN3 │ MS_BTN2 │ MS_BTN1 │ no │ │ no │ rsft │ rctl │ ralt │ rgui │ -// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼──────┼─────────┤ -// │ lgui │ no │ no │ DRAG_SCROLL │ no │ │ no │ no │ no │ no │ DB_TOGG │ -// └──────┴─────────┴─────────┼─────────────┼────┼────┐ ┌────┼────────┼─────────┼─────────┴──────┴─────────┘ +// ┌──────┬─────────┬─────────┬─────────────┬────┐ ┌────────┬─────────┬─────────┬───-----───┬─────────┐ +// │ lsft │ lalt │ no │ no │ no │ │ EE_CLR │ MSE_INC │ MSE_DEC │ no │ no │ +// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼───-----───┼─────────┤ +// │ lctl │ MS_BTN3 │ MS_BTN2 │ MS_BTN1 │ no │ │ no │ rsft │ rctl │ ralt │ rgui │ +// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼───-----───┼─────────┤ +// │ lgui │ no │ no │ DRAG_SCROLL │ no │ │ no │ no │ no │ MSE_TOGG │ DB_TOGG │ +// └──────┴─────────┴─────────┼─────────────┼────┼────┐ ┌────┼────────┼─────────┼─────────┴────-----──┴─────────┘ // │ │ no │ no │ │ no │ no │ no │ // └─────────────┴────┴────┘ └────┴────────┴─────────┘ [_MOUS] = LAYOUT_default( - KC_LSFT , KC_LALT , KC_NO , KC_NO , KC_NO , EE_CLR , MSE_INC , MSE_DEC , KC_NO , KC_NO , - KC_LCTL , MS_BTN3 , MS_BTN2 , MS_BTN1 , KC_NO , KC_NO , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, - KC_LGUI , KC_NO , KC_NO , DRAG_SCROLL , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , DB_TOGG, + KC_LSFT , KC_LALT , KC_NO , KC_NO , KC_NO , EE_CLR , MSE_INC , MSE_DEC , KC_NO , KC_NO , + KC_LCTL , MS_BTN3 , MS_BTN2 , MS_BTN1 , KC_NO , KC_NO , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, + KC_LGUI , KC_NO , KC_NO , DRAG_SCROLL , KC_NO , KC_NO , KC_NO , KC_NO , MSE_TOGG , DB_TOGG, KC_TRNS , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO ) }; @@ -254,6 +255,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { return false; } break; + case MSE_TOGG: + if (record->event.pressed) { + bool current_state = get_auto_mouse_enable(); + set_auto_mouse_enable(!current_state); + + return false; + } + break; case DRAG_SCROLL: set_scrolling = record->event.pressed; break; @@ -295,9 +304,16 @@ static void render_logo(void) { bool oled_task_user(void) { render_logo(); + // clang-format off const char* layer_names[] = { - [_BASE] = ">> BASE ", [_NUM] = ">> PROG ", [_NAV] = ">> NAVI ", [_MEDIA] = ">>> MEDIA ", [_FUNC] = ">>> FUNC ", [_MOUS] = ">>> MOUSE ", + [_BASE] = ">> BASE ", + [_NUM] = ">> PROG ", + [_NAV] = ">> NAVI ", + [_MEDIA] = ">>> MEDIA ", + [_FUNC] = ">>> FUNC ", + [_MOUS] = ">>> MOUSE ", }; + // clang-format on oled_write_P(PSTR(layer_names[get_highest_layer(layer_state)]), false); @@ -313,5 +329,5 @@ void keyboard_post_init_user(void) { void pointing_device_init_user(void) { set_auto_mouse_layer(_MOUS); - set_auto_mouse_enable(true); + set_auto_mouse_enable(false); } From 98bc58a8a924216da1f21614b74a7fa8f8a066e8 Mon Sep 17 00:00:00 2001 From: vinniefranco Date: Tue, 21 Jan 2025 14:02:02 -0600 Subject: [PATCH 13/48] merging --- .../gggw/crosses/3x5/keymaps/default/keymap.c | 34 +++++++++++-------- keyboards/gggw/crosses/lib/crosses.c | 4 +-- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c index 9ab45afd2b5..3e2a48e620b 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c @@ -161,13 +161,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS ), -// ┌──────┬─────────┬─────────┬─────────────┬────┐ ┌────────┬─────────┬─────────┬───-----───┬─────────┐ -// │ lsft │ lalt │ no │ no │ no │ │ EE_CLR │ MSE_INC │ MSE_DEC │ no │ no │ -// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼───-----───┼─────────┤ -// │ lctl │ MS_BTN3 │ MS_BTN2 │ MS_BTN1 │ no │ │ no │ rsft │ rctl │ ralt │ rgui │ -// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼───-----───┼─────────┤ -// │ lgui │ no │ no │ DRAG_SCROLL │ no │ │ no │ no │ no │ MSE_TOGG │ DB_TOGG │ -// └──────┴─────────┴─────────┼─────────────┼────┼────┐ ┌────┼────────┼─────────┼─────────┴────-----──┴─────────┘ +// ┌──────┬─────────┬─────────┬─────────────┬────┐ ┌────────┬─────────┬─────────┬──────────┬─────────┐ +// │ lsft │ lalt │ no │ no │ no │ │ EE_CLR │ MSE_INC │ MSE_DEC │ no │ no │ +// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼──────────┼─────────┤ +// │ lctl │ MS_BTN3 │ MS_BTN2 │ MS_BTN1 │ no │ │ no │ rsft │ rctl │ ralt │ rgui │ +// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼──────────┼─────────┤ +// │ lgui │ no │ no │ DRAG_SCROLL │ no │ │ no │ no │ no │ MSE_TOGG │ DB_TOGG │ +// └──────┴─────────┴─────────┼─────────────┼────┼────┐ ┌────┼────────┼─────────┼─────────┴──────────┴─────────┘ // │ │ no │ no │ │ no │ no │ no │ // └─────────────┴────┴────┘ └────┴────────┴─────────┘ [_MOUS] = LAYOUT_default( @@ -306,16 +306,22 @@ bool oled_task_user(void) { // clang-format off const char* layer_names[] = { - [_BASE] = ">> BASE ", - [_NUM] = ">> PROG ", - [_NAV] = ">> NAVI ", - [_MEDIA] = ">>> MEDIA ", - [_FUNC] = ">>> FUNC ", - [_MOUS] = ">>> MOUSE ", + [_BASE] = "BASE CPI: ", + [_NUM] = "PROG CPI: ", + [_NAV] = "NAVI CPI: ", + [_MEDIA] = "MEDIA CPI: ", + [_FUNC] = "FUNC CPI: ", + [_MOUS] = "MOUSE CPI: ", }; // clang-format on - oled_write_P(PSTR(layer_names[get_highest_layer(layer_state)]), false); + char cpi_str[6]; + uint16_t current_dpi = get_pointer_dpi(&global_user_config); + + snprintf(cpi_str, sizeof(cpi_str), "%u", (unsigned int)current_dpi); + + oled_write(PSTR(layer_names[get_highest_layer(layer_state)]), false); + oled_write(cpi_str, false); return false; } diff --git a/keyboards/gggw/crosses/lib/crosses.c b/keyboards/gggw/crosses/lib/crosses.c index b2bdd00127a..c445d521808 100644 --- a/keyboards/gggw/crosses/lib/crosses.c +++ b/keyboards/gggw/crosses/lib/crosses.c @@ -28,7 +28,7 @@ bool set_scrolling = false; float scroll_acc_h = 0.0; float scroll_acc_v = 0.0; -const uint16_t MIN_DEFAULT_DPI = 400; +const uint16_t MIN_DEFAULT_DPI = 200; const uint16_t MAX_DEFAULT_DPI = 10000; /*********************************************************************** @@ -84,7 +84,7 @@ void change_pointer_dpi(global_user_config_t* config, bool inc) { return; } - config->mse_cpi += inc ? 10 : -10; + config->mse_cpi = requested; #ifdef POINTING_DEVICE_COMBINED pointing_device_set_cpi_on_side(false, get_pointer_dpi(config)); From fab785aeb52701ca84c97489b94827d0ad16dc05 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Mon, 27 Jan 2025 19:07:23 -0600 Subject: [PATCH 14/48] [MINOR] Adding Rev2 firmware --- .../gggw/crosses/3x5/{ => rev1}/keyboard.json | 0 keyboards/gggw/crosses/3x5/rev2/keyboard.json | 84 +++++++++++++++++ .../gggw/crosses/3x6/{ => rev1}/keyboard.json | 0 keyboards/gggw/crosses/3x6/rev2/keyboard.json | 89 +++++++++++++++++++ 4 files changed, 173 insertions(+) rename keyboards/gggw/crosses/3x5/{ => rev1}/keyboard.json (100%) create mode 100644 keyboards/gggw/crosses/3x5/rev2/keyboard.json rename keyboards/gggw/crosses/3x6/{ => rev1}/keyboard.json (100%) create mode 100644 keyboards/gggw/crosses/3x6/rev2/keyboard.json diff --git a/keyboards/gggw/crosses/3x5/keyboard.json b/keyboards/gggw/crosses/3x5/rev1/keyboard.json similarity index 100% rename from keyboards/gggw/crosses/3x5/keyboard.json rename to keyboards/gggw/crosses/3x5/rev1/keyboard.json diff --git a/keyboards/gggw/crosses/3x5/rev2/keyboard.json b/keyboards/gggw/crosses/3x5/rev2/keyboard.json new file mode 100644 index 00000000000..2a1c64fd26e --- /dev/null +++ b/keyboards/gggw/crosses/3x5/rev2/keyboard.json @@ -0,0 +1,84 @@ +{ + "manufacturer": "Good Great Grand Wonderful LLC", + "keyboard_name": "Crosses 36 Rev2", + "maintainer": "vinniefranco", + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "command": false, + "console": true, + "extrakey": true, + "mousekey": true, + "nkro": true + }, + "matrix_pins": { + "cols": ["GP26", "GP22", "GP21", "GP23", "GP20"], + "rows": ["GP27", "GP28", "GP29", "GP7"] + }, + "processor": "RP2040", + "split": { + "enabled": true, + "serial": { + "driver": "vendor", + "pin": "GP4" + }, + "transport": { + "sync": { + "matrix_state": true, + "layer_state": true + } + } + }, + "tapping": { + "term": 195 + }, + "url": "https://ergokeyboards.com", + "usb": { + "device_version": "0.3.0", + "pid": "0x5657", + "vid": "0x3034" + }, + "layouts": { + "LAYOUT_default": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0.25}, + {"matrix": [0, 1], "x": 1, "y": 0.125}, + {"matrix": [0, 2], "x": 2, "y": 0}, + {"matrix": [0, 3], "x": 3, "y": 0.125}, + {"matrix": [0, 4], "x": 4, "y": 0.25}, + {"matrix": [4, 4], "x": 7, "y": 0.25}, + {"matrix": [4, 3], "x": 8, "y": 0.125}, + {"matrix": [4, 2], "x": 9, "y": 0}, + {"matrix": [4, 1], "x": 10, "y": 0.125}, + {"matrix": [4, 0], "x": 11, "y": 0.25}, + {"matrix": [1, 0], "x": 0, "y": 1.25}, + {"matrix": [1, 1], "x": 1, "y": 1.125}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1.125}, + {"matrix": [1, 4], "x": 4, "y": 1.25}, + {"matrix": [5, 4], "x": 7, "y": 1.25}, + {"matrix": [5, 3], "x": 8, "y": 1.125}, + {"matrix": [5, 2], "x": 9, "y": 1}, + {"matrix": [5, 1], "x": 10, "y": 1.125}, + {"matrix": [5, 0], "x": 11, "y": 1.25}, + {"matrix": [2, 0], "x": 0, "y": 2.25}, + {"matrix": [2, 1], "x": 1, "y": 2.125}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2.125}, + {"matrix": [2, 4], "x": 4, "y": 2.25}, + {"matrix": [6, 4], "x": 7, "y": 2.25}, + {"matrix": [6, 3], "x": 8, "y": 2.125}, + {"matrix": [6, 2], "x": 9, "y": 2}, + {"matrix": [6, 1], "x": 10, "y": 2.125}, + {"matrix": [6, 0], "x": 11, "y": 2.25}, + {"matrix": [3, 2], "x": 2.5, "y": 3.25}, + {"matrix": [3, 3], "x": 3.5, "y": 3.5}, + {"matrix": [3, 4], "x": 4.5, "y": 3.75}, + {"matrix": [7, 4], "x": 6.5, "y": 3.75}, + {"matrix": [7, 3], "x": 7.5, "y": 3.5}, + {"matrix": [7, 2], "x": 8.5, "y": 3.25} + ] + } + } +} diff --git a/keyboards/gggw/crosses/3x6/keyboard.json b/keyboards/gggw/crosses/3x6/rev1/keyboard.json similarity index 100% rename from keyboards/gggw/crosses/3x6/keyboard.json rename to keyboards/gggw/crosses/3x6/rev1/keyboard.json diff --git a/keyboards/gggw/crosses/3x6/rev2/keyboard.json b/keyboards/gggw/crosses/3x6/rev2/keyboard.json new file mode 100644 index 00000000000..89f10eb5ed8 --- /dev/null +++ b/keyboards/gggw/crosses/3x6/rev2/keyboard.json @@ -0,0 +1,89 @@ +{ + "manufacturer": "Good Great Grand Wonderful LLC", + "keyboard_name": "Crosses 42 rev2", + "maintainer": "vinniefranco", + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "command": false, + "console": true, + "extrakey": true, + "mousekey": true, + "nkro": true + }, + "matrix_pins": { + "cols": [ "GP1", "GP26", "GP22", "GP21", "GP23", "GP20" ], + "rows": [ "GP27", "GP28", "GP29", "GP7" ] }, + "processor": "RP2040", + "split": { + "enabled": true, + "serial": { + "driver": "vendor", + "pin": "GP4" + }, + "transport": { + "sync": { + "matrix_state": true, + "layer_state": true + } + } + }, + "tapping": { + "term": 195 + }, + "url": "https://ergokeyboards.com", + "usb": { + "device_version": "0.3.0", + "pid": "0x5658", + "vid": "0x3034" + }, + "layouts": { + "LAYOUT_3x6": { + "layout": [ + { "matrix": [ 0, 0 ], "x": 0, "y": 1 }, + { "matrix": [ 0, 1 ], "x": 1, "y": 1 }, + { "matrix": [ 0, 2 ], "x": 2, "y": 0.5 }, + { "matrix": [ 0, 3 ], "x": 3, "y": 0 }, + { "matrix": [ 0, 4 ], "x": 4, "y": 0.25 }, + { "matrix": [ 0, 5 ], "x": 5, "y": 0.5 }, + { "matrix": [ 4, 5 ], "x": 9, "y": 0.5 }, + { "matrix": [ 4, 4 ], "x": 10, "y": 0.25 }, + { "matrix": [ 4, 3 ], "x": 11, "y": 0 }, + { "matrix": [ 4, 2 ], "x": 12, "y": 0.5 }, + { "matrix": [ 4, 1 ], "x": 13, "y": 1 }, + { "matrix": [ 4, 0 ], "x": 14, "y": 1 }, + { "matrix": [ 1, 0 ], "x": 0, "y": 2 }, + { "matrix": [ 1, 1 ], "x": 1, "y": 2 }, + { "matrix": [ 1, 2 ], "x": 2, "y": 1.5 }, + { "matrix": [ 1, 3 ], "x": 3, "y": 1 }, + { "matrix": [ 1, 4 ], "x": 4, "y": 1.25 }, + { "matrix": [ 1, 5 ], "x": 5, "y": 1.5 }, + { "matrix": [ 5, 5 ], "x": 9, "y": 1.5 }, + { "matrix": [ 5, 4 ], "x": 10, "y": 1.25 }, + { "matrix": [ 5, 3 ], "x": 11, "y": 1 }, + { "matrix": [ 5, 2 ], "x": 12, "y": 1.5 }, + { "matrix": [ 5, 1 ], "x": 13, "y": 2 }, + { "matrix": [ 5, 0 ], "x": 14, "y": 2 }, + { "matrix": [ 2, 0 ], "x": 0, "y": 3 }, + { "matrix": [ 2, 1 ], "x": 1, "y": 3 }, + { "matrix": [ 2, 2 ], "x": 2, "y": 2.5 }, + { "matrix": [ 2, 3 ], "x": 3, "y": 2 }, + { "matrix": [ 2, 4 ], "x": 4, "y": 2.25 }, + { "matrix": [ 2, 5 ], "x": 5, "y": 2.5 }, + { "matrix": [ 6, 5 ], "x": 9, "y": 2.5 }, + { "matrix": [ 6, 4 ], "x": 10, "y": 2.25 }, + { "matrix": [ 6, 3 ], "x": 11, "y": 2 }, + { "matrix": [ 6, 2 ], "x": 12, "y": 2.5 }, + { "matrix": [ 6, 1 ], "x": 13, "y": 3 }, + { "matrix": [ 6, 0 ], "x": 14, "y": 3 }, + { "matrix": [ 3, 3 ], "x": 3, "y": 4 }, + { "matrix": [ 3, 4 ], "x": 4, "y": 4 }, + { "matrix": [ 3, 5 ], "x": 5, "y": 4 }, + { "matrix": [ 7, 5 ], "x": 9, "y": 4 }, + { "matrix": [ 7, 4 ], "x": 10, "y": 4 }, + { "matrix": [ 7, 3 ], "x": 11, "y": 4 } + ] + } + } +} From d7efedcf02db1e6764f5edafb47e0111d2c4da05 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sat, 8 Feb 2025 22:44:53 -0600 Subject: [PATCH 15/48] [PATCH] Fixing bug with CPI sync --- .../gggw/crosses/3x5/keymaps/default/keymap.c | 21 ++++------- keyboards/gggw/crosses/config.h | 1 + keyboards/gggw/crosses/lib/crosses.c | 37 ++++++++++++++++++- keyboards/gggw/crosses/lib/crosses.h | 3 ++ keyboards/gggw/crosses/post_config.h | 7 ++++ 5 files changed, 54 insertions(+), 15 deletions(-) create mode 100644 keyboards/gggw/crosses/post_config.h diff --git a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c index 3e2a48e620b..0318762346e 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c @@ -1,7 +1,6 @@ // Copyright 2023 QMK // SPDX-License-Identifier: GPL-2.0-or-later -#include "action_layer.h" #include QMK_KEYBOARD_H #include "lib/achordion.h" @@ -91,10 +90,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // │ MO(5) │ LT(2, esc) │ spc │ │ LT(1, ent) │ bspc │ LT(4, del) │ // └───────────┴────────────┴─────┘ └────────────┴──────┴────────────┘ [_BASE] = LAYOUT_default( - KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , - LGUI_T(KC_A) , LALT_T(KC_R) , LCTL_T(KC_S) , LSFT_T(KC_T) , KC_G , KC_M , RSFT_T(KC_N) , RCTL_T(KC_E) , RALT_T(KC_I) , RGUI_T(KC_O) , - KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , LT(3, KC_SLSH), - MO(5) , LT(2, KC_ESC) , KC_SPC , LT(1, KC_ENT) , KC_BSPC , LT(4, KC_DEL) + KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , + LGUI_T(KC_A) , LALT_T(KC_R) , LCTL_T(KC_S) , LSFT_T(KC_T) , KC_G , KC_M , RSFT_T(KC_N) , RCTL_T(KC_E) , RALT_T(KC_I) , RGUI_T(KC_O) , + KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , LT(3, KC_SLSH), + MO(5) , LT(2, KC_ESC) , KC_SPC , LT(1, KC_ENT) , KC_BSPC , LT(4, KC_DEL) ), // ┌──────┬───┬───┬───────────┬──────┐ ┌──────┬───────────┬───────────┬──────┬─────┐ @@ -171,9 +170,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // │ │ no │ no │ │ no │ no │ no │ // └─────────────┴────┴────┘ └────┴────────┴─────────┘ [_MOUS] = LAYOUT_default( - KC_LSFT , KC_LALT , KC_NO , KC_NO , KC_NO , EE_CLR , MSE_INC , MSE_DEC , KC_NO , KC_NO , - KC_LCTL , MS_BTN3 , MS_BTN2 , MS_BTN1 , KC_NO , KC_NO , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, - KC_LGUI , KC_NO , KC_NO , DRAG_SCROLL , KC_NO , KC_NO , KC_NO , KC_NO , MSE_TOGG , DB_TOGG, + KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , EE_CLR , MSE_INC , MSE_DEC , KC_NO , KC_NO , + KC_NO , MS_BTN3 , MS_BTN2 , MS_BTN1 , KC_NO , KC_NO , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, + KC_NO , KC_NO , KC_NO , DRAG_SCROLL , KC_NO , KC_NO , KC_NO , KC_NO , MSE_TOGG , DB_TOGG, KC_TRNS , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO ) }; @@ -327,12 +326,6 @@ bool oled_task_user(void) { } #endif /* ifdef OLED_ENABLE */ -void keyboard_post_init_user(void) { - global_user_config.raw = eeconfig_read_user(); - update_pointer_cpi(&global_user_config); - write_config_to_eeprom(&global_user_config); -} - void pointing_device_init_user(void) { set_auto_mouse_layer(_MOUS); set_auto_mouse_enable(false); diff --git a/keyboards/gggw/crosses/config.h b/keyboards/gggw/crosses/config.h index c801e22e887..e114562f591 100644 --- a/keyboards/gggw/crosses/config.h +++ b/keyboards/gggw/crosses/config.h @@ -69,3 +69,4 @@ * Font */ #define OLED_FONT_H "lib/crosses-font.c" + diff --git a/keyboards/gggw/crosses/lib/crosses.c b/keyboards/gggw/crosses/lib/crosses.c index c445d521808..5528e0d2bfd 100644 --- a/keyboards/gggw/crosses/lib/crosses.c +++ b/keyboards/gggw/crosses/lib/crosses.c @@ -28,7 +28,7 @@ bool set_scrolling = false; float scroll_acc_h = 0.0; float scroll_acc_v = 0.0; -const uint16_t MIN_DEFAULT_DPI = 200; +const uint16_t MIN_DEFAULT_DPI = 100; const uint16_t MAX_DEFAULT_DPI = 10000; /*********************************************************************** @@ -183,3 +183,38 @@ layer_state_t layer_state_set_user(layer_state_t state) { return state; } + +void secondary_sync_handler(uint8_t in_buflen, const void* in_data, uint8_t out_buflen, void* out_data) { + if (in_buflen == sizeof(global_user_config)) { + memcpy(&global_user_config, in_data, sizeof(global_user_config)); + } +} + +void housekeeping_task_kb(void) { + if (!is_keyboard_master()) { return; } + + static global_user_config_t last_config = {0}; + static uint32_t last_sync = 0; + bool should_sync = false; + + if (memcmp(&global_user_config, &last_config, sizeof(global_user_config))) { + should_sync = true; + memcpy(&last_config, &global_user_config, sizeof(global_user_config)); + } + + should_sync = (timer_elapsed32(last_sync) > 500); + + if (!should_sync) { return; } + + if (transaction_rpc_send(CROSSES_SECONDARY_SYNC_ID, sizeof(global_user_config), &global_user_config)) { + last_sync = timer_read32(); + } +} + +void keyboard_post_init_user(void) { + global_user_config.raw = eeconfig_read_user(); + transaction_register_rpc(CROSSES_SECONDARY_SYNC_ID, secondary_sync_handler); + update_pointer_cpi(&global_user_config); + write_config_to_eeprom(&global_user_config); +} + diff --git a/keyboards/gggw/crosses/lib/crosses.h b/keyboards/gggw/crosses/lib/crosses.h index 480ce2b7295..dc67f95fd32 100644 --- a/keyboards/gggw/crosses/lib/crosses.h +++ b/keyboards/gggw/crosses/lib/crosses.h @@ -1,6 +1,7 @@ #pragma once #include "quantum.h" +#include "transactions.h" #ifdef __cplusplus extern "C" { @@ -36,6 +37,8 @@ void debug_config_to_console(global_user_config_t* config); void eeconfig_init_user(void); +void keyboard_post_init_user(void); + /* * Pointing Device Config */ diff --git a/keyboards/gggw/crosses/post_config.h b/keyboards/gggw/crosses/post_config.h new file mode 100644 index 00000000000..7028eee03c1 --- /dev/null +++ b/keyboards/gggw/crosses/post_config.h @@ -0,0 +1,7 @@ + +#pragma once + +/* + * Sync + */ +#define SPLIT_TRANSACTION_IDS_KB CROSSES_SECONDARY_SYNC_ID From c506f3b07f9347d197b300903caa9b1688c09beb Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Mon, 10 Feb 2025 23:18:21 -0600 Subject: [PATCH 16/48] [MINOR] Adding Rev2 firmware final --- .../gggw/crosses/3x5/keymaps/default/keymap.c | 6 +++++ keyboards/gggw/crosses/3x5/rev1/config.h | 6 +++++ keyboards/gggw/crosses/3x5/rev1/mcuconf.h | 7 ++++++ keyboards/gggw/crosses/3x5/rev1/rules.mk | 1 + keyboards/gggw/crosses/3x5/rev2/config.h | 7 ++++++ keyboards/gggw/crosses/3x5/rev2/keyboard.json | 2 +- keyboards/gggw/crosses/3x5/rev2/mcuconf.h | 9 ++++++++ keyboards/gggw/crosses/3x5/rev2/rules.mk | 1 + keyboards/gggw/crosses/3x6/rev1/config.h | 6 +++++ keyboards/gggw/crosses/config.h | 7 ------ keyboards/gggw/crosses/halconf.h | 6 +++-- keyboards/gggw/crosses/lib/crosses.c | 23 +++++++++++-------- keyboards/gggw/crosses/lib/crosses.h | 5 ++-- keyboards/gggw/crosses/mcuconf.h | 2 -- keyboards/gggw/crosses/rules.mk | 2 +- 15 files changed, 65 insertions(+), 25 deletions(-) create mode 100644 keyboards/gggw/crosses/3x5/rev1/config.h create mode 100644 keyboards/gggw/crosses/3x5/rev1/mcuconf.h create mode 100644 keyboards/gggw/crosses/3x5/rev1/rules.mk create mode 100644 keyboards/gggw/crosses/3x5/rev2/config.h create mode 100644 keyboards/gggw/crosses/3x5/rev2/mcuconf.h create mode 100644 keyboards/gggw/crosses/3x5/rev2/rules.mk create mode 100644 keyboards/gggw/crosses/3x6/rev1/config.h diff --git a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c index 0318762346e..52acd596d0f 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c @@ -240,7 +240,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { break; case MSE_INC: if (record->event.pressed) { +#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT) change_pointer_dpi(&global_user_config, true); +#endif /* ifdef POINTING_DEVICE */ debug_config_to_console(&global_user_config); return false; @@ -256,8 +258,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { break; case MSE_TOGG: if (record->event.pressed) { +#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT) bool current_state = get_auto_mouse_enable(); set_auto_mouse_enable(!current_state); +#endif /* ifdef POINTING_DEVICE */ return false; } @@ -326,7 +330,9 @@ bool oled_task_user(void) { } #endif /* ifdef OLED_ENABLE */ +#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT) void pointing_device_init_user(void) { set_auto_mouse_layer(_MOUS); set_auto_mouse_enable(false); } +#endif /* ifdef POINTING_DEVICE */ diff --git a/keyboards/gggw/crosses/3x5/rev1/config.h b/keyboards/gggw/crosses/3x5/rev1/config.h new file mode 100644 index 00000000000..f9f7a914aa6 --- /dev/null +++ b/keyboards/gggw/crosses/3x5/rev1/config.h @@ -0,0 +1,6 @@ +/* + * OLED + */ +#define I2C_DRIVER I2CD1 +#define I2C1_SCL_PIN GP15 +#define I2C1_SDA_PIN GP14 diff --git a/keyboards/gggw/crosses/3x5/rev1/mcuconf.h b/keyboards/gggw/crosses/3x5/rev1/mcuconf.h new file mode 100644 index 00000000000..7b94df1b547 --- /dev/null +++ b/keyboards/gggw/crosses/3x5/rev1/mcuconf.h @@ -0,0 +1,7 @@ + +#pragma once + +#include_next + +#undef RP_I2C_USE_I2C1 +#define RP_I2C_USE_I2C1 TRUE diff --git a/keyboards/gggw/crosses/3x5/rev1/rules.mk b/keyboards/gggw/crosses/3x5/rev1/rules.mk new file mode 100644 index 00000000000..fab9162dc64 --- /dev/null +++ b/keyboards/gggw/crosses/3x5/rev1/rules.mk @@ -0,0 +1 @@ +POINTING_DEVICE_DRIVER = pmw3360 diff --git a/keyboards/gggw/crosses/3x5/rev2/config.h b/keyboards/gggw/crosses/3x5/rev2/config.h new file mode 100644 index 00000000000..7c6a61f3a15 --- /dev/null +++ b/keyboards/gggw/crosses/3x5/rev2/config.h @@ -0,0 +1,7 @@ + +/* + * OLED + */ +#define I2C_DRIVER I2CD0 +#define I2C1_SDA_PIN GP8 +#define I2C1_SCL_PIN GP9 diff --git a/keyboards/gggw/crosses/3x5/rev2/keyboard.json b/keyboards/gggw/crosses/3x5/rev2/keyboard.json index 2a1c64fd26e..cdb7035ccfd 100644 --- a/keyboards/gggw/crosses/3x5/rev2/keyboard.json +++ b/keyboards/gggw/crosses/3x5/rev2/keyboard.json @@ -7,7 +7,7 @@ "features": { "bootmagic": true, "command": false, - "console": true, + "console": false, "extrakey": true, "mousekey": true, "nkro": true diff --git a/keyboards/gggw/crosses/3x5/rev2/mcuconf.h b/keyboards/gggw/crosses/3x5/rev2/mcuconf.h new file mode 100644 index 00000000000..f6378664da8 --- /dev/null +++ b/keyboards/gggw/crosses/3x5/rev2/mcuconf.h @@ -0,0 +1,9 @@ +#pragma once + +#include_next + +#undef RP_I2C_USE_I2C0 +#define RP_I2C_USE_I2C0 TRUE + +#undef RP_I2C_USE_I2C1 +#define RP_I2C_USE_I2C1 FALSE diff --git a/keyboards/gggw/crosses/3x5/rev2/rules.mk b/keyboards/gggw/crosses/3x5/rev2/rules.mk new file mode 100644 index 00000000000..8ff6b63653a --- /dev/null +++ b/keyboards/gggw/crosses/3x5/rev2/rules.mk @@ -0,0 +1 @@ +POINTING_DEVICE_DRIVER = pmw3389 diff --git a/keyboards/gggw/crosses/3x6/rev1/config.h b/keyboards/gggw/crosses/3x6/rev1/config.h new file mode 100644 index 00000000000..f9f7a914aa6 --- /dev/null +++ b/keyboards/gggw/crosses/3x6/rev1/config.h @@ -0,0 +1,6 @@ +/* + * OLED + */ +#define I2C_DRIVER I2CD1 +#define I2C1_SCL_PIN GP15 +#define I2C1_SDA_PIN GP14 diff --git a/keyboards/gggw/crosses/config.h b/keyboards/gggw/crosses/config.h index e114562f591..cac4e52f566 100644 --- a/keyboards/gggw/crosses/config.h +++ b/keyboards/gggw/crosses/config.h @@ -48,13 +48,6 @@ #define SCROLL_DIVISOR_H 30.0 #define SCROLL_DIVISOR_V 30.0 -/* - * OLED - */ -#define I2C_DRIVER I2CD1 -#define I2C1_SCL_PIN GP15 -#define I2C1_SDA_PIN GP14 - /* * Reset */ diff --git a/keyboards/gggw/crosses/halconf.h b/keyboards/gggw/crosses/halconf.h index 56b3c1faffc..cf80d460342 100644 --- a/keyboards/gggw/crosses/halconf.h +++ b/keyboards/gggw/crosses/halconf.h @@ -1,7 +1,9 @@ #pragma once -#define HAL_USE_SPI TRUE #define HAL_USE_I2C TRUE -#define PAL_USE_CALLBACKS TRUE + +#define HAL_USE_SPI TRUE +#define SPI_USE_WAIT TRUE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD #include_next "halconf.h" diff --git a/keyboards/gggw/crosses/lib/crosses.c b/keyboards/gggw/crosses/lib/crosses.c index 5528e0d2bfd..ee59d00aaa6 100644 --- a/keyboards/gggw/crosses/lib/crosses.c +++ b/keyboards/gggw/crosses/lib/crosses.c @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "crosses.h" +#include "transactions.h" #ifdef CONSOLE_ENABLE # include "print.h" @@ -61,9 +62,9 @@ void update_pointer_cpi(global_user_config_t* config) { pointing_device_set_cpi_on_side(false, get_pointer_dpi(config)); #endif /* ifdef POINTING_DEVICE_COMBINED */ -#ifndef POINTING_DEVICE_COMBINED +#if defined(POINTING_DEVICE_LEFT) || defined(POINTING_DEVICE_RIGHT) pointing_device_set_cpi(get_pointer_dpi(config)); -#endif /* ifndef POINTING_DEVICE_COMBINED */ +#endif /* LEFT || RIGHT */ } void change_pointer_dpi(global_user_config_t* config, bool inc) { @@ -90,9 +91,10 @@ void change_pointer_dpi(global_user_config_t* config, bool inc) { pointing_device_set_cpi_on_side(false, get_pointer_dpi(config)); #endif /* ifdef POINTING_DEVICE_COMBINED */ -#ifndef POINTING_DEVICE_COMBINED +#if defined(POINTING_DEVICE_LEFT) || defined(POINTING_DEVICE_RIGHT) pointing_device_set_cpi(get_pointer_dpi(config)); -#endif /* ifndef POINTING_DEVICE_COMBINED */ +#endif /* ifdef POINTING_DEVICE_* */ + write_config_to_eeprom(&global_user_config); } @@ -120,7 +122,7 @@ void eeconfig_init_user(void) { * Single Trackball Config ***********************************************************************/ -#ifndef POINTING_DEVICE_COMBINED +#if defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_LEFT) report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { if (set_scrolling) { @@ -144,7 +146,7 @@ report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { return mouse_report; } -#endif /* ifndef POINTING_DEVICE_COMBINED */ +#endif /* RIGHT || LEFT */ /*********************************************************************** * Dual Trackball Config @@ -175,11 +177,11 @@ report_mouse_t pointing_device_task_combined_user(report_mouse_t left_report, re #endif /* ifdef POINTING_DEVICE_COMBINED */ layer_state_t layer_state_set_user(layer_state_t state) { -#ifndef POINTING_DEVICE_COMBINED +#if defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_LEFT) if (get_highest_layer(state) != 5) { set_scrolling = false; } -#endif /* ifndef POINTING_DEVICE_COMBINED */ +#endif /* ifndef POINTING_DEVICE_* */ return state; } @@ -214,7 +216,10 @@ void housekeeping_task_kb(void) { void keyboard_post_init_user(void) { global_user_config.raw = eeconfig_read_user(); transaction_register_rpc(CROSSES_SECONDARY_SYNC_ID, secondary_sync_handler); + +#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_LEFT) update_pointer_cpi(&global_user_config); +#endif /* ifdef POINTING_DEVICE_* */ + write_config_to_eeprom(&global_user_config); } - diff --git a/keyboards/gggw/crosses/lib/crosses.h b/keyboards/gggw/crosses/lib/crosses.h index dc67f95fd32..242e872821c 100644 --- a/keyboards/gggw/crosses/lib/crosses.h +++ b/keyboards/gggw/crosses/lib/crosses.h @@ -1,7 +1,6 @@ #pragma once #include "quantum.h" -#include "transactions.h" #ifdef __cplusplus extern "C" { @@ -48,9 +47,9 @@ extern bool set_scrolling; extern float scroll_acc_h; extern float scroll_acc_v; -# ifndef POINTING_DEVICE_COMBINED +# if defined(POINTING_DEVICE_LEFT) || defined(POINTING_DEVICE_RIGHT) report_mouse_t pointing_device_task_user(report_mouse_t mouse_report); -# endif // !POINTING_DEVICE_COMBINED +# endif // POINTING_DEVICE // # ifdef POINTING_DEVICE_COMBINED report_mouse_t pointing_device_task_combined_user(report_mouse_t left_report, report_mouse_t right_report); diff --git a/keyboards/gggw/crosses/mcuconf.h b/keyboards/gggw/crosses/mcuconf.h index cb774770edf..22b74414fef 100644 --- a/keyboards/gggw/crosses/mcuconf.h +++ b/keyboards/gggw/crosses/mcuconf.h @@ -5,5 +5,3 @@ #undef RP_SPI_USE_SPI0 #define RP_SPI_USE_SPI0 TRUE -#undef RP_I2C_USE_I2C1 -#define RP_I2C_USE_I2C1 TRUE diff --git a/keyboards/gggw/crosses/rules.mk b/keyboards/gggw/crosses/rules.mk index 5d475608e79..78bcf47e3fb 100644 --- a/keyboards/gggw/crosses/rules.mk +++ b/keyboards/gggw/crosses/rules.mk @@ -1,5 +1,5 @@ POINTING_DEVICE_ENABLE = yes -POINTING_DEVICE_DRIVER = pmw3360 +POINTING_DEVICE_DRIVER = pmw3389 OLED_ENABLE = yes SRC += lib/achordion.c From dd2392bbe29e02aa17f8683d1903a2950878aa2a Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Tue, 18 Feb 2025 17:20:36 -0600 Subject: [PATCH 17/48] Adding 4x6 config --- keyboards/gggw/crosses/3x5/rev1/mcuconf.h | 1 - keyboards/gggw/crosses/3x5/rev2/config.h | 1 - .../gggw/crosses/3x6/keymaps/default/keymap.c | 8 +- keyboards/gggw/crosses/3x6/rev1/mcuconf.h | 6 + keyboards/gggw/crosses/3x6/rev1/rules.mk | 1 + keyboards/gggw/crosses/3x6/rev2/config.h | 6 + keyboards/gggw/crosses/3x6/rev2/mcuconf.h | 9 + keyboards/gggw/crosses/3x6/rev2/rules.mk | 1 + .../gggw/crosses/4x6/keymaps/default/keymap.c | 225 ++++++++++++++++++ .../gggw/crosses/4x6/keymaps/default/rules.mk | 3 + keyboards/gggw/crosses/4x6/rev1/config.h | 6 + keyboards/gggw/crosses/4x6/rev1/keyboard.json | 124 ++++++++++ keyboards/gggw/crosses/4x6/rev1/mcuconf.h | 6 + keyboards/gggw/crosses/4x6/rev1/rules.mk | 1 + keyboards/gggw/crosses/4x6/rev2/config.h | 6 + keyboards/gggw/crosses/4x6/rev2/keyboard.json | 111 +++++++++ keyboards/gggw/crosses/4x6/rev2/mcuconf.h | 9 + keyboards/gggw/crosses/4x6/rev2/rules.mk | 1 + keyboards/gggw/crosses/readme.md | 2 +- keyboards/gggw/crosses/rules.mk | 1 - 20 files changed, 517 insertions(+), 11 deletions(-) create mode 100644 keyboards/gggw/crosses/3x6/rev1/mcuconf.h create mode 100644 keyboards/gggw/crosses/3x6/rev1/rules.mk create mode 100644 keyboards/gggw/crosses/3x6/rev2/config.h create mode 100644 keyboards/gggw/crosses/3x6/rev2/mcuconf.h create mode 100644 keyboards/gggw/crosses/3x6/rev2/rules.mk create mode 100644 keyboards/gggw/crosses/4x6/keymaps/default/keymap.c create mode 100644 keyboards/gggw/crosses/4x6/keymaps/default/rules.mk create mode 100644 keyboards/gggw/crosses/4x6/rev1/config.h create mode 100644 keyboards/gggw/crosses/4x6/rev1/keyboard.json create mode 100644 keyboards/gggw/crosses/4x6/rev1/mcuconf.h create mode 100644 keyboards/gggw/crosses/4x6/rev1/rules.mk create mode 100644 keyboards/gggw/crosses/4x6/rev2/config.h create mode 100644 keyboards/gggw/crosses/4x6/rev2/keyboard.json create mode 100644 keyboards/gggw/crosses/4x6/rev2/mcuconf.h create mode 100644 keyboards/gggw/crosses/4x6/rev2/rules.mk diff --git a/keyboards/gggw/crosses/3x5/rev1/mcuconf.h b/keyboards/gggw/crosses/3x5/rev1/mcuconf.h index 7b94df1b547..4e812fc7057 100644 --- a/keyboards/gggw/crosses/3x5/rev1/mcuconf.h +++ b/keyboards/gggw/crosses/3x5/rev1/mcuconf.h @@ -1,4 +1,3 @@ - #pragma once #include_next diff --git a/keyboards/gggw/crosses/3x5/rev2/config.h b/keyboards/gggw/crosses/3x5/rev2/config.h index 7c6a61f3a15..82917b27c1b 100644 --- a/keyboards/gggw/crosses/3x5/rev2/config.h +++ b/keyboards/gggw/crosses/3x5/rev2/config.h @@ -1,4 +1,3 @@ - /* * OLED */ diff --git a/keyboards/gggw/crosses/3x6/keymaps/default/keymap.c b/keyboards/gggw/crosses/3x6/keymaps/default/keymap.c index 1e0d3923b6b..55b913591c9 100644 --- a/keyboards/gggw/crosses/3x6/keymaps/default/keymap.c +++ b/keyboards/gggw/crosses/3x6/keymaps/default/keymap.c @@ -88,7 +88,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // │ shift │ z │ x │ c │ d │ v │ │ k │ h │ , │ . │ LT(3, /) │ shift │ // └───────────└───────────┴───────────┴───────────┼───────────┼────────────┼─────┐ ┌────────────┼──────┼────────────┼───────────┴───────────┴───────────┴───────────┘ // │ MO(5) │ LT(2, esc) │ spc │ │ LT(1, ent) │ bspc │ LT(4, del) │ -// └───────────┴────────────┴─────┘ └────────────┴──────┴────────────┘ +// └───────────┴────────────┴─────┘ └────────────┴──────┴────────────┘ [_BASE] = LAYOUT_3x6( KC_ESC ,KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , KC_BSPC, KC_TAB ,LGUI_T(KC_A) , LALT_T(KC_R) , LCTL_T(KC_S) , LSFT_T(KC_T) , KC_G , KC_M , RSFT_T(KC_N) , RCTL_T(KC_E) , RALT_T(KC_I) , RGUI_T(KC_O) , KC_ENTER, @@ -305,12 +305,6 @@ bool oled_task_user(void) { } #endif /* ifdef OLED_ENABLE */ -void keyboard_post_init_user(void) { - global_user_config.raw = eeconfig_read_user(); - update_pointer_cpi(&global_user_config); - write_config_to_eeprom(&global_user_config); -} - void pointing_device_init_user(void) { set_auto_mouse_layer(_MOUS); set_auto_mouse_enable(true); diff --git a/keyboards/gggw/crosses/3x6/rev1/mcuconf.h b/keyboards/gggw/crosses/3x6/rev1/mcuconf.h new file mode 100644 index 00000000000..4e812fc7057 --- /dev/null +++ b/keyboards/gggw/crosses/3x6/rev1/mcuconf.h @@ -0,0 +1,6 @@ +#pragma once + +#include_next + +#undef RP_I2C_USE_I2C1 +#define RP_I2C_USE_I2C1 TRUE diff --git a/keyboards/gggw/crosses/3x6/rev1/rules.mk b/keyboards/gggw/crosses/3x6/rev1/rules.mk new file mode 100644 index 00000000000..fab9162dc64 --- /dev/null +++ b/keyboards/gggw/crosses/3x6/rev1/rules.mk @@ -0,0 +1 @@ +POINTING_DEVICE_DRIVER = pmw3360 diff --git a/keyboards/gggw/crosses/3x6/rev2/config.h b/keyboards/gggw/crosses/3x6/rev2/config.h new file mode 100644 index 00000000000..82917b27c1b --- /dev/null +++ b/keyboards/gggw/crosses/3x6/rev2/config.h @@ -0,0 +1,6 @@ +/* + * OLED + */ +#define I2C_DRIVER I2CD0 +#define I2C1_SDA_PIN GP8 +#define I2C1_SCL_PIN GP9 diff --git a/keyboards/gggw/crosses/3x6/rev2/mcuconf.h b/keyboards/gggw/crosses/3x6/rev2/mcuconf.h new file mode 100644 index 00000000000..f6378664da8 --- /dev/null +++ b/keyboards/gggw/crosses/3x6/rev2/mcuconf.h @@ -0,0 +1,9 @@ +#pragma once + +#include_next + +#undef RP_I2C_USE_I2C0 +#define RP_I2C_USE_I2C0 TRUE + +#undef RP_I2C_USE_I2C1 +#define RP_I2C_USE_I2C1 FALSE diff --git a/keyboards/gggw/crosses/3x6/rev2/rules.mk b/keyboards/gggw/crosses/3x6/rev2/rules.mk new file mode 100644 index 00000000000..8ff6b63653a --- /dev/null +++ b/keyboards/gggw/crosses/3x6/rev2/rules.mk @@ -0,0 +1 @@ +POINTING_DEVICE_DRIVER = pmw3389 diff --git a/keyboards/gggw/crosses/4x6/keymaps/default/keymap.c b/keyboards/gggw/crosses/4x6/keymaps/default/keymap.c new file mode 100644 index 00000000000..3c75e8a36f3 --- /dev/null +++ b/keyboards/gggw/crosses/4x6/keymaps/default/keymap.c @@ -0,0 +1,225 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +#include "lib/crosses.h" + +/* + * Keycodes, combos, and layers! oh my! + */ + +enum CROSSES_LAYERS { _BASE, _NUM, _NAV, _MEDIA, _FUNC, _MOUS, _CUST }; + +enum crosses_keycode { C_MINC = QK_KB_0, C_MDEC, C_MTOGG, C_DRAG }; + +#define CTAB LCTL_T(KC_TAB) +#define SCLM LT(_MEDIA, KC_SCLN) +#define C_SMOUS LT(_MOUS, KC_SPC) +#define LNAV MO(_NAV) +#define RENTR LT(_NUM, KC_ENT) +#define LNUM MO(_NUM) +#define RALTD RALT_T(KC_DEL) + +/* + * Keymaps! + */ + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_4x6( + //,-------------------------------------------------------. ,--------------------------------------------------------. + KC_GRV ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 , KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINUS , + //|--------+--------+--------+--------+--------+----------| |------+--------+--------+-----------+--------+----------| + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC , + //|--------+--------+--------+--------+--------+----------| |------+--------+--------+-----------+--------+----------| + CTAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SCLM, KC_QUOT , + //|--------+--------+--------+--------+--------+----------| |------+--------+--------+-----------+--------+----------| + 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_LGUI, LNAV, C_SMOUS, RENTR, LNUM, RALTD + //`-----------------------------' `-----------------------' + ), + [_NUM] = LAYOUT_4x6( + //,-------------------------------------------------------. ,--------------------------------------------------------. + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_ESC, S(KC_8), KC_7, KC_8, KC_9, KC_SLSH, KC_BSLS, S(KC_9), S(KC_0), S(KC_BSLS), KC_TRNS, KC_BSPC, + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_LCTL, KC_MINS, KC_4, KC_5, KC_6, S(KC_EQL), S(KC_5), KC_LBRC, KC_RBRC, S(KC_SCLN), KC_SCLN, KC_QUOT, + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_LSFT, KC_GRV, KC_1, KC_2, KC_3, KC_EQL, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, KC_TRNS, KC_RSFT, + //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| + KC_TRNS, KC_0, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + //`-----------------------------' `--------------------------' + ), + [_NAV] = LAYOUT_4x6( + //,-------------------------------------------------------. ,--------------------------------------------------------. + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO, KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO, KC_NO, KC_NO, KC_COPY, KC_PSTE, KC_NO, KC_NO, KC_HOME, KC_END, KC_PGDN, KC_PGUP, KC_NO, + //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + //`-----------------------------' `--------------------------' + ), + [_MEDIA] = LAYOUT_4x6( + //,-------------------------------------------------------. ,--------------------------------------------------------. + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO, KC_MPRV, KC_VOLD, KC_MPLY, KC_VOLU, KC_MNXT , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + //`-----------------------------' `--------------------------' + ), + [_FUNC] = LAYOUT_4x6( + //,-------------------------------------------------------. ,--------------------------------------------------------. + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_F11 ,KC_F12 ,KC_F13 ,KC_F14, KC_F15 , KC_TRNS, KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9, KC_F10 , KC_TRNS ,KC_RSFT ,KC_RCTL ,KC_RALT ,KC_RGUI ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 , KC_F5 , KC_TRNS ,KC_TRNS , KC_TRNS,KC_TRNS ,KC_TRNS, KC_NO , + //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS ,KC_TRNS ,KC_TRNS + //`-----------------------------' `--------------------------' + ), + [_MOUS] = LAYOUT_4x6( + //,-------------------------------------------------------. ,--------------------------------------------------------. + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_LSFT ,KC_LALT ,KC_NO ,KC_NO ,KC_NO , KC_NO ,C_MINC ,C_MDEC ,KC_NO ,KC_NO ,C_MTOGG , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_LCTL ,MS_BTN3 ,MS_BTN2 ,MS_BTN1 ,KC_NO , KC_NO ,KC_RSFT ,KC_RCTL ,KC_RALT ,KC_RGUI ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_LGUI ,KC_NO ,KC_NO ,C_DRAG ,KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| + KC_TRNS ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO + //`-----------------------------' `--------------------------' + ), + [_CUST] = LAYOUT_4x6( + //,-------------------------------------------------------. ,--------------------------------------------------------. + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_NO ,KC_NO , KC_NO ,KC_NO , KC_NO + //`-----------------------------' `--------------------------' + ) +}; + +// clang-format on + +bool process_record_user(uint16_t keycode, keyrecord_t* record) { + switch (keycode) { + case RSFT_T(KC_LBRC): + if (record->tap.count && record->event.pressed) { + tap_code16(S(KC_LBRC)); + return false; + } + break; + + case RCTL_T(KC_RBRC): + if (record->tap.count && record->event.pressed) { + tap_code16(S(KC_RBRC)); + return false; + } + break; + + case C_MINC: + if (record->event.pressed) { + change_pointer_dpi(&global_user_config, true); + debug_config_to_console(&global_user_config); + + return false; + } + break; + + case C_MDEC: + if (record->event.pressed) { + change_pointer_dpi(&global_user_config, false); + debug_config_to_console(&global_user_config); + + return false; + } + break; + + case C_MTOGG: + if (record->event.pressed) { + bool current_state = get_auto_mouse_enable(); + set_auto_mouse_enable(!current_state); + + return false; + } + break; + + case C_DRAG: + if (record->event.pressed) { + set_scrolling = record->event.pressed; + return true; + } + break; + } + + return true; +} + +#ifdef OLED_ENABLE + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (!is_keyboard_master()) { + return OLED_ROTATION_180; + } + + return rotation; +} + +static void render_logo(void) { + static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; + + oled_write_P(qmk_logo, false); +} + +bool oled_task_user(void) { + render_logo(); + + // clang-format off + const char* layer_names[] = { + [_BASE] = "BASE CPI: ", + [_NUM] = "PROG CPI: ", + [_NAV] = "NAVI CPI: ", + [_MEDIA] = "MEDIA CPI: ", + [_FUNC] = "FUNC CPI: ", + [_MOUS] = "MOUSE CPI: ", + [_CUST] = "CUST CPI: ", + }; + // clang-format on + + char cpi_str[6]; + uint16_t current_dpi = get_pointer_dpi(&global_user_config); + + snprintf(cpi_str, sizeof(cpi_str), "%u", (unsigned int)current_dpi); + + oled_write(PSTR(layer_names[get_highest_layer(layer_state)]), false); + oled_write(cpi_str, false); + + return false; +} +#endif /* ifdef OLED_ENABLE */ + +void pointing_device_init_user(void) { + set_auto_mouse_layer(_MOUS); + set_auto_mouse_enable(true); +} diff --git a/keyboards/gggw/crosses/4x6/keymaps/default/rules.mk b/keyboards/gggw/crosses/4x6/keymaps/default/rules.mk new file mode 100644 index 00000000000..7f0a33220de --- /dev/null +++ b/keyboards/gggw/crosses/4x6/keymaps/default/rules.mk @@ -0,0 +1,3 @@ +COMBO_ENABLE = no +CAPS_WORD_ENABLE = yes +DEFERRED_EXEC_ENABLE = yes diff --git a/keyboards/gggw/crosses/4x6/rev1/config.h b/keyboards/gggw/crosses/4x6/rev1/config.h new file mode 100644 index 00000000000..f9f7a914aa6 --- /dev/null +++ b/keyboards/gggw/crosses/4x6/rev1/config.h @@ -0,0 +1,6 @@ +/* + * OLED + */ +#define I2C_DRIVER I2CD1 +#define I2C1_SCL_PIN GP15 +#define I2C1_SDA_PIN GP14 diff --git a/keyboards/gggw/crosses/4x6/rev1/keyboard.json b/keyboards/gggw/crosses/4x6/rev1/keyboard.json new file mode 100644 index 00000000000..6ebc9ac2717 --- /dev/null +++ b/keyboards/gggw/crosses/4x6/rev1/keyboard.json @@ -0,0 +1,124 @@ +{ + "manufacturer": "Good Great Grand Wonderful LLC", + "keyboard_name": "Crosses 4x6 rev1", + "maintainer": "vinniefranco", + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "command": false, + "console": true, + "extrakey": true, + "mousekey": true, + "nkro": true + }, + "matrix_pins": { + "cols": [ + "GP13", + "GP26", + "GP22", + "GP21", + "GP23", + "GP20" + ], + "rows": [ + "GP12", + "GP27", + "GP28", + "GP29", + "GP9" + ] + }, + "processor": "RP2040", + "split": { + "enabled": true, + "serial": { + "driver": "vendor", + "pin": "GP4" + }, + "transport": { + "sync": { + "matrix_state": true, + "layer_state": true + } + } + }, + "tapping": { + "term": 195 + }, + "url": "https://ergokeyboards.com", + "usb": { + "device_version": "0.3.0", + "pid": "0x5649", + "vid": "0x3034" + }, + "layouts": { + "LAYOUT_4x6": { + "layout": [ + { "matrix": [ 0, 0 ], "x": 0, "y": 1 }, + { "matrix": [ 0, 1 ], "x": 1, "y": 1 }, + { "matrix": [ 0, 2 ], "x": 2, "y": 0.5 }, + { "matrix": [ 0, 3 ], "x": 3, "y": 0 }, + { "matrix": [ 0, 4 ], "x": 4, "y": 0.25 }, + { "matrix": [ 0, 5 ], "x": 5, "y": 0.5 }, + + { "matrix": [ 5, 5 ], "x": 8.25, "y": 0.5 }, + { "matrix": [ 5, 4 ], "x": 9.25, "y": 0.25 }, + { "matrix": [ 5, 3 ], "x": 10.25, "y": 0 }, + { "matrix": [ 5, 2 ], "x": 11.25, "y": 0.5 }, + { "matrix": [ 5, 1 ], "x": 12.25, "y": 1 }, + { "matrix": [ 5, 0 ], "x": 13.25, "y": 1 }, + + { "matrix": [ 1, 0 ], "x": 0, "y": 2 }, + { "matrix": [ 1, 1 ], "x": 1, "y": 2 }, + { "matrix": [ 1, 2 ], "x": 2, "y": 1.5 }, + { "matrix": [ 1, 3 ], "x": 3, "y": 1 }, + { "matrix": [ 1, 4 ], "x": 4, "y": 1.25 }, + { "matrix": [ 1, 5 ], "x": 5, "y": 1.5 }, + + { "matrix": [ 6, 5 ], "x": 8.25, "y": 1.5 }, + { "matrix": [ 6, 4 ], "x": 9.25, "y": 1.25 }, + { "matrix": [ 6, 3 ], "x": 10.25, "y": 1 }, + { "matrix": [ 6, 2 ], "x": 11.25, "y": 1.5 }, + { "matrix": [ 6, 1 ], "x": 12.25, "y": 2 }, + { "matrix": [ 6, 0 ], "x": 13.25, "y": 2 }, + + { "matrix": [ 2, 0 ], "x": 0, "y": 3 }, + { "matrix": [ 2, 1 ], "x": 1, "y": 3 }, + { "matrix": [ 2, 2 ], "x": 2, "y": 2.5 }, + { "matrix": [ 2, 3 ], "x": 3, "y": 2 }, + { "matrix": [ 2, 4 ], "x": 4, "y": 2.25 }, + { "matrix": [ 2, 5 ], "x": 5, "y": 2.5 }, + + { "matrix": [ 7, 5 ], "x": 8.25, "y": 2.5 }, + { "matrix": [ 7, 4 ], "x": 9.25, "y": 2.25 }, + { "matrix": [ 7, 3 ], "x": 10.25, "y": 2 }, + { "matrix": [ 7, 2 ], "x": 11.25, "y": 2.5 }, + { "matrix": [ 7, 1 ], "x": 12.25, "y": 3 }, + { "matrix": [ 7, 0 ], "x": 13.25, "y": 3 }, + + { "matrix": [ 3, 0 ], "x": 0, "y": 4 }, + { "matrix": [ 3, 1 ], "x": 1, "y": 4 }, + { "matrix": [ 3, 2 ], "x": 2, "y": 3.5 }, + { "matrix": [ 3, 3 ], "x": 3, "y": 3 }, + { "matrix": [ 3, 4 ], "x": 4, "y": 3.25 }, + { "matrix": [ 3, 5 ], "x": 5, "y": 3.5 }, + + { "matrix": [ 8, 5 ], "x": 8.25, "y": 3.5 }, + { "matrix": [ 8, 4 ], "x": 9.25, "y": 3.25 }, + { "matrix": [ 8, 3 ], "x": 10.25, "y": 3 }, + { "matrix": [ 8, 2 ], "x": 11.25, "y": 3.5 }, + { "matrix": [ 8, 1 ], "x": 12.25, "y": 4 }, + { "matrix": [ 8, 0 ], "x": 13.25, "y": 4 }, + + { "matrix": [ 4, 3 ], "x": 3, "y": 5.25 }, + { "matrix": [ 4, 4 ], "x": 4, "y": 5.25 }, + { "matrix": [ 4, 5 ], "x": 5, "y": 5.25 }, + + { "matrix": [ 9, 5 ], "x": 8.25, "y": 5.25 }, + { "matrix": [ 9, 4 ], "x": 9.25, "y": 5.25 }, + { "matrix": [ 9, 3 ], "x": 10.25, "y": 5.25 } + ] + } + } +} diff --git a/keyboards/gggw/crosses/4x6/rev1/mcuconf.h b/keyboards/gggw/crosses/4x6/rev1/mcuconf.h new file mode 100644 index 00000000000..4e812fc7057 --- /dev/null +++ b/keyboards/gggw/crosses/4x6/rev1/mcuconf.h @@ -0,0 +1,6 @@ +#pragma once + +#include_next + +#undef RP_I2C_USE_I2C1 +#define RP_I2C_USE_I2C1 TRUE diff --git a/keyboards/gggw/crosses/4x6/rev1/rules.mk b/keyboards/gggw/crosses/4x6/rev1/rules.mk new file mode 100644 index 00000000000..fab9162dc64 --- /dev/null +++ b/keyboards/gggw/crosses/4x6/rev1/rules.mk @@ -0,0 +1 @@ +POINTING_DEVICE_DRIVER = pmw3360 diff --git a/keyboards/gggw/crosses/4x6/rev2/config.h b/keyboards/gggw/crosses/4x6/rev2/config.h new file mode 100644 index 00000000000..82917b27c1b --- /dev/null +++ b/keyboards/gggw/crosses/4x6/rev2/config.h @@ -0,0 +1,6 @@ +/* + * OLED + */ +#define I2C_DRIVER I2CD0 +#define I2C1_SDA_PIN GP8 +#define I2C1_SCL_PIN GP9 diff --git a/keyboards/gggw/crosses/4x6/rev2/keyboard.json b/keyboards/gggw/crosses/4x6/rev2/keyboard.json new file mode 100644 index 00000000000..e1eeedb1d99 --- /dev/null +++ b/keyboards/gggw/crosses/4x6/rev2/keyboard.json @@ -0,0 +1,111 @@ +{ + "manufacturer": "Good Great Grand Wonderful LLC", + "keyboard_name": "Crosses 54 Rev2", + "maintainer": "vinniefranco", + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "command": false, + "console": true, + "extrakey": true, + "mousekey": true, + "nkro": true + }, + "matrix_pins": { + "cols": [ "GP13", "GP26", "GP22", "GP21", "GP23", "GP20" ], + "rows": [ "GP5", "GP27", "GP28", "GP29", "GP7" ] + }, + "processor": "RP2040", + "split": { + "enabled": true, + "serial": { + "driver": "vendor", + "pin": "GP4" + }, + "transport": { + "sync": { + "matrix_state": true, + "layer_state": true + } + } + }, + "tapping": { + "term": 195 + }, + "url": "https://ergokeyboards.com", + "usb": { + "device_version": "0.3.0", + "pid": "0x5659", + "vid": "0x3034" + }, + "layouts": { + "LAYOUT_4x6": { + "layout": [ + { "matrix": [ 0, 0 ], "x": 0, "y": 1 }, + { "matrix": [ 0, 1 ], "x": 1, "y": 1 }, + { "matrix": [ 0, 2 ], "x": 2, "y": 0.5 }, + { "matrix": [ 0, 3 ], "x": 3, "y": 0 }, + { "matrix": [ 0, 4 ], "x": 4, "y": 0.25 }, + { "matrix": [ 0, 5 ], "x": 5, "y": 0.5 }, + + { "matrix": [ 5, 5 ], "x": 8.25, "y": 0.5 }, + { "matrix": [ 5, 4 ], "x": 9.25, "y": 0.25 }, + { "matrix": [ 5, 3 ], "x": 10.25, "y": 0 }, + { "matrix": [ 5, 2 ], "x": 11.25, "y": 0.5 }, + { "matrix": [ 5, 1 ], "x": 12.25, "y": 1 }, + { "matrix": [ 5, 0 ], "x": 13.25, "y": 1 }, + + { "matrix": [ 1, 0 ], "x": 0, "y": 2 }, + { "matrix": [ 1, 1 ], "x": 1, "y": 2 }, + { "matrix": [ 1, 2 ], "x": 2, "y": 1.5 }, + { "matrix": [ 1, 3 ], "x": 3, "y": 1 }, + { "matrix": [ 1, 4 ], "x": 4, "y": 1.25 }, + { "matrix": [ 1, 5 ], "x": 5, "y": 1.5 }, + + { "matrix": [ 6, 5 ], "x": 8.25, "y": 1.5 }, + { "matrix": [ 6, 4 ], "x": 9.25, "y": 1.25 }, + { "matrix": [ 6, 3 ], "x": 10.25, "y": 1 }, + { "matrix": [ 6, 2 ], "x": 11.25, "y": 1.5 }, + { "matrix": [ 6, 1 ], "x": 12.25, "y": 2 }, + { "matrix": [ 6, 0 ], "x": 13.25, "y": 2 }, + + { "matrix": [ 2, 0 ], "x": 0, "y": 3 }, + { "matrix": [ 2, 1 ], "x": 1, "y": 3 }, + { "matrix": [ 2, 2 ], "x": 2, "y": 2.5 }, + { "matrix": [ 2, 3 ], "x": 3, "y": 2 }, + { "matrix": [ 2, 4 ], "x": 4, "y": 2.25 }, + { "matrix": [ 2, 5 ], "x": 5, "y": 2.5 }, + + { "matrix": [ 7, 5 ], "x": 8.25, "y": 2.5 }, + { "matrix": [ 7, 4 ], "x": 9.25, "y": 2.25 }, + { "matrix": [ 7, 3 ], "x": 10.25, "y": 2 }, + { "matrix": [ 7, 2 ], "x": 11.25, "y": 2.5 }, + { "matrix": [ 7, 1 ], "x": 12.25, "y": 3 }, + { "matrix": [ 7, 0 ], "x": 13.25, "y": 3 }, + + { "matrix": [ 3, 0 ], "x": 0, "y": 4 }, + { "matrix": [ 3, 1 ], "x": 1, "y": 4 }, + { "matrix": [ 3, 2 ], "x": 2, "y": 3.5 }, + { "matrix": [ 3, 3 ], "x": 3, "y": 3 }, + { "matrix": [ 3, 4 ], "x": 4, "y": 3.25 }, + { "matrix": [ 3, 5 ], "x": 5, "y": 3.5 }, + + { "matrix": [ 8, 5 ], "x": 8.25, "y": 3.5 }, + { "matrix": [ 8, 4 ], "x": 9.25, "y": 3.25 }, + { "matrix": [ 8, 3 ], "x": 10.25, "y": 3 }, + { "matrix": [ 8, 2 ], "x": 11.25, "y": 3.5 }, + { "matrix": [ 8, 1 ], "x": 12.25, "y": 4 }, + { "matrix": [ 8, 0 ], "x": 13.25, "y": 4 }, + + { "matrix": [ 4, 3 ], "x": 3, "y": 5.25 }, + { "matrix": [ 4, 4 ], "x": 4, "y": 5.25 }, + { "matrix": [ 4, 5 ], "x": 5, "y": 5.25 }, + + { "matrix": [ 9, 5 ], "x": 8.25, "y": 5.25 }, + { "matrix": [ 9, 4 ], "x": 9.25, "y": 5.25 }, + { "matrix": [ 9, 3 ], "x": 10.25, "y": 5.25 } + ] + } + } +} diff --git a/keyboards/gggw/crosses/4x6/rev2/mcuconf.h b/keyboards/gggw/crosses/4x6/rev2/mcuconf.h new file mode 100644 index 00000000000..f6378664da8 --- /dev/null +++ b/keyboards/gggw/crosses/4x6/rev2/mcuconf.h @@ -0,0 +1,9 @@ +#pragma once + +#include_next + +#undef RP_I2C_USE_I2C0 +#define RP_I2C_USE_I2C0 TRUE + +#undef RP_I2C_USE_I2C1 +#define RP_I2C_USE_I2C1 FALSE diff --git a/keyboards/gggw/crosses/4x6/rev2/rules.mk b/keyboards/gggw/crosses/4x6/rev2/rules.mk new file mode 100644 index 00000000000..8ff6b63653a --- /dev/null +++ b/keyboards/gggw/crosses/4x6/rev2/rules.mk @@ -0,0 +1 @@ +POINTING_DEVICE_DRIVER = pmw3389 diff --git a/keyboards/gggw/crosses/readme.md b/keyboards/gggw/crosses/readme.md index 0840490062b..2fedaf608eb 100644 --- a/keyboards/gggw/crosses/readme.md +++ b/keyboards/gggw/crosses/readme.md @@ -9,7 +9,7 @@ * Matrix configurations in: 3x5, 3x6, 4x6 boards with a three key thumb cluster. * Trackballs! * OLED Displays - * Any SPI / I2C breakout using a 6P JST SH for SPI and a 2.57 breakout for I2C. + * Any SPI / I2C breakout using a 6P JST SH for SPI and a 2.54mm breakout for I2C. * Hardware Availability: *Links to where you can find this hardware* Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/gggw/crosses/rules.mk b/keyboards/gggw/crosses/rules.mk index 78bcf47e3fb..4aa66610b68 100644 --- a/keyboards/gggw/crosses/rules.mk +++ b/keyboards/gggw/crosses/rules.mk @@ -1,5 +1,4 @@ POINTING_DEVICE_ENABLE = yes -POINTING_DEVICE_DRIVER = pmw3389 OLED_ENABLE = yes SRC += lib/achordion.c From 1d80946b7066f1a4a34e765691c8d0f8ea045a99 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 00:05:28 -0500 Subject: [PATCH 18/48] Update readme.md --- keyboards/gggw/crosses/readme.md | 33 +++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/keyboards/gggw/crosses/readme.md b/keyboards/gggw/crosses/readme.md index 2fedaf608eb..95b8c867440 100644 --- a/keyboards/gggw/crosses/readme.md +++ b/keyboards/gggw/crosses/readme.md @@ -1,8 +1,8 @@ # Crosses by Good Great Grand Wonderful -![crosses](imgur.com image replace me!) +![crosses](https://ergokeyboards.com/cdn/shop/files/3x5-dual-tb-oled.png) -*A short description of the keyboard/project* +Our thumbs evolved to give us dexterity; shouldn't our keyboards evolve with them? * Keyboard Maintainer: [Good Great Grand Wonderful LLC](https://github.com/Good-Great-Grand-Wonderful) * Hardware Supported: @@ -10,22 +10,37 @@ * Trackballs! * OLED Displays * Any SPI / I2C breakout using a 6P JST SH for SPI and a 2.54mm breakout for I2C. -* Hardware Availability: *Links to where you can find this hardware* +* Hardware Availability: https://ergokeyboards.com -Make example for this keyboard (after setting up your build environment): +### Compiling (after setting up your build environment): - qmk compile -kb gggw/crosses/ -km default +```bash +qmk compile -kb gggw/crosses// -km default +``` -Flashing example for this keyboard: +### Flashing example for this keyboard: - qmk flash -kb gggw/crosses/ -km default +```bash +qmk flash -kb gggw/crosses// -km default +``` + +#### Concrete example: + +`` is one of 3x5, 3x6, 4x6 + +`` is the firmware required for your thumbclusters which is one of: rev1, rev2 + +Flashing a 3x6 revision 2 model + +```bash +qmk comfile -kb gggw/crosses/3x6/rev2 -km default +``` See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). ## Bootloader -Enter the bootloader in 3 ways: +Enter the bootloader one of two ways: -* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard * **Physical reset button**: Double-tap the reset button on the RP2040 * **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available From c639ba2b78685ef03c8a60b4b08d4c8d7efb7d81 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 00:15:11 -0500 Subject: [PATCH 19/48] QMK Linting --- keyboards/gggw/crosses/3x5/config.h | 20 -------------------- keyboards/gggw/crosses/3x5/rev1/mcuconf.h | 16 ++++++++++++++++ keyboards/gggw/crosses/3x5/rev2/mcuconf.h | 16 ++++++++++++++++ keyboards/gggw/crosses/3x6/config.h | 20 -------------------- keyboards/gggw/crosses/3x6/rev1/mcuconf.h | 16 ++++++++++++++++ keyboards/gggw/crosses/3x6/rev2/mcuconf.h | 16 ++++++++++++++++ keyboards/gggw/crosses/4x6/rev1/mcuconf.h | 16 ++++++++++++++++ keyboards/gggw/crosses/4x6/rev2/mcuconf.h | 16 ++++++++++++++++ keyboards/gggw/crosses/config.h | 16 ++++++++++++++++ keyboards/gggw/crosses/halconf.h | 18 +++++++++++++++++- keyboards/gggw/crosses/mcuconf.h | 16 ++++++++++++++++ keyboards/gggw/crosses/post_config.h | 15 +++++++++++++++ lib/chibios | 2 +- lib/chibios-contrib | 2 +- 14 files changed, 162 insertions(+), 43 deletions(-) delete mode 100644 keyboards/gggw/crosses/3x5/config.h delete mode 100644 keyboards/gggw/crosses/3x6/config.h diff --git a/keyboards/gggw/crosses/3x5/config.h b/keyboards/gggw/crosses/3x5/config.h deleted file mode 100644 index 212d4ff99bd..00000000000 --- a/keyboards/gggw/crosses/3x5/config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2024 Vincent Franco - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#pragma once - diff --git a/keyboards/gggw/crosses/3x5/rev1/mcuconf.h b/keyboards/gggw/crosses/3x5/rev1/mcuconf.h index 4e812fc7057..8c10b7b0167 100644 --- a/keyboards/gggw/crosses/3x5/rev1/mcuconf.h +++ b/keyboards/gggw/crosses/3x5/rev1/mcuconf.h @@ -1,3 +1,19 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ #pragma once #include_next diff --git a/keyboards/gggw/crosses/3x5/rev2/mcuconf.h b/keyboards/gggw/crosses/3x5/rev2/mcuconf.h index f6378664da8..3c17194932e 100644 --- a/keyboards/gggw/crosses/3x5/rev2/mcuconf.h +++ b/keyboards/gggw/crosses/3x5/rev2/mcuconf.h @@ -1,3 +1,19 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ #pragma once #include_next diff --git a/keyboards/gggw/crosses/3x6/config.h b/keyboards/gggw/crosses/3x6/config.h deleted file mode 100644 index 212d4ff99bd..00000000000 --- a/keyboards/gggw/crosses/3x6/config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2024 Vincent Franco - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#pragma once - diff --git a/keyboards/gggw/crosses/3x6/rev1/mcuconf.h b/keyboards/gggw/crosses/3x6/rev1/mcuconf.h index 4e812fc7057..8c10b7b0167 100644 --- a/keyboards/gggw/crosses/3x6/rev1/mcuconf.h +++ b/keyboards/gggw/crosses/3x6/rev1/mcuconf.h @@ -1,3 +1,19 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ #pragma once #include_next diff --git a/keyboards/gggw/crosses/3x6/rev2/mcuconf.h b/keyboards/gggw/crosses/3x6/rev2/mcuconf.h index f6378664da8..3c17194932e 100644 --- a/keyboards/gggw/crosses/3x6/rev2/mcuconf.h +++ b/keyboards/gggw/crosses/3x6/rev2/mcuconf.h @@ -1,3 +1,19 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ #pragma once #include_next diff --git a/keyboards/gggw/crosses/4x6/rev1/mcuconf.h b/keyboards/gggw/crosses/4x6/rev1/mcuconf.h index 4e812fc7057..8c10b7b0167 100644 --- a/keyboards/gggw/crosses/4x6/rev1/mcuconf.h +++ b/keyboards/gggw/crosses/4x6/rev1/mcuconf.h @@ -1,3 +1,19 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ #pragma once #include_next diff --git a/keyboards/gggw/crosses/4x6/rev2/mcuconf.h b/keyboards/gggw/crosses/4x6/rev2/mcuconf.h index f6378664da8..3c17194932e 100644 --- a/keyboards/gggw/crosses/4x6/rev2/mcuconf.h +++ b/keyboards/gggw/crosses/4x6/rev2/mcuconf.h @@ -1,3 +1,19 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ #pragma once #include_next diff --git a/keyboards/gggw/crosses/config.h b/keyboards/gggw/crosses/config.h index cac4e52f566..5a8242557bb 100644 --- a/keyboards/gggw/crosses/config.h +++ b/keyboards/gggw/crosses/config.h @@ -1,3 +1,19 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ #pragma once #define SERIAL_PIO_USE_PIO1 diff --git a/keyboards/gggw/crosses/halconf.h b/keyboards/gggw/crosses/halconf.h index cf80d460342..d37878290a4 100644 --- a/keyboards/gggw/crosses/halconf.h +++ b/keyboards/gggw/crosses/halconf.h @@ -1,3 +1,19 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ #pragma once #define HAL_USE_I2C TRUE @@ -6,4 +22,4 @@ #define SPI_USE_WAIT TRUE #define SPI_SELECT_MODE SPI_SELECT_MODE_PAD -#include_next "halconf.h" +#include_next diff --git a/keyboards/gggw/crosses/mcuconf.h b/keyboards/gggw/crosses/mcuconf.h index 22b74414fef..973db1e409a 100644 --- a/keyboards/gggw/crosses/mcuconf.h +++ b/keyboards/gggw/crosses/mcuconf.h @@ -1,3 +1,19 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ #pragma once #include_next diff --git a/keyboards/gggw/crosses/post_config.h b/keyboards/gggw/crosses/post_config.h index 7028eee03c1..9c63c203103 100644 --- a/keyboards/gggw/crosses/post_config.h +++ b/keyboards/gggw/crosses/post_config.h @@ -1,4 +1,19 @@ +/* +Copyright 2025 Vincent Franco +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ #pragma once /* diff --git a/lib/chibios b/lib/chibios index 2365f844292..be44b3305f9 160000 --- a/lib/chibios +++ b/lib/chibios @@ -1 +1 @@ -Subproject commit 2365f844292513ea0ee9eea6ab778d56f9ccd3b9 +Subproject commit be44b3305f9a9fe5f2f49a4e7b978db322dc463e diff --git a/lib/chibios-contrib b/lib/chibios-contrib index 3ac181e4ca5..77cb0a4f758 160000 --- a/lib/chibios-contrib +++ b/lib/chibios-contrib @@ -1 +1 @@ -Subproject commit 3ac181e4ca5cafddaf8b472baa1d09c2b24c77b6 +Subproject commit 77cb0a4f7589f89e724f5e6ecb1d76d514dd1212 From 73293addf98fac1f7216c7b72427e813185dbb2f Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 00:27:33 -0500 Subject: [PATCH 20/48] Revert submodule pointer --- lib/chibios | 2 +- lib/chibios-contrib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/chibios b/lib/chibios index be44b3305f9..2365f844292 160000 --- a/lib/chibios +++ b/lib/chibios @@ -1 +1 @@ -Subproject commit be44b3305f9a9fe5f2f49a4e7b978db322dc463e +Subproject commit 2365f844292513ea0ee9eea6ab778d56f9ccd3b9 diff --git a/lib/chibios-contrib b/lib/chibios-contrib index 77cb0a4f758..3ac181e4ca5 160000 --- a/lib/chibios-contrib +++ b/lib/chibios-contrib @@ -1 +1 @@ -Subproject commit 77cb0a4f7589f89e724f5e6ecb1d76d514dd1212 +Subproject commit 3ac181e4ca5cafddaf8b472baa1d09c2b24c77b6 From 5b6cc2edf25b4b8d996f710c34bfed2340422794 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 00:31:37 -0500 Subject: [PATCH 21/48] qmk format --- keyboards/gggw/crosses/3x5/rev1/keyboard.json | 4 +- keyboards/gggw/crosses/3x5/rev2/keyboard.json | 4 +- keyboards/gggw/crosses/3x6/rev1/keyboard.json | 398 ++---------------- keyboards/gggw/crosses/3x6/rev2/keyboard.json | 93 ++-- keyboards/gggw/crosses/4x6/rev1/keyboard.json | 138 +++--- keyboards/gggw/crosses/4x6/rev2/keyboard.json | 125 +++--- 6 files changed, 213 insertions(+), 549 deletions(-) diff --git a/keyboards/gggw/crosses/3x5/rev1/keyboard.json b/keyboards/gggw/crosses/3x5/rev1/keyboard.json index 9edbb3b5544..4802cd0f142 100644 --- a/keyboards/gggw/crosses/3x5/rev1/keyboard.json +++ b/keyboards/gggw/crosses/3x5/rev1/keyboard.json @@ -25,8 +25,8 @@ }, "transport": { "sync": { - "matrix_state": true, - "layer_state": true + "layer_state": true, + "matrix_state": true } } }, diff --git a/keyboards/gggw/crosses/3x5/rev2/keyboard.json b/keyboards/gggw/crosses/3x5/rev2/keyboard.json index cdb7035ccfd..7a79d5255bd 100644 --- a/keyboards/gggw/crosses/3x5/rev2/keyboard.json +++ b/keyboards/gggw/crosses/3x5/rev2/keyboard.json @@ -25,8 +25,8 @@ }, "transport": { "sync": { - "matrix_state": true, - "layer_state": true + "layer_state": true, + "matrix_state": true } } }, diff --git a/keyboards/gggw/crosses/3x6/rev1/keyboard.json b/keyboards/gggw/crosses/3x6/rev1/keyboard.json index 371da0d50aa..aaa539783d1 100644 --- a/keyboards/gggw/crosses/3x6/rev1/keyboard.json +++ b/keyboards/gggw/crosses/3x6/rev1/keyboard.json @@ -13,20 +13,8 @@ "nkro": true }, "matrix_pins": { - "cols": [ - "GP13", - "GP26", - "GP22", - "GP21", - "GP23", - "GP20" - ], - "rows": [ - "GP27", - "GP28", - "GP29", - "GP9" - ] + "cols": ["GP13", "GP26", "GP22", "GP21", "GP23", "GP20"], + "rows": ["GP27", "GP28", "GP29", "GP9"] }, "processor": "RP2040", "split": { @@ -37,8 +25,8 @@ }, "transport": { "sync": { - "matrix_state": true, - "layer_state": true + "layer_state": true, + "matrix_state": true } } }, @@ -54,342 +42,48 @@ "layouts": { "LAYOUT_3x6": { "layout": [ - { - "matrix": [ - 0, - 0 - ], - "x": 0, - "y": 1 - }, - { - "matrix": [ - 0, - 1 - ], - "x": 1, - "y": 1 - }, - { - "matrix": [ - 0, - 2 - ], - "x": 2, - "y": 0.5 - }, - { - "matrix": [ - 0, - 3 - ], - "x": 3, - "y": 0 - }, - { - "matrix": [ - 0, - 4 - ], - "x": 4, - "y": 0.25 - }, - { - "matrix": [ - 0, - 5 - ], - "x": 5, - "y": 0.5 - }, - { - "matrix": [ - 4, - 5 - ], - "x": 9, - "y": 0.5 - }, - { - "matrix": [ - 4, - 4 - ], - "x": 10, - "y": 0.25 - }, - { - "matrix": [ - 4, - 3 - ], - "x": 11, - "y": 0 - }, - { - "matrix": [ - 4, - 2 - ], - "x": 12, - "y": 0.5 - }, - { - "matrix": [ - 4, - 1 - ], - "x": 13, - "y": 1 - }, - { - "matrix": [ - 4, - 0 - ], - "x": 14, - "y": 1 - }, - { - "matrix": [ - 1, - 0 - ], - "x": 0, - "y": 2 - }, - { - "matrix": [ - 1, - 1 - ], - "x": 1, - "y": 2 - }, - { - "matrix": [ - 1, - 2 - ], - "x": 2, - "y": 1.5 - }, - { - "matrix": [ - 1, - 3 - ], - "x": 3, - "y": 1 - }, - { - "matrix": [ - 1, - 4 - ], - "x": 4, - "y": 1.25 - }, - { - "matrix": [ - 1, - 5 - ], - "x": 5, - "y": 1.5 - }, - { - "matrix": [ - 5, - 5 - ], - "x": 9, - "y": 1.5 - }, - { - "matrix": [ - 5, - 4 - ], - "x": 10, - "y": 1.25 - }, - { - "matrix": [ - 5, - 3 - ], - "x": 11, - "y": 1 - }, - { - "matrix": [ - 5, - 2 - ], - "x": 12, - "y": 1.5 - }, - { - "matrix": [ - 5, - 1 - ], - "x": 13, - "y": 2 - }, - { - "matrix": [ - 5, - 0 - ], - "x": 14, - "y": 2 - }, - { - "matrix": [ - 2, - 0 - ], - "x": 0, - "y": 3 - }, - { - "matrix": [ - 2, - 1 - ], - "x": 1, - "y": 3 - }, - { - "matrix": [ - 2, - 2 - ], - "x": 2, - "y": 2.5 - }, - { - "matrix": [ - 2, - 3 - ], - "x": 3, - "y": 2 - }, - { - "matrix": [ - 2, - 4 - ], - "x": 4, - "y": 2.25 - }, - { - "matrix": [ - 2, - 5 - ], - "x": 5, - "y": 2.5 - }, - { - "matrix": [ - 6, - 5 - ], - "x": 9, - "y": 2.5 - }, - { - "matrix": [ - 6, - 4 - ], - "x": 10, - "y": 2.25 - }, - { - "matrix": [ - 6, - 3 - ], - "x": 11, - "y": 2 - }, - { - "matrix": [ - 6, - 2 - ], - "x": 12, - "y": 2.5 - }, - { - "matrix": [ - 6, - 1 - ], - "x": 13, - "y": 3 - }, - { - "matrix": [ - 6, - 0 - ], - "x": 14, - "y": 3 - }, - { - "matrix": [ - 3, - 3 - ], - "x": 3, - "y": 4 - }, - { - "matrix": [ - 3, - 4 - ], - "x": 4, - "y": 4 - }, - { - "matrix": [ - 3, - 5 - ], - "x": 5, - "y": 4 - }, - { - "matrix": [ - 7, - 5 - ], - "x": 9, - "y": 4 - }, - { - "matrix": [ - 7, - 4 - ], - "x": 10, - "y": 4 - }, - { - "matrix": [ - 7, - 3 - ], - "x": 11, - "y": 4 - } + {"matrix": [0, 0], "x": 0, "y": 1}, + {"matrix": [0, 1], "x": 1, "y": 1}, + {"matrix": [0, 2], "x": 2, "y": 0.5}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0.25}, + {"matrix": [0, 5], "x": 5, "y": 0.5}, + {"matrix": [4, 5], "x": 9, "y": 0.5}, + {"matrix": [4, 4], "x": 10, "y": 0.25}, + {"matrix": [4, 3], "x": 11, "y": 0}, + {"matrix": [4, 2], "x": 12, "y": 0.5}, + {"matrix": [4, 1], "x": 13, "y": 1}, + {"matrix": [4, 0], "x": 14, "y": 1}, + {"matrix": [1, 0], "x": 0, "y": 2}, + {"matrix": [1, 1], "x": 1, "y": 2}, + {"matrix": [1, 2], "x": 2, "y": 1.5}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1.25}, + {"matrix": [1, 5], "x": 5, "y": 1.5}, + {"matrix": [5, 5], "x": 9, "y": 1.5}, + {"matrix": [5, 4], "x": 10, "y": 1.25}, + {"matrix": [5, 3], "x": 11, "y": 1}, + {"matrix": [5, 2], "x": 12, "y": 1.5}, + {"matrix": [5, 1], "x": 13, "y": 2}, + {"matrix": [5, 0], "x": 14, "y": 2}, + {"matrix": [2, 0], "x": 0, "y": 3}, + {"matrix": [2, 1], "x": 1, "y": 3}, + {"matrix": [2, 2], "x": 2, "y": 2.5}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2.25}, + {"matrix": [2, 5], "x": 5, "y": 2.5}, + {"matrix": [6, 5], "x": 9, "y": 2.5}, + {"matrix": [6, 4], "x": 10, "y": 2.25}, + {"matrix": [6, 3], "x": 11, "y": 2}, + {"matrix": [6, 2], "x": 12, "y": 2.5}, + {"matrix": [6, 1], "x": 13, "y": 3}, + {"matrix": [6, 0], "x": 14, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 4}, + {"matrix": [3, 4], "x": 4, "y": 4}, + {"matrix": [3, 5], "x": 5, "y": 4}, + {"matrix": [7, 5], "x": 9, "y": 4}, + {"matrix": [7, 4], "x": 10, "y": 4}, + {"matrix": [7, 3], "x": 11, "y": 4} ] } } diff --git a/keyboards/gggw/crosses/3x6/rev2/keyboard.json b/keyboards/gggw/crosses/3x6/rev2/keyboard.json index 89f10eb5ed8..602f016b78f 100644 --- a/keyboards/gggw/crosses/3x6/rev2/keyboard.json +++ b/keyboards/gggw/crosses/3x6/rev2/keyboard.json @@ -13,8 +13,9 @@ "nkro": true }, "matrix_pins": { - "cols": [ "GP1", "GP26", "GP22", "GP21", "GP23", "GP20" ], - "rows": [ "GP27", "GP28", "GP29", "GP7" ] }, + "cols": ["GP1", "GP26", "GP22", "GP21", "GP23", "GP20"], + "rows": ["GP27", "GP28", "GP29", "GP7"] + }, "processor": "RP2040", "split": { "enabled": true, @@ -24,8 +25,8 @@ }, "transport": { "sync": { - "matrix_state": true, - "layer_state": true + "layer_state": true, + "matrix_state": true } } }, @@ -41,48 +42,48 @@ "layouts": { "LAYOUT_3x6": { "layout": [ - { "matrix": [ 0, 0 ], "x": 0, "y": 1 }, - { "matrix": [ 0, 1 ], "x": 1, "y": 1 }, - { "matrix": [ 0, 2 ], "x": 2, "y": 0.5 }, - { "matrix": [ 0, 3 ], "x": 3, "y": 0 }, - { "matrix": [ 0, 4 ], "x": 4, "y": 0.25 }, - { "matrix": [ 0, 5 ], "x": 5, "y": 0.5 }, - { "matrix": [ 4, 5 ], "x": 9, "y": 0.5 }, - { "matrix": [ 4, 4 ], "x": 10, "y": 0.25 }, - { "matrix": [ 4, 3 ], "x": 11, "y": 0 }, - { "matrix": [ 4, 2 ], "x": 12, "y": 0.5 }, - { "matrix": [ 4, 1 ], "x": 13, "y": 1 }, - { "matrix": [ 4, 0 ], "x": 14, "y": 1 }, - { "matrix": [ 1, 0 ], "x": 0, "y": 2 }, - { "matrix": [ 1, 1 ], "x": 1, "y": 2 }, - { "matrix": [ 1, 2 ], "x": 2, "y": 1.5 }, - { "matrix": [ 1, 3 ], "x": 3, "y": 1 }, - { "matrix": [ 1, 4 ], "x": 4, "y": 1.25 }, - { "matrix": [ 1, 5 ], "x": 5, "y": 1.5 }, - { "matrix": [ 5, 5 ], "x": 9, "y": 1.5 }, - { "matrix": [ 5, 4 ], "x": 10, "y": 1.25 }, - { "matrix": [ 5, 3 ], "x": 11, "y": 1 }, - { "matrix": [ 5, 2 ], "x": 12, "y": 1.5 }, - { "matrix": [ 5, 1 ], "x": 13, "y": 2 }, - { "matrix": [ 5, 0 ], "x": 14, "y": 2 }, - { "matrix": [ 2, 0 ], "x": 0, "y": 3 }, - { "matrix": [ 2, 1 ], "x": 1, "y": 3 }, - { "matrix": [ 2, 2 ], "x": 2, "y": 2.5 }, - { "matrix": [ 2, 3 ], "x": 3, "y": 2 }, - { "matrix": [ 2, 4 ], "x": 4, "y": 2.25 }, - { "matrix": [ 2, 5 ], "x": 5, "y": 2.5 }, - { "matrix": [ 6, 5 ], "x": 9, "y": 2.5 }, - { "matrix": [ 6, 4 ], "x": 10, "y": 2.25 }, - { "matrix": [ 6, 3 ], "x": 11, "y": 2 }, - { "matrix": [ 6, 2 ], "x": 12, "y": 2.5 }, - { "matrix": [ 6, 1 ], "x": 13, "y": 3 }, - { "matrix": [ 6, 0 ], "x": 14, "y": 3 }, - { "matrix": [ 3, 3 ], "x": 3, "y": 4 }, - { "matrix": [ 3, 4 ], "x": 4, "y": 4 }, - { "matrix": [ 3, 5 ], "x": 5, "y": 4 }, - { "matrix": [ 7, 5 ], "x": 9, "y": 4 }, - { "matrix": [ 7, 4 ], "x": 10, "y": 4 }, - { "matrix": [ 7, 3 ], "x": 11, "y": 4 } + {"matrix": [0, 0], "x": 0, "y": 1}, + {"matrix": [0, 1], "x": 1, "y": 1}, + {"matrix": [0, 2], "x": 2, "y": 0.5}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0.25}, + {"matrix": [0, 5], "x": 5, "y": 0.5}, + {"matrix": [4, 5], "x": 9, "y": 0.5}, + {"matrix": [4, 4], "x": 10, "y": 0.25}, + {"matrix": [4, 3], "x": 11, "y": 0}, + {"matrix": [4, 2], "x": 12, "y": 0.5}, + {"matrix": [4, 1], "x": 13, "y": 1}, + {"matrix": [4, 0], "x": 14, "y": 1}, + {"matrix": [1, 0], "x": 0, "y": 2}, + {"matrix": [1, 1], "x": 1, "y": 2}, + {"matrix": [1, 2], "x": 2, "y": 1.5}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1.25}, + {"matrix": [1, 5], "x": 5, "y": 1.5}, + {"matrix": [5, 5], "x": 9, "y": 1.5}, + {"matrix": [5, 4], "x": 10, "y": 1.25}, + {"matrix": [5, 3], "x": 11, "y": 1}, + {"matrix": [5, 2], "x": 12, "y": 1.5}, + {"matrix": [5, 1], "x": 13, "y": 2}, + {"matrix": [5, 0], "x": 14, "y": 2}, + {"matrix": [2, 0], "x": 0, "y": 3}, + {"matrix": [2, 1], "x": 1, "y": 3}, + {"matrix": [2, 2], "x": 2, "y": 2.5}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2.25}, + {"matrix": [2, 5], "x": 5, "y": 2.5}, + {"matrix": [6, 5], "x": 9, "y": 2.5}, + {"matrix": [6, 4], "x": 10, "y": 2.25}, + {"matrix": [6, 3], "x": 11, "y": 2}, + {"matrix": [6, 2], "x": 12, "y": 2.5}, + {"matrix": [6, 1], "x": 13, "y": 3}, + {"matrix": [6, 0], "x": 14, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 4}, + {"matrix": [3, 4], "x": 4, "y": 4}, + {"matrix": [3, 5], "x": 5, "y": 4}, + {"matrix": [7, 5], "x": 9, "y": 4}, + {"matrix": [7, 4], "x": 10, "y": 4}, + {"matrix": [7, 3], "x": 11, "y": 4} ] } } diff --git a/keyboards/gggw/crosses/4x6/rev1/keyboard.json b/keyboards/gggw/crosses/4x6/rev1/keyboard.json index 6ebc9ac2717..24dabaf25a1 100644 --- a/keyboards/gggw/crosses/4x6/rev1/keyboard.json +++ b/keyboards/gggw/crosses/4x6/rev1/keyboard.json @@ -13,21 +13,8 @@ "nkro": true }, "matrix_pins": { - "cols": [ - "GP13", - "GP26", - "GP22", - "GP21", - "GP23", - "GP20" - ], - "rows": [ - "GP12", - "GP27", - "GP28", - "GP29", - "GP9" - ] + "cols": ["GP13", "GP26", "GP22", "GP21", "GP23", "GP20"], + "rows": ["GP12", "GP27", "GP28", "GP29", "GP9"] }, "processor": "RP2040", "split": { @@ -38,8 +25,8 @@ }, "transport": { "sync": { - "matrix_state": true, - "layer_state": true + "layer_state": true, + "matrix_state": true } } }, @@ -55,69 +42,60 @@ "layouts": { "LAYOUT_4x6": { "layout": [ - { "matrix": [ 0, 0 ], "x": 0, "y": 1 }, - { "matrix": [ 0, 1 ], "x": 1, "y": 1 }, - { "matrix": [ 0, 2 ], "x": 2, "y": 0.5 }, - { "matrix": [ 0, 3 ], "x": 3, "y": 0 }, - { "matrix": [ 0, 4 ], "x": 4, "y": 0.25 }, - { "matrix": [ 0, 5 ], "x": 5, "y": 0.5 }, - - { "matrix": [ 5, 5 ], "x": 8.25, "y": 0.5 }, - { "matrix": [ 5, 4 ], "x": 9.25, "y": 0.25 }, - { "matrix": [ 5, 3 ], "x": 10.25, "y": 0 }, - { "matrix": [ 5, 2 ], "x": 11.25, "y": 0.5 }, - { "matrix": [ 5, 1 ], "x": 12.25, "y": 1 }, - { "matrix": [ 5, 0 ], "x": 13.25, "y": 1 }, - - { "matrix": [ 1, 0 ], "x": 0, "y": 2 }, - { "matrix": [ 1, 1 ], "x": 1, "y": 2 }, - { "matrix": [ 1, 2 ], "x": 2, "y": 1.5 }, - { "matrix": [ 1, 3 ], "x": 3, "y": 1 }, - { "matrix": [ 1, 4 ], "x": 4, "y": 1.25 }, - { "matrix": [ 1, 5 ], "x": 5, "y": 1.5 }, - - { "matrix": [ 6, 5 ], "x": 8.25, "y": 1.5 }, - { "matrix": [ 6, 4 ], "x": 9.25, "y": 1.25 }, - { "matrix": [ 6, 3 ], "x": 10.25, "y": 1 }, - { "matrix": [ 6, 2 ], "x": 11.25, "y": 1.5 }, - { "matrix": [ 6, 1 ], "x": 12.25, "y": 2 }, - { "matrix": [ 6, 0 ], "x": 13.25, "y": 2 }, - - { "matrix": [ 2, 0 ], "x": 0, "y": 3 }, - { "matrix": [ 2, 1 ], "x": 1, "y": 3 }, - { "matrix": [ 2, 2 ], "x": 2, "y": 2.5 }, - { "matrix": [ 2, 3 ], "x": 3, "y": 2 }, - { "matrix": [ 2, 4 ], "x": 4, "y": 2.25 }, - { "matrix": [ 2, 5 ], "x": 5, "y": 2.5 }, - - { "matrix": [ 7, 5 ], "x": 8.25, "y": 2.5 }, - { "matrix": [ 7, 4 ], "x": 9.25, "y": 2.25 }, - { "matrix": [ 7, 3 ], "x": 10.25, "y": 2 }, - { "matrix": [ 7, 2 ], "x": 11.25, "y": 2.5 }, - { "matrix": [ 7, 1 ], "x": 12.25, "y": 3 }, - { "matrix": [ 7, 0 ], "x": 13.25, "y": 3 }, - - { "matrix": [ 3, 0 ], "x": 0, "y": 4 }, - { "matrix": [ 3, 1 ], "x": 1, "y": 4 }, - { "matrix": [ 3, 2 ], "x": 2, "y": 3.5 }, - { "matrix": [ 3, 3 ], "x": 3, "y": 3 }, - { "matrix": [ 3, 4 ], "x": 4, "y": 3.25 }, - { "matrix": [ 3, 5 ], "x": 5, "y": 3.5 }, - - { "matrix": [ 8, 5 ], "x": 8.25, "y": 3.5 }, - { "matrix": [ 8, 4 ], "x": 9.25, "y": 3.25 }, - { "matrix": [ 8, 3 ], "x": 10.25, "y": 3 }, - { "matrix": [ 8, 2 ], "x": 11.25, "y": 3.5 }, - { "matrix": [ 8, 1 ], "x": 12.25, "y": 4 }, - { "matrix": [ 8, 0 ], "x": 13.25, "y": 4 }, - - { "matrix": [ 4, 3 ], "x": 3, "y": 5.25 }, - { "matrix": [ 4, 4 ], "x": 4, "y": 5.25 }, - { "matrix": [ 4, 5 ], "x": 5, "y": 5.25 }, - - { "matrix": [ 9, 5 ], "x": 8.25, "y": 5.25 }, - { "matrix": [ 9, 4 ], "x": 9.25, "y": 5.25 }, - { "matrix": [ 9, 3 ], "x": 10.25, "y": 5.25 } + {"matrix": [0, 0], "x": 0, "y": 1}, + {"matrix": [0, 1], "x": 1, "y": 1}, + {"matrix": [0, 2], "x": 2, "y": 0.5}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0.25}, + {"matrix": [0, 5], "x": 5, "y": 0.5}, + {"matrix": [5, 5], "x": 8.25, "y": 0.5}, + {"matrix": [5, 4], "x": 9.25, "y": 0.25}, + {"matrix": [5, 3], "x": 10.25, "y": 0}, + {"matrix": [5, 2], "x": 11.25, "y": 0.5}, + {"matrix": [5, 1], "x": 12.25, "y": 1}, + {"matrix": [5, 0], "x": 13.25, "y": 1}, + {"matrix": [1, 0], "x": 0, "y": 2}, + {"matrix": [1, 1], "x": 1, "y": 2}, + {"matrix": [1, 2], "x": 2, "y": 1.5}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1.25}, + {"matrix": [1, 5], "x": 5, "y": 1.5}, + {"matrix": [6, 5], "x": 8.25, "y": 1.5}, + {"matrix": [6, 4], "x": 9.25, "y": 1.25}, + {"matrix": [6, 3], "x": 10.25, "y": 1}, + {"matrix": [6, 2], "x": 11.25, "y": 1.5}, + {"matrix": [6, 1], "x": 12.25, "y": 2}, + {"matrix": [6, 0], "x": 13.25, "y": 2}, + {"matrix": [2, 0], "x": 0, "y": 3}, + {"matrix": [2, 1], "x": 1, "y": 3}, + {"matrix": [2, 2], "x": 2, "y": 2.5}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2.25}, + {"matrix": [2, 5], "x": 5, "y": 2.5}, + {"matrix": [7, 5], "x": 8.25, "y": 2.5}, + {"matrix": [7, 4], "x": 9.25, "y": 2.25}, + {"matrix": [7, 3], "x": 10.25, "y": 2}, + {"matrix": [7, 2], "x": 11.25, "y": 2.5}, + {"matrix": [7, 1], "x": 12.25, "y": 3}, + {"matrix": [7, 0], "x": 13.25, "y": 3}, + {"matrix": [3, 0], "x": 0, "y": 4}, + {"matrix": [3, 1], "x": 1, "y": 4}, + {"matrix": [3, 2], "x": 2, "y": 3.5}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3.25}, + {"matrix": [3, 5], "x": 5, "y": 3.5}, + {"matrix": [8, 5], "x": 8.25, "y": 3.5}, + {"matrix": [8, 4], "x": 9.25, "y": 3.25}, + {"matrix": [8, 3], "x": 10.25, "y": 3}, + {"matrix": [8, 2], "x": 11.25, "y": 3.5}, + {"matrix": [8, 1], "x": 12.25, "y": 4}, + {"matrix": [8, 0], "x": 13.25, "y": 4}, + {"matrix": [4, 3], "x": 3, "y": 5.25}, + {"matrix": [4, 4], "x": 4, "y": 5.25}, + {"matrix": [4, 5], "x": 5, "y": 5.25}, + {"matrix": [9, 5], "x": 8.25, "y": 5.25}, + {"matrix": [9, 4], "x": 9.25, "y": 5.25}, + {"matrix": [9, 3], "x": 10.25, "y": 5.25} ] } } diff --git a/keyboards/gggw/crosses/4x6/rev2/keyboard.json b/keyboards/gggw/crosses/4x6/rev2/keyboard.json index e1eeedb1d99..bb22b964ff5 100644 --- a/keyboards/gggw/crosses/4x6/rev2/keyboard.json +++ b/keyboards/gggw/crosses/4x6/rev2/keyboard.json @@ -13,8 +13,8 @@ "nkro": true }, "matrix_pins": { - "cols": [ "GP13", "GP26", "GP22", "GP21", "GP23", "GP20" ], - "rows": [ "GP5", "GP27", "GP28", "GP29", "GP7" ] + "cols": ["GP13", "GP26", "GP22", "GP21", "GP23", "GP20"], + "rows": ["GP5", "GP27", "GP28", "GP29", "GP7"] }, "processor": "RP2040", "split": { @@ -25,8 +25,8 @@ }, "transport": { "sync": { - "matrix_state": true, - "layer_state": true + "layer_state": true, + "matrix_state": true } } }, @@ -42,69 +42,60 @@ "layouts": { "LAYOUT_4x6": { "layout": [ - { "matrix": [ 0, 0 ], "x": 0, "y": 1 }, - { "matrix": [ 0, 1 ], "x": 1, "y": 1 }, - { "matrix": [ 0, 2 ], "x": 2, "y": 0.5 }, - { "matrix": [ 0, 3 ], "x": 3, "y": 0 }, - { "matrix": [ 0, 4 ], "x": 4, "y": 0.25 }, - { "matrix": [ 0, 5 ], "x": 5, "y": 0.5 }, - - { "matrix": [ 5, 5 ], "x": 8.25, "y": 0.5 }, - { "matrix": [ 5, 4 ], "x": 9.25, "y": 0.25 }, - { "matrix": [ 5, 3 ], "x": 10.25, "y": 0 }, - { "matrix": [ 5, 2 ], "x": 11.25, "y": 0.5 }, - { "matrix": [ 5, 1 ], "x": 12.25, "y": 1 }, - { "matrix": [ 5, 0 ], "x": 13.25, "y": 1 }, - - { "matrix": [ 1, 0 ], "x": 0, "y": 2 }, - { "matrix": [ 1, 1 ], "x": 1, "y": 2 }, - { "matrix": [ 1, 2 ], "x": 2, "y": 1.5 }, - { "matrix": [ 1, 3 ], "x": 3, "y": 1 }, - { "matrix": [ 1, 4 ], "x": 4, "y": 1.25 }, - { "matrix": [ 1, 5 ], "x": 5, "y": 1.5 }, - - { "matrix": [ 6, 5 ], "x": 8.25, "y": 1.5 }, - { "matrix": [ 6, 4 ], "x": 9.25, "y": 1.25 }, - { "matrix": [ 6, 3 ], "x": 10.25, "y": 1 }, - { "matrix": [ 6, 2 ], "x": 11.25, "y": 1.5 }, - { "matrix": [ 6, 1 ], "x": 12.25, "y": 2 }, - { "matrix": [ 6, 0 ], "x": 13.25, "y": 2 }, - - { "matrix": [ 2, 0 ], "x": 0, "y": 3 }, - { "matrix": [ 2, 1 ], "x": 1, "y": 3 }, - { "matrix": [ 2, 2 ], "x": 2, "y": 2.5 }, - { "matrix": [ 2, 3 ], "x": 3, "y": 2 }, - { "matrix": [ 2, 4 ], "x": 4, "y": 2.25 }, - { "matrix": [ 2, 5 ], "x": 5, "y": 2.5 }, - - { "matrix": [ 7, 5 ], "x": 8.25, "y": 2.5 }, - { "matrix": [ 7, 4 ], "x": 9.25, "y": 2.25 }, - { "matrix": [ 7, 3 ], "x": 10.25, "y": 2 }, - { "matrix": [ 7, 2 ], "x": 11.25, "y": 2.5 }, - { "matrix": [ 7, 1 ], "x": 12.25, "y": 3 }, - { "matrix": [ 7, 0 ], "x": 13.25, "y": 3 }, - - { "matrix": [ 3, 0 ], "x": 0, "y": 4 }, - { "matrix": [ 3, 1 ], "x": 1, "y": 4 }, - { "matrix": [ 3, 2 ], "x": 2, "y": 3.5 }, - { "matrix": [ 3, 3 ], "x": 3, "y": 3 }, - { "matrix": [ 3, 4 ], "x": 4, "y": 3.25 }, - { "matrix": [ 3, 5 ], "x": 5, "y": 3.5 }, - - { "matrix": [ 8, 5 ], "x": 8.25, "y": 3.5 }, - { "matrix": [ 8, 4 ], "x": 9.25, "y": 3.25 }, - { "matrix": [ 8, 3 ], "x": 10.25, "y": 3 }, - { "matrix": [ 8, 2 ], "x": 11.25, "y": 3.5 }, - { "matrix": [ 8, 1 ], "x": 12.25, "y": 4 }, - { "matrix": [ 8, 0 ], "x": 13.25, "y": 4 }, - - { "matrix": [ 4, 3 ], "x": 3, "y": 5.25 }, - { "matrix": [ 4, 4 ], "x": 4, "y": 5.25 }, - { "matrix": [ 4, 5 ], "x": 5, "y": 5.25 }, - - { "matrix": [ 9, 5 ], "x": 8.25, "y": 5.25 }, - { "matrix": [ 9, 4 ], "x": 9.25, "y": 5.25 }, - { "matrix": [ 9, 3 ], "x": 10.25, "y": 5.25 } + {"matrix": [0, 0], "x": 0, "y": 1}, + {"matrix": [0, 1], "x": 1, "y": 1}, + {"matrix": [0, 2], "x": 2, "y": 0.5}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0.25}, + {"matrix": [0, 5], "x": 5, "y": 0.5}, + {"matrix": [5, 5], "x": 8.25, "y": 0.5}, + {"matrix": [5, 4], "x": 9.25, "y": 0.25}, + {"matrix": [5, 3], "x": 10.25, "y": 0}, + {"matrix": [5, 2], "x": 11.25, "y": 0.5}, + {"matrix": [5, 1], "x": 12.25, "y": 1}, + {"matrix": [5, 0], "x": 13.25, "y": 1}, + {"matrix": [1, 0], "x": 0, "y": 2}, + {"matrix": [1, 1], "x": 1, "y": 2}, + {"matrix": [1, 2], "x": 2, "y": 1.5}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1.25}, + {"matrix": [1, 5], "x": 5, "y": 1.5}, + {"matrix": [6, 5], "x": 8.25, "y": 1.5}, + {"matrix": [6, 4], "x": 9.25, "y": 1.25}, + {"matrix": [6, 3], "x": 10.25, "y": 1}, + {"matrix": [6, 2], "x": 11.25, "y": 1.5}, + {"matrix": [6, 1], "x": 12.25, "y": 2}, + {"matrix": [6, 0], "x": 13.25, "y": 2}, + {"matrix": [2, 0], "x": 0, "y": 3}, + {"matrix": [2, 1], "x": 1, "y": 3}, + {"matrix": [2, 2], "x": 2, "y": 2.5}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2.25}, + {"matrix": [2, 5], "x": 5, "y": 2.5}, + {"matrix": [7, 5], "x": 8.25, "y": 2.5}, + {"matrix": [7, 4], "x": 9.25, "y": 2.25}, + {"matrix": [7, 3], "x": 10.25, "y": 2}, + {"matrix": [7, 2], "x": 11.25, "y": 2.5}, + {"matrix": [7, 1], "x": 12.25, "y": 3}, + {"matrix": [7, 0], "x": 13.25, "y": 3}, + {"matrix": [3, 0], "x": 0, "y": 4}, + {"matrix": [3, 1], "x": 1, "y": 4}, + {"matrix": [3, 2], "x": 2, "y": 3.5}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [3, 4], "x": 4, "y": 3.25}, + {"matrix": [3, 5], "x": 5, "y": 3.5}, + {"matrix": [8, 5], "x": 8.25, "y": 3.5}, + {"matrix": [8, 4], "x": 9.25, "y": 3.25}, + {"matrix": [8, 3], "x": 10.25, "y": 3}, + {"matrix": [8, 2], "x": 11.25, "y": 3.5}, + {"matrix": [8, 1], "x": 12.25, "y": 4}, + {"matrix": [8, 0], "x": 13.25, "y": 4}, + {"matrix": [4, 3], "x": 3, "y": 5.25}, + {"matrix": [4, 4], "x": 4, "y": 5.25}, + {"matrix": [4, 5], "x": 5, "y": 5.25}, + {"matrix": [9, 5], "x": 8.25, "y": 5.25}, + {"matrix": [9, 4], "x": 9.25, "y": 5.25}, + {"matrix": [9, 3], "x": 10.25, "y": 5.25} ] } } From d0d669a0b59efddca2a383dff6d8ab45c6caea40 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 01:01:58 -0500 Subject: [PATCH 22/48] Adding pristine defaults. --- .../gggw/crosses/3x5/keymaps/default/keymap.c | 337 +---------------- .../gggw/crosses/3x5/keymaps/stock/keymap.c | 338 ++++++++++++++++++ .../3x5/keymaps/{default => stock}/rules.mk | 0 .../gggw/crosses/3x6/keymaps/default/keymap.c | 309 +--------------- .../gggw/crosses/3x6/keymaps/stock/keymap.c | 311 ++++++++++++++++ .../3x6/keymaps/{default => stock}/rules.mk | 0 .../gggw/crosses/4x6/keymaps/default/keymap.c | 229 +----------- .../gggw/crosses/4x6/keymaps/stock/keymap.c | 225 ++++++++++++ .../4x6/keymaps/{default => stock}/rules.mk | 0 9 files changed, 898 insertions(+), 851 deletions(-) create mode 100644 keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c rename keyboards/gggw/crosses/3x5/keymaps/{default => stock}/rules.mk (100%) create mode 100644 keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c rename keyboards/gggw/crosses/3x6/keymaps/{default => stock}/rules.mk (100%) create mode 100644 keyboards/gggw/crosses/4x6/keymaps/stock/keymap.c rename keyboards/gggw/crosses/4x6/keymaps/{default => stock}/rules.mk (100%) diff --git a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c index 52acd596d0f..919abd68907 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c @@ -3,336 +3,11 @@ #include QMK_KEYBOARD_H -#include "lib/achordion.h" -#include "lib/crosses.h" - -/* - * Keycodes, combos, and layers! oh my! - */ - -enum CROSSES_LAYERS { - _BASE, - _NUM, - _NAV, - _MEDIA, - _FUNC, - _MOUS, -}; - -enum my_keycodes { - VIMS = SAFE_RANGE, - LARR, - FARR, - EPIP, - LVBC, - RVBC, - BARR, - MSE_INC, - MSE_DEC, - DRAG_SCROLL, - MSE_TOGG, -}; - -enum combos { - WY_TAB, - DH_CAPS, - HCOMA_MINS, - WSPC_VIM, - FU_QUOTE, - PL_DQUOTE, - CCOM_LARR, - XDOT_FARR, - GM_EPIP, - COMD_UNDERS, - ZDOT_BARR, -}; - -const uint16_t PROGMEM wy_combo[] = {KC_W, KC_Y, COMBO_END}; -const uint16_t PROGMEM dh_combo[] = {KC_D, KC_H, COMBO_END}; -const uint16_t PROGMEM hcomma_combo[] = {KC_H, KC_COMM, COMBO_END}; -const uint16_t PROGMEM wspc_combo[] = {KC_W, KC_SPC, COMBO_END}; -const uint16_t PROGMEM fu_combo[] = {KC_F, KC_U, COMBO_END}; -const uint16_t PROGMEM pl_combo[] = {KC_P, KC_L, COMBO_END}; -const uint16_t PROGMEM ccom_combo[] = {KC_C, KC_COMM, COMBO_END}; -const uint16_t PROGMEM xdot_combo[] = {KC_X, KC_DOT, COMBO_END}; -const uint16_t PROGMEM gm_combo[] = {KC_G, KC_M, COMBO_END}; -const uint16_t PROGMEM comd_combo[] = {KC_COMM, KC_DOT, COMBO_END}; -const uint16_t PROGMEM zdot_combo[] = {KC_Z, KC_DOT, COMBO_END}; - -// clang-format off -// -combo_t key_combos[] = { - [WY_TAB] = COMBO(wy_combo, KC_TAB), - [DH_CAPS] = COMBO(dh_combo, CW_TOGG), - [HCOMA_MINS] = COMBO(hcomma_combo, KC_MINS), - [WSPC_VIM] = COMBO(wspc_combo, VIMS), - [FU_QUOTE] = COMBO(fu_combo, KC_QUOT), - [PL_DQUOTE] = COMBO(pl_combo, S(KC_QUOT)), - [CCOM_LARR] = COMBO(ccom_combo, LARR), - [XDOT_FARR] = COMBO(xdot_combo, FARR), - [GM_EPIP] = COMBO(gm_combo, EPIP), - [COMD_UNDERS] = COMBO(comd_combo, S(KC_MINS)), - [ZDOT_BARR] = COMBO(zdot_combo, BARR), -}; - -/* - * Keymaps! - */ - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -// ┌───────────┬───────────┬───────────┬───────────┬────────────┐ ┌──────┬────────────┬───────────┬───────────┬───────────┐ -// │ q │ w │ f │ p │ b │ │ j │ l │ u │ y │ ; │ -// ├───────────┼───────────┼───────────┼───────────┼────────────┤ ├──────┼────────────┼───────────┼───────────┼───────────┤ -// │ LGUI_T(a) │ LALT_T(r) │ LCTL_T(s) │ LSFT_T(t) │ g │ │ m │ RSFT_T(n) │ RCTL_T(e) │ RALT_T(i) │ RGUI_T(o) │ -// ├───────────┼───────────┼───────────┼───────────┼────────────┤ ├──────┼────────────┼───────────┼───────────┼───────────┤ -// │ z │ x │ c │ d │ v │ │ k │ h │ , │ . │ LT(3, /) │ -// └───────────┴───────────┴───────────┼───────────┼────────────┼─────┐ ┌────────────┼──────┼────────────┼───────────┴───────────┴───────────┘ -// │ MO(5) │ LT(2, esc) │ spc │ │ LT(1, ent) │ bspc │ LT(4, del) │ -// └───────────┴────────────┴─────┘ └────────────┴──────┴────────────┘ -[_BASE] = LAYOUT_default( - KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , - LGUI_T(KC_A) , LALT_T(KC_R) , LCTL_T(KC_S) , LSFT_T(KC_T) , KC_G , KC_M , RSFT_T(KC_N) , RCTL_T(KC_E) , RALT_T(KC_I) , RGUI_T(KC_O) , - KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , LT(3, KC_SLSH), - MO(5) , LT(2, KC_ESC) , KC_SPC , LT(1, KC_ENT) , KC_BSPC , LT(4, KC_DEL) -), - -// ┌──────┬───┬───┬───────────┬──────┐ ┌──────┬───────────┬───────────┬──────┬─────┐ -// │ S(8) │ 7 │ 8 │ 9 │ / │ │ \ │ S(9) │ S(0) │ S(\) │ │ -// ├──────┼───┼───┼───────────┼──────┤ ├──────┼───────────┼───────────┼──────┼─────┤ -// │ - │ 4 │ 5 │ LSFT_T(6) │ S(=) │ │ S(5) │ RSFT_T([) │ RCTL_T(]) │ S(;) │ ; │ -// ├──────┼───┼───┼───────────┼──────┤ ├──────┼───────────┼───────────┼──────┼─────┤ -// │ ` │ 1 │ 2 │ 3 │ = │ │ [ │ ] │ │ │ │ -// └──────┴───┴───┼───────────┼──────┼─────┐ ┌─────┼──────┼───────────┼───────────┴──────┴─────┘ -// │ │ 0 │ │ │ │ │ │ -// └───────────┴──────┴─────┘ └─────┴──────┴───────────┘ -[_NUM] = LAYOUT_default( - S(KC_8) , KC_7 , KC_8 , KC_9 , KC_SLSH , KC_BSLS , S(KC_9) , S(KC_0) , S(KC_BSLS) , KC_TRNS, - KC_MINS , KC_4 , KC_5 , LSFT_T(KC_6) , S(KC_EQL) , S(KC_5) , RSFT_T(KC_LBRC) , RCTL_T(KC_RBRC) , S(KC_SCLN) , KC_SCLN, - KC_GRV , KC_1 , KC_2 , KC_3 , KC_EQL , KC_LBRC , KC_RBRC , KC_TRNS , KC_TRNS , KC_TRNS, - KC_TRNS , KC_0 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS -), - -// ┌──────┬──────┬──────┬───────┬────┐ ┌────┬──────┬──────┬──────┬──────┐ -// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ -// ├──────┼──────┼──────┼───────┼────┤ ├────┼──────┼──────┼──────┼──────┤ -// │ lgui │ lalt │ lctl │ lsft │ no │ │ no │ left │ down │ up │ rght │ -// ├──────┼──────┼──────┼───────┼────┤ ├────┼──────┼──────┼──────┼──────┤ -// │ no │ no │ copy │ paste │ no │ │ no │ home │ end │ pgdn │ pgup │ -// └──────┴──────┴──────┼───────┼────┼────┐ ┌────┼────┼──────┼──────┴──────┴──────┘ -// │ no │ no │ no │ │ no │ no │ no │ -// └───────┴────┴────┘ └────┴────┴──────┘ -[_NAV] = LAYOUT_default( - KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , - KC_LGUI , KC_LALT , KC_LCTL , KC_LSFT , KC_NO , KC_NO , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT, - KC_NO , KC_NO , KC_COPY , KC_PSTE , KC_NO , KC_NO , KC_HOME , KC_END , KC_PGDN , KC_PGUP, - KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO -), - -// ┌──────┬──────┬──────┬──────┬──────┐ ┌────┬────┬────┬────┬────┐ -// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ -// ├──────┼──────┼──────┼──────┼──────┤ ├────┼────┼────┼────┼────┤ -// │ mprv │ vold │ mply │ volu │ mnxt │ │ no │ no │ no │ no │ no │ -// ├──────┼──────┼──────┼──────┼──────┤ ├────┼────┼────┼────┼────┤ -// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ -// └──────┴──────┴──────┼──────┼──────┼────┐ ┌────┼────┼────┼────┴────┴────┘ -// │ no │ no │ no │ │ no │ no │ no │ -// └──────┴──────┴────┘ └────┴────┴────┘ -[_MEDIA] = LAYOUT_default( - KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, - KC_MPRV , KC_VOLD , KC_MPLY , KC_VOLU , KC_MNXT , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, - KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, - KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO -), - -// ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬──────┬──────┬──────┬──────┐ -// │ f11 │ f12 │ f13 │ f14 │ f15 │ │ │ │ │ │ │ -// ├─────┼─────┼─────┼─────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ -// │ f6 │ f7 │ f8 │ f9 │ f10 │ │ │ rsft │ rctl │ ralt │ rgui │ -// ├─────┼─────┼─────┼─────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ -// │ f1 │ f2 │ f3 │ f4 │ f5 │ │ │ │ │ │ │ -// └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼──────┼──────┴──────┴──────┘ -// │ │ │ │ │ │ │ │ -// └─────┴─────┴─────┘ └─────┴─────┴──────┘ -[_FUNC] = LAYOUT_default( - KC_F11 , KC_F12 , KC_F13 , KC_F14 , KC_F15 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, - KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_TRNS , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, - KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS -), - -// ┌──────┬─────────┬─────────┬─────────────┬────┐ ┌────────┬─────────┬─────────┬──────────┬─────────┐ -// │ lsft │ lalt │ no │ no │ no │ │ EE_CLR │ MSE_INC │ MSE_DEC │ no │ no │ -// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼──────────┼─────────┤ -// │ lctl │ MS_BTN3 │ MS_BTN2 │ MS_BTN1 │ no │ │ no │ rsft │ rctl │ ralt │ rgui │ -// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼──────────┼─────────┤ -// │ lgui │ no │ no │ DRAG_SCROLL │ no │ │ no │ no │ no │ MSE_TOGG │ DB_TOGG │ -// └──────┴─────────┴─────────┼─────────────┼────┼────┐ ┌────┼────────┼─────────┼─────────┴──────────┴─────────┘ -// │ │ no │ no │ │ no │ no │ no │ -// └─────────────┴────┴────┘ └────┴────────┴─────────┘ -[_MOUS] = LAYOUT_default( - KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , EE_CLR , MSE_INC , MSE_DEC , KC_NO , KC_NO , - KC_NO , MS_BTN3 , MS_BTN2 , MS_BTN1 , KC_NO , KC_NO , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, - KC_NO , KC_NO , KC_NO , DRAG_SCROLL , KC_NO , KC_NO , KC_NO , KC_NO , MSE_TOGG , DB_TOGG, - KC_TRNS , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO -) + [0] = LAYOUT_default( + KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , + KC_A , KC_R , KC_S , KC_T , KC_G , KC_M , KC_N , KC_E , KC_I , KC_O , + KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , KC_SLSH , + XXXXXXX , KC_ESC , KC_SPC , KC_ENT, KC_BSPC , KC_DEL + ) }; - -// clang-format on - -bool process_record_user(uint16_t keycode, keyrecord_t* record) { - if (!process_achordion(keycode, record)) { - return false; - } - switch (keycode) { - case RSFT_T(KC_LBRC): - if (record->tap.count && record->event.pressed) { - tap_code16(S(KC_LBRC)); - return false; - } - break; - - case RCTL_T(KC_RBRC): - if (record->tap.count && record->event.pressed) { - tap_code16(S(KC_RBRC)); - return false; - } - break; - - case VIMS: - if (record->event.pressed) { - tap_code16(KC_ESC); - SEND_STRING(":w\n"); - - return false; - } - break; - - case EPIP: - if (record->event.pressed) { - SEND_STRING("|> "); - - return false; - } - break; - - case LARR: - if (record->event.pressed) { - SEND_STRING("-> "); - - return false; - } - break; - - case FARR: - if (record->event.pressed) { - SEND_STRING("=> "); - - return false; - } - break; - - case BARR: - if (record->event.pressed) { - SEND_STRING("<- "); - - return false; - } - break; - case MSE_INC: - if (record->event.pressed) { -#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT) - change_pointer_dpi(&global_user_config, true); -#endif /* ifdef POINTING_DEVICE */ - debug_config_to_console(&global_user_config); - - return false; - } - break; - case MSE_DEC: - if (record->event.pressed) { - change_pointer_dpi(&global_user_config, false); - debug_config_to_console(&global_user_config); - - return false; - } - break; - case MSE_TOGG: - if (record->event.pressed) { -#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT) - bool current_state = get_auto_mouse_enable(); - set_auto_mouse_enable(!current_state); -#endif /* ifdef POINTING_DEVICE */ - - return false; - } - break; - case DRAG_SCROLL: - set_scrolling = record->event.pressed; - break; - } - - return true; -} - -bool achordion_chord(uint16_t tap_hold_keycode, keyrecord_t* tap_hold_record, uint16_t other_keycode, keyrecord_t* other_record) { - switch (tap_hold_keycode) { - case 0x4128: - return true; - break; - } - - return achordion_opposite_hands(tap_hold_record, other_record); -} - -void matrix_scan_user(void) { - achordion_task(); -} - -#ifdef OLED_ENABLE - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (!is_keyboard_master()) { - return OLED_ROTATION_180; - } - - return rotation; -} - -static void render_logo(void) { - static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; - - oled_write_P(qmk_logo, false); -} - -bool oled_task_user(void) { - render_logo(); - - // clang-format off - const char* layer_names[] = { - [_BASE] = "BASE CPI: ", - [_NUM] = "PROG CPI: ", - [_NAV] = "NAVI CPI: ", - [_MEDIA] = "MEDIA CPI: ", - [_FUNC] = "FUNC CPI: ", - [_MOUS] = "MOUSE CPI: ", - }; - // clang-format on - - char cpi_str[6]; - uint16_t current_dpi = get_pointer_dpi(&global_user_config); - - snprintf(cpi_str, sizeof(cpi_str), "%u", (unsigned int)current_dpi); - - oled_write(PSTR(layer_names[get_highest_layer(layer_state)]), false); - oled_write(cpi_str, false); - - return false; -} -#endif /* ifdef OLED_ENABLE */ - -#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT) -void pointing_device_init_user(void) { - set_auto_mouse_layer(_MOUS); - set_auto_mouse_enable(false); -} -#endif /* ifdef POINTING_DEVICE */ diff --git a/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c new file mode 100644 index 00000000000..52acd596d0f --- /dev/null +++ b/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c @@ -0,0 +1,338 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +#include "lib/achordion.h" +#include "lib/crosses.h" + +/* + * Keycodes, combos, and layers! oh my! + */ + +enum CROSSES_LAYERS { + _BASE, + _NUM, + _NAV, + _MEDIA, + _FUNC, + _MOUS, +}; + +enum my_keycodes { + VIMS = SAFE_RANGE, + LARR, + FARR, + EPIP, + LVBC, + RVBC, + BARR, + MSE_INC, + MSE_DEC, + DRAG_SCROLL, + MSE_TOGG, +}; + +enum combos { + WY_TAB, + DH_CAPS, + HCOMA_MINS, + WSPC_VIM, + FU_QUOTE, + PL_DQUOTE, + CCOM_LARR, + XDOT_FARR, + GM_EPIP, + COMD_UNDERS, + ZDOT_BARR, +}; + +const uint16_t PROGMEM wy_combo[] = {KC_W, KC_Y, COMBO_END}; +const uint16_t PROGMEM dh_combo[] = {KC_D, KC_H, COMBO_END}; +const uint16_t PROGMEM hcomma_combo[] = {KC_H, KC_COMM, COMBO_END}; +const uint16_t PROGMEM wspc_combo[] = {KC_W, KC_SPC, COMBO_END}; +const uint16_t PROGMEM fu_combo[] = {KC_F, KC_U, COMBO_END}; +const uint16_t PROGMEM pl_combo[] = {KC_P, KC_L, COMBO_END}; +const uint16_t PROGMEM ccom_combo[] = {KC_C, KC_COMM, COMBO_END}; +const uint16_t PROGMEM xdot_combo[] = {KC_X, KC_DOT, COMBO_END}; +const uint16_t PROGMEM gm_combo[] = {KC_G, KC_M, COMBO_END}; +const uint16_t PROGMEM comd_combo[] = {KC_COMM, KC_DOT, COMBO_END}; +const uint16_t PROGMEM zdot_combo[] = {KC_Z, KC_DOT, COMBO_END}; + +// clang-format off +// +combo_t key_combos[] = { + [WY_TAB] = COMBO(wy_combo, KC_TAB), + [DH_CAPS] = COMBO(dh_combo, CW_TOGG), + [HCOMA_MINS] = COMBO(hcomma_combo, KC_MINS), + [WSPC_VIM] = COMBO(wspc_combo, VIMS), + [FU_QUOTE] = COMBO(fu_combo, KC_QUOT), + [PL_DQUOTE] = COMBO(pl_combo, S(KC_QUOT)), + [CCOM_LARR] = COMBO(ccom_combo, LARR), + [XDOT_FARR] = COMBO(xdot_combo, FARR), + [GM_EPIP] = COMBO(gm_combo, EPIP), + [COMD_UNDERS] = COMBO(comd_combo, S(KC_MINS)), + [ZDOT_BARR] = COMBO(zdot_combo, BARR), +}; + +/* + * Keymaps! + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// ┌───────────┬───────────┬───────────┬───────────┬────────────┐ ┌──────┬────────────┬───────────┬───────────┬───────────┐ +// │ q │ w │ f │ p │ b │ │ j │ l │ u │ y │ ; │ +// ├───────────┼───────────┼───────────┼───────────┼────────────┤ ├──────┼────────────┼───────────┼───────────┼───────────┤ +// │ LGUI_T(a) │ LALT_T(r) │ LCTL_T(s) │ LSFT_T(t) │ g │ │ m │ RSFT_T(n) │ RCTL_T(e) │ RALT_T(i) │ RGUI_T(o) │ +// ├───────────┼───────────┼───────────┼───────────┼────────────┤ ├──────┼────────────┼───────────┼───────────┼───────────┤ +// │ z │ x │ c │ d │ v │ │ k │ h │ , │ . │ LT(3, /) │ +// └───────────┴───────────┴───────────┼───────────┼────────────┼─────┐ ┌────────────┼──────┼────────────┼───────────┴───────────┴───────────┘ +// │ MO(5) │ LT(2, esc) │ spc │ │ LT(1, ent) │ bspc │ LT(4, del) │ +// └───────────┴────────────┴─────┘ └────────────┴──────┴────────────┘ +[_BASE] = LAYOUT_default( + KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , + LGUI_T(KC_A) , LALT_T(KC_R) , LCTL_T(KC_S) , LSFT_T(KC_T) , KC_G , KC_M , RSFT_T(KC_N) , RCTL_T(KC_E) , RALT_T(KC_I) , RGUI_T(KC_O) , + KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , LT(3, KC_SLSH), + MO(5) , LT(2, KC_ESC) , KC_SPC , LT(1, KC_ENT) , KC_BSPC , LT(4, KC_DEL) +), + +// ┌──────┬───┬───┬───────────┬──────┐ ┌──────┬───────────┬───────────┬──────┬─────┐ +// │ S(8) │ 7 │ 8 │ 9 │ / │ │ \ │ S(9) │ S(0) │ S(\) │ │ +// ├──────┼───┼───┼───────────┼──────┤ ├──────┼───────────┼───────────┼──────┼─────┤ +// │ - │ 4 │ 5 │ LSFT_T(6) │ S(=) │ │ S(5) │ RSFT_T([) │ RCTL_T(]) │ S(;) │ ; │ +// ├──────┼───┼───┼───────────┼──────┤ ├──────┼───────────┼───────────┼──────┼─────┤ +// │ ` │ 1 │ 2 │ 3 │ = │ │ [ │ ] │ │ │ │ +// └──────┴───┴───┼───────────┼──────┼─────┐ ┌─────┼──────┼───────────┼───────────┴──────┴─────┘ +// │ │ 0 │ │ │ │ │ │ +// └───────────┴──────┴─────┘ └─────┴──────┴───────────┘ +[_NUM] = LAYOUT_default( + S(KC_8) , KC_7 , KC_8 , KC_9 , KC_SLSH , KC_BSLS , S(KC_9) , S(KC_0) , S(KC_BSLS) , KC_TRNS, + KC_MINS , KC_4 , KC_5 , LSFT_T(KC_6) , S(KC_EQL) , S(KC_5) , RSFT_T(KC_LBRC) , RCTL_T(KC_RBRC) , S(KC_SCLN) , KC_SCLN, + KC_GRV , KC_1 , KC_2 , KC_3 , KC_EQL , KC_LBRC , KC_RBRC , KC_TRNS , KC_TRNS , KC_TRNS, + KC_TRNS , KC_0 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS +), + +// ┌──────┬──────┬──────┬───────┬────┐ ┌────┬──────┬──────┬──────┬──────┐ +// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ +// ├──────┼──────┼──────┼───────┼────┤ ├────┼──────┼──────┼──────┼──────┤ +// │ lgui │ lalt │ lctl │ lsft │ no │ │ no │ left │ down │ up │ rght │ +// ├──────┼──────┼──────┼───────┼────┤ ├────┼──────┼──────┼──────┼──────┤ +// │ no │ no │ copy │ paste │ no │ │ no │ home │ end │ pgdn │ pgup │ +// └──────┴──────┴──────┼───────┼────┼────┐ ┌────┼────┼──────┼──────┴──────┴──────┘ +// │ no │ no │ no │ │ no │ no │ no │ +// └───────┴────┴────┘ └────┴────┴──────┘ +[_NAV] = LAYOUT_default( + KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , + KC_LGUI , KC_LALT , KC_LCTL , KC_LSFT , KC_NO , KC_NO , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT, + KC_NO , KC_NO , KC_COPY , KC_PSTE , KC_NO , KC_NO , KC_HOME , KC_END , KC_PGDN , KC_PGUP, + KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO +), + +// ┌──────┬──────┬──────┬──────┬──────┐ ┌────┬────┬────┬────┬────┐ +// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ +// ├──────┼──────┼──────┼──────┼──────┤ ├────┼────┼────┼────┼────┤ +// │ mprv │ vold │ mply │ volu │ mnxt │ │ no │ no │ no │ no │ no │ +// ├──────┼──────┼──────┼──────┼──────┤ ├────┼────┼────┼────┼────┤ +// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ +// └──────┴──────┴──────┼──────┼──────┼────┐ ┌────┼────┼────┼────┴────┴────┘ +// │ no │ no │ no │ │ no │ no │ no │ +// └──────┴──────┴────┘ └────┴────┴────┘ +[_MEDIA] = LAYOUT_default( + KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, + KC_MPRV , KC_VOLD , KC_MPLY , KC_VOLU , KC_MNXT , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, + KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, + KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO +), + +// ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬──────┬──────┬──────┬──────┐ +// │ f11 │ f12 │ f13 │ f14 │ f15 │ │ │ │ │ │ │ +// ├─────┼─────┼─────┼─────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ +// │ f6 │ f7 │ f8 │ f9 │ f10 │ │ │ rsft │ rctl │ ralt │ rgui │ +// ├─────┼─────┼─────┼─────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ +// │ f1 │ f2 │ f3 │ f4 │ f5 │ │ │ │ │ │ │ +// └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼──────┼──────┴──────┴──────┘ +// │ │ │ │ │ │ │ │ +// └─────┴─────┴─────┘ └─────┴─────┴──────┘ +[_FUNC] = LAYOUT_default( + KC_F11 , KC_F12 , KC_F13 , KC_F14 , KC_F15 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, + KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_TRNS , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, + KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS +), + +// ┌──────┬─────────┬─────────┬─────────────┬────┐ ┌────────┬─────────┬─────────┬──────────┬─────────┐ +// │ lsft │ lalt │ no │ no │ no │ │ EE_CLR │ MSE_INC │ MSE_DEC │ no │ no │ +// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼──────────┼─────────┤ +// │ lctl │ MS_BTN3 │ MS_BTN2 │ MS_BTN1 │ no │ │ no │ rsft │ rctl │ ralt │ rgui │ +// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼──────────┼─────────┤ +// │ lgui │ no │ no │ DRAG_SCROLL │ no │ │ no │ no │ no │ MSE_TOGG │ DB_TOGG │ +// └──────┴─────────┴─────────┼─────────────┼────┼────┐ ┌────┼────────┼─────────┼─────────┴──────────┴─────────┘ +// │ │ no │ no │ │ no │ no │ no │ +// └─────────────┴────┴────┘ └────┴────────┴─────────┘ +[_MOUS] = LAYOUT_default( + KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , EE_CLR , MSE_INC , MSE_DEC , KC_NO , KC_NO , + KC_NO , MS_BTN3 , MS_BTN2 , MS_BTN1 , KC_NO , KC_NO , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, + KC_NO , KC_NO , KC_NO , DRAG_SCROLL , KC_NO , KC_NO , KC_NO , KC_NO , MSE_TOGG , DB_TOGG, + KC_TRNS , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO +) +}; + +// clang-format on + +bool process_record_user(uint16_t keycode, keyrecord_t* record) { + if (!process_achordion(keycode, record)) { + return false; + } + switch (keycode) { + case RSFT_T(KC_LBRC): + if (record->tap.count && record->event.pressed) { + tap_code16(S(KC_LBRC)); + return false; + } + break; + + case RCTL_T(KC_RBRC): + if (record->tap.count && record->event.pressed) { + tap_code16(S(KC_RBRC)); + return false; + } + break; + + case VIMS: + if (record->event.pressed) { + tap_code16(KC_ESC); + SEND_STRING(":w\n"); + + return false; + } + break; + + case EPIP: + if (record->event.pressed) { + SEND_STRING("|> "); + + return false; + } + break; + + case LARR: + if (record->event.pressed) { + SEND_STRING("-> "); + + return false; + } + break; + + case FARR: + if (record->event.pressed) { + SEND_STRING("=> "); + + return false; + } + break; + + case BARR: + if (record->event.pressed) { + SEND_STRING("<- "); + + return false; + } + break; + case MSE_INC: + if (record->event.pressed) { +#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT) + change_pointer_dpi(&global_user_config, true); +#endif /* ifdef POINTING_DEVICE */ + debug_config_to_console(&global_user_config); + + return false; + } + break; + case MSE_DEC: + if (record->event.pressed) { + change_pointer_dpi(&global_user_config, false); + debug_config_to_console(&global_user_config); + + return false; + } + break; + case MSE_TOGG: + if (record->event.pressed) { +#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT) + bool current_state = get_auto_mouse_enable(); + set_auto_mouse_enable(!current_state); +#endif /* ifdef POINTING_DEVICE */ + + return false; + } + break; + case DRAG_SCROLL: + set_scrolling = record->event.pressed; + break; + } + + return true; +} + +bool achordion_chord(uint16_t tap_hold_keycode, keyrecord_t* tap_hold_record, uint16_t other_keycode, keyrecord_t* other_record) { + switch (tap_hold_keycode) { + case 0x4128: + return true; + break; + } + + return achordion_opposite_hands(tap_hold_record, other_record); +} + +void matrix_scan_user(void) { + achordion_task(); +} + +#ifdef OLED_ENABLE + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (!is_keyboard_master()) { + return OLED_ROTATION_180; + } + + return rotation; +} + +static void render_logo(void) { + static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; + + oled_write_P(qmk_logo, false); +} + +bool oled_task_user(void) { + render_logo(); + + // clang-format off + const char* layer_names[] = { + [_BASE] = "BASE CPI: ", + [_NUM] = "PROG CPI: ", + [_NAV] = "NAVI CPI: ", + [_MEDIA] = "MEDIA CPI: ", + [_FUNC] = "FUNC CPI: ", + [_MOUS] = "MOUSE CPI: ", + }; + // clang-format on + + char cpi_str[6]; + uint16_t current_dpi = get_pointer_dpi(&global_user_config); + + snprintf(cpi_str, sizeof(cpi_str), "%u", (unsigned int)current_dpi); + + oled_write(PSTR(layer_names[get_highest_layer(layer_state)]), false); + oled_write(cpi_str, false); + + return false; +} +#endif /* ifdef OLED_ENABLE */ + +#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT) +void pointing_device_init_user(void) { + set_auto_mouse_layer(_MOUS); + set_auto_mouse_enable(false); +} +#endif /* ifdef POINTING_DEVICE */ diff --git a/keyboards/gggw/crosses/3x5/keymaps/default/rules.mk b/keyboards/gggw/crosses/3x5/keymaps/stock/rules.mk similarity index 100% rename from keyboards/gggw/crosses/3x5/keymaps/default/rules.mk rename to keyboards/gggw/crosses/3x5/keymaps/stock/rules.mk diff --git a/keyboards/gggw/crosses/3x6/keymaps/default/keymap.c b/keyboards/gggw/crosses/3x6/keymaps/default/keymap.c index 55b913591c9..7a3bbc38e58 100644 --- a/keyboards/gggw/crosses/3x6/keymaps/default/keymap.c +++ b/keyboards/gggw/crosses/3x6/keymaps/default/keymap.c @@ -1,311 +1,14 @@ // Copyright 2023 QMK // SPDX-License-Identifier: GPL-2.0-or-later -#include "action_layer.h" #include QMK_KEYBOARD_H -#include "lib/achordion.h" -#include "lib/crosses.h" - -/* - * Keycodes, combos, and layers! oh my! - */ - -enum CROSSES_LAYERS { - _BASE, - _NUM, - _NAV, - _MEDIA, - _FUNC, - _MOUS, -}; - -enum my_keycodes { - VIMS = SAFE_RANGE, - LARR, - FARR, - EPIP, - LVBC, - RVBC, - BARR, - MSE_INC, - MSE_DEC, - DRAG_SCROLL, -}; - -enum combos { - WY_TAB, - DH_CAPS, - HCOMA_MINS, - WSPC_VIM, - FU_QUOTE, - PL_DQUOTE, - CCOM_LARR, - XDOT_FARR, - GM_EPIP, - COMD_UNDERS, - ZDOT_BARR, -}; - -const uint16_t PROGMEM wy_combo[] = {KC_W, KC_Y, COMBO_END}; -const uint16_t PROGMEM dh_combo[] = {KC_D, KC_H, COMBO_END}; -const uint16_t PROGMEM hcomma_combo[] = {KC_H, KC_COMM, COMBO_END}; -const uint16_t PROGMEM wspc_combo[] = {KC_W, KC_SPC, COMBO_END}; -const uint16_t PROGMEM fu_combo[] = {KC_F, KC_U, COMBO_END}; -const uint16_t PROGMEM pl_combo[] = {KC_P, KC_L, COMBO_END}; -const uint16_t PROGMEM ccom_combo[] = {KC_C, KC_COMM, COMBO_END}; -const uint16_t PROGMEM xdot_combo[] = {KC_X, KC_DOT, COMBO_END}; -const uint16_t PROGMEM gm_combo[] = {KC_G, KC_M, COMBO_END}; -const uint16_t PROGMEM comd_combo[] = {KC_COMM, KC_DOT, COMBO_END}; -const uint16_t PROGMEM zdot_combo[] = {KC_Z, KC_DOT, COMBO_END}; - -// clang-format off -// -combo_t key_combos[] = { - [WY_TAB] = COMBO(wy_combo, KC_TAB), - [DH_CAPS] = COMBO(dh_combo, CW_TOGG), - [HCOMA_MINS] = COMBO(hcomma_combo, KC_MINS), - [WSPC_VIM] = COMBO(wspc_combo, VIMS), - [FU_QUOTE] = COMBO(fu_combo, KC_QUOT), - [PL_DQUOTE] = COMBO(pl_combo, S(KC_QUOT)), - [CCOM_LARR] = COMBO(ccom_combo, LARR), - [XDOT_FARR] = COMBO(xdot_combo, FARR), - [GM_EPIP] = COMBO(gm_combo, EPIP), - [COMD_UNDERS] = COMBO(comd_combo, S(KC_MINS)), - [ZDOT_BARR] = COMBO(zdot_combo, BARR), -}; - -/* - * Keymaps! - */ - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -// ┌───────────┌───────────┬───────────┬───────────┬───────────┬────────────┐ ┌──────┬────────────┬───────────┬───────────┬───────────┬───────────┐ -// │ esc │ q │ w │ f │ p │ b │ │ j │ l │ u │ y │ ; │ bkspc │ -// ├───────────├───────────┼───────────┼───────────┼───────────┼────────────┤ ├──────┼────────────┼───────────┼───────────┼───────────┼───────────┤ -// │ tab │ LGUI_T(a) │ LALT_T(r) │ LCTL_T(s) │ LSFT_T(t) │ g │ │ m │ RSFT_T(n) │ RCTL_T(e) │ RALT_T(i) │ RGUI_T(o) │ enter │ -// ├───────────├───────────┼───────────┼───────────┼───────────┼────────────┤ ├──────┼────────────┼───────────┼───────────┼───────────┼───────────┤ -// │ shift │ z │ x │ c │ d │ v │ │ k │ h │ , │ . │ LT(3, /) │ shift │ -// └───────────└───────────┴───────────┴───────────┼───────────┼────────────┼─────┐ ┌────────────┼──────┼────────────┼───────────┴───────────┴───────────┴───────────┘ -// │ MO(5) │ LT(2, esc) │ spc │ │ LT(1, ent) │ bspc │ LT(4, del) │ -// └───────────┴────────────┴─────┘ └────────────┴──────┴────────────┘ -[_BASE] = LAYOUT_3x6( - KC_ESC ,KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , KC_BSPC, - KC_TAB ,LGUI_T(KC_A) , LALT_T(KC_R) , LCTL_T(KC_S) , LSFT_T(KC_T) , KC_G , KC_M , RSFT_T(KC_N) , RCTL_T(KC_E) , RALT_T(KC_I) , RGUI_T(KC_O) , KC_ENTER, - KC_LSFT ,KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , LT(3, KC_SLSH), KC_RSFT, - MO(5) , LT(2, KC_ESC) , KC_SPC , LT(1, KC_ENT) , KC_BSPC , LT(4, KC_DEL) -), - -// ┌──────┬───┬───┬───────────┬──────┐ ┌──────┬───────────┬───────────┬──────┬─────┐ -// │ S(8) │ 7 │ 8 │ 9 │ / │ │ \ │ S(9) │ S(0) │ S(\) │ │ -// ├──────┼───┼───┼───────────┼──────┤ ├──────┼───────────┼───────────┼──────┼─────┤ -// │ - │ 4 │ 5 │ LSFT_T(6) │ S(=) │ │ S(5) │ RSFT_T([) │ RCTL_T(]) │ S(;) │ ; │ -// ├──────┼───┼───┼───────────┼──────┤ ├──────┼───────────┼───────────┼──────┼─────┤ -// │ ` │ 1 │ 2 │ 3 │ = │ │ [ │ ] │ │ │ │ -// └──────┴───┴───┼───────────┼──────┼─────┐ ┌─────┼──────┼───────────┼───────────┴──────┴─────┘ -// │ │ 0 │ │ │ │ │ │ -// └───────────┴──────┴─────┘ └─────┴──────┴───────────┘ -[_NUM] = LAYOUT_3x6( - KC_NO, S(KC_8) , KC_7 , KC_8 , KC_9 , KC_SLSH , KC_BSLS , S(KC_9) , S(KC_0) , S(KC_BSLS) , KC_TRNS, KC_NO, - KC_NO, KC_MINS , KC_4 , KC_5 , LSFT_T(KC_6) , S(KC_EQL) , S(KC_5) , RSFT_T(KC_LBRC) , RCTL_T(KC_RBRC) , S(KC_SCLN) , KC_SCLN, KC_NO, - KC_NO, KC_GRV , KC_1 , KC_2 , KC_3 , KC_EQL , KC_LBRC , KC_RBRC , KC_TRNS , KC_TRNS , KC_TRNS, KC_NO, - KC_TRNS , KC_0 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS -), - -// ┌──────┬──────┬──────┬───────┬────┐ ┌────┬──────┬──────┬──────┬──────┐ -// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ -// ├──────┼──────┼──────┼───────┼────┤ ├────┼──────┼──────┼──────┼──────┤ -// │ lgui │ lalt │ lctl │ lsft │ no │ │ no │ left │ down │ up │ rght │ -// ├──────┼──────┼──────┼───────┼────┤ ├────┼──────┼──────┼──────┼──────┤ -// │ no │ no │ copy │ paste │ no │ │ no │ home │ end │ pgdn │ pgup │ -// └──────┴──────┴──────┼───────┼────┼────┐ ┌────┼────┼──────┼──────┴──────┴──────┘ -// │ no │ no │ no │ │ no │ no │ no │ -// └───────┴────┴────┘ └────┴────┴──────┘ -[_NAV] = LAYOUT_3x6( - KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, - KC_NO, KC_LGUI , KC_LALT , KC_LCTL , KC_LSFT , KC_NO , KC_NO , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT, KC_NO, - KC_NO, KC_NO , KC_NO , KC_COPY , KC_PSTE , KC_NO , KC_NO , KC_HOME , KC_END , KC_PGDN , KC_PGUP, KC_NO, - KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO -), - -// ┌──────┬──────┬──────┬──────┬──────┐ ┌────┬────┬────┬────┬────┐ -// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ -// ├──────┼──────┼──────┼──────┼──────┤ ├────┼────┼────┼────┼────┤ -// │ mprv │ vold │ mply │ volu │ mnxt │ │ no │ no │ no │ no │ no │ -// ├──────┼──────┼──────┼──────┼──────┤ ├────┼────┼────┼────┼────┤ -// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ -// └──────┴──────┴──────┼──────┼──────┼────┐ ┌────┼────┼────┼────┴────┴────┘ -// │ no │ no │ no │ │ no │ no │ no │ -// └──────┴──────┴────┘ └────┴────┴────┘ -[_MEDIA] = LAYOUT_3x6( - KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, KC_NO, - KC_NO, KC_MPRV , KC_VOLD , KC_MPLY , KC_VOLU , KC_MNXT , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, KC_NO, - KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, KC_NO, - KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO -), - -// ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬──────┬──────┬──────┬──────┐ -// │ f11 │ f12 │ f13 │ f14 │ f15 │ │ │ │ │ │ │ -// ├─────┼─────┼─────┼─────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ -// │ f6 │ f7 │ f8 │ f9 │ f10 │ │ │ rsft │ rctl │ ralt │ rgui │ -// ├─────┼─────┼─────┼─────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ -// │ f1 │ f2 │ f3 │ f4 │ f5 │ │ │ │ │ │ │ -// └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼──────┼──────┴──────┴──────┘ -// │ │ │ │ │ │ │ │ -// └─────┴─────┴─────┘ └─────┴─────┴──────┘ -[_FUNC] = LAYOUT_3x6( - KC_NO, KC_F11 , KC_F12 , KC_F13 , KC_F14 , KC_F15 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, KC_NO, - KC_NO, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_TRNS , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, KC_NO, - KC_NO, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, KC_NO, - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS -), - -// ┌──────┬─────────┬─────────┬─────────────┬────┐ ┌────────┬─────────┬─────────┬──────┬─────────┐ -// │ lsft │ lalt │ no │ no │ no │ │ EE_CLR │ MSE_INC │ MSE_DEC │ no │ no │ -// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼──────┼─────────┤ -// │ lctl │ MS_BTN3 │ MS_BTN2 │ MS_BTN1 │ no │ │ no │ rsft │ rctl │ ralt │ rgui │ -// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼──────┼─────────┤ -// │ lgui │ no │ no │ DRAG_SCROLL │ no │ │ no │ no │ no │ no │ DB_TOGG │ -// └──────┴─────────┴─────────┼─────────────┼────┼────┐ ┌────┼────────┼─────────┼─────────┴──────┴─────────┘ -// │ │ no │ no │ │ no │ no │ no │ -// └─────────────┴────┴────┘ └────┴────────┴─────────┘ -[_MOUS] = LAYOUT_3x6( - KC_NO, KC_LSFT , KC_LALT , KC_NO , KC_NO , KC_NO , EE_CLR , MSE_INC , MSE_DEC , KC_NO , KC_NO , KC_NO, - KC_NO, KC_LCTL , MS_BTN3 , MS_BTN2 , MS_BTN1 , KC_NO , KC_NO , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, KC_NO, - KC_NO, KC_LGUI , KC_NO , KC_NO , DRAG_SCROLL , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , DB_TOGG, KC_NO, - KC_TRNS , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO -) + [0] = LAYOUT_3x6( + KC_ESC , KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , KC_BSPC , + KC_TAB , KC_A , KC_R , KC_S , KC_T , KC_G , KC_M , KC_N , KC_E , KC_I , KC_O , KC_ENTER , + KC_LSFT , KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , KC_SLSH , KC_RSFT , + XXXXXXX , KC_ESC , KC_SPC , KC_ENT, KC_BSPC , KC_DEL + ) }; -// clang-format on - -bool process_record_user(uint16_t keycode, keyrecord_t* record) { - if (!process_achordion(keycode, record)) { - return false; - } - switch (keycode) { - case RSFT_T(KC_LBRC): - if (record->tap.count && record->event.pressed) { - tap_code16(S(KC_LBRC)); - return false; - } - break; - - case RCTL_T(KC_RBRC): - if (record->tap.count && record->event.pressed) { - tap_code16(S(KC_RBRC)); - return false; - } - break; - - case VIMS: - if (record->event.pressed) { - tap_code16(KC_ESC); - SEND_STRING(":w\n"); - - return false; - } - break; - - case EPIP: - if (record->event.pressed) { - SEND_STRING("|> "); - - return false; - } - break; - - case LARR: - if (record->event.pressed) { - SEND_STRING("-> "); - - return false; - } - break; - - case FARR: - if (record->event.pressed) { - SEND_STRING("=> "); - - return false; - } - break; - - case BARR: - if (record->event.pressed) { - SEND_STRING("<- "); - - return false; - } - break; - case MSE_INC: - if (record->event.pressed) { - change_pointer_dpi(&global_user_config, true); - debug_config_to_console(&global_user_config); - - return false; - } - break; - case MSE_DEC: - if (record->event.pressed) { - change_pointer_dpi(&global_user_config, false); - debug_config_to_console(&global_user_config); - - return false; - } - break; - case DRAG_SCROLL: - set_scrolling = record->event.pressed; - break; - } - - return true; -} - -bool achordion_chord(uint16_t tap_hold_keycode, keyrecord_t* tap_hold_record, uint16_t other_keycode, keyrecord_t* other_record) { - switch (tap_hold_keycode) { - case 0x4128: - return true; - break; - } - - return achordion_opposite_hands(tap_hold_record, other_record); -} - -void matrix_scan_user(void) { - achordion_task(); -} - -#ifdef OLED_ENABLE - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (!is_keyboard_master()) { - return OLED_ROTATION_180; - } - - return rotation; -} - -static void render_logo(void) { - static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; - - oled_write_P(qmk_logo, false); -} - -bool oled_task_user(void) { - render_logo(); - - const char* layer_names[] = { - [_BASE] = ">> BASE ", [_NUM] = ">> PROG ", [_NAV] = ">> NAVI ", [_MEDIA] = ">>> MEDIA ", [_FUNC] = ">>> FUNC ", [_MOUS] = ">>> MOUSE ", - }; - - oled_write_P(PSTR(layer_names[get_highest_layer(layer_state)]), false); - - return false; -} -#endif /* ifdef OLED_ENABLE */ - -void pointing_device_init_user(void) { - set_auto_mouse_layer(_MOUS); - set_auto_mouse_enable(true); -} diff --git a/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c b/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c new file mode 100644 index 00000000000..55b913591c9 --- /dev/null +++ b/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c @@ -0,0 +1,311 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "action_layer.h" +#include QMK_KEYBOARD_H + +#include "lib/achordion.h" +#include "lib/crosses.h" + +/* + * Keycodes, combos, and layers! oh my! + */ + +enum CROSSES_LAYERS { + _BASE, + _NUM, + _NAV, + _MEDIA, + _FUNC, + _MOUS, +}; + +enum my_keycodes { + VIMS = SAFE_RANGE, + LARR, + FARR, + EPIP, + LVBC, + RVBC, + BARR, + MSE_INC, + MSE_DEC, + DRAG_SCROLL, +}; + +enum combos { + WY_TAB, + DH_CAPS, + HCOMA_MINS, + WSPC_VIM, + FU_QUOTE, + PL_DQUOTE, + CCOM_LARR, + XDOT_FARR, + GM_EPIP, + COMD_UNDERS, + ZDOT_BARR, +}; + +const uint16_t PROGMEM wy_combo[] = {KC_W, KC_Y, COMBO_END}; +const uint16_t PROGMEM dh_combo[] = {KC_D, KC_H, COMBO_END}; +const uint16_t PROGMEM hcomma_combo[] = {KC_H, KC_COMM, COMBO_END}; +const uint16_t PROGMEM wspc_combo[] = {KC_W, KC_SPC, COMBO_END}; +const uint16_t PROGMEM fu_combo[] = {KC_F, KC_U, COMBO_END}; +const uint16_t PROGMEM pl_combo[] = {KC_P, KC_L, COMBO_END}; +const uint16_t PROGMEM ccom_combo[] = {KC_C, KC_COMM, COMBO_END}; +const uint16_t PROGMEM xdot_combo[] = {KC_X, KC_DOT, COMBO_END}; +const uint16_t PROGMEM gm_combo[] = {KC_G, KC_M, COMBO_END}; +const uint16_t PROGMEM comd_combo[] = {KC_COMM, KC_DOT, COMBO_END}; +const uint16_t PROGMEM zdot_combo[] = {KC_Z, KC_DOT, COMBO_END}; + +// clang-format off +// +combo_t key_combos[] = { + [WY_TAB] = COMBO(wy_combo, KC_TAB), + [DH_CAPS] = COMBO(dh_combo, CW_TOGG), + [HCOMA_MINS] = COMBO(hcomma_combo, KC_MINS), + [WSPC_VIM] = COMBO(wspc_combo, VIMS), + [FU_QUOTE] = COMBO(fu_combo, KC_QUOT), + [PL_DQUOTE] = COMBO(pl_combo, S(KC_QUOT)), + [CCOM_LARR] = COMBO(ccom_combo, LARR), + [XDOT_FARR] = COMBO(xdot_combo, FARR), + [GM_EPIP] = COMBO(gm_combo, EPIP), + [COMD_UNDERS] = COMBO(comd_combo, S(KC_MINS)), + [ZDOT_BARR] = COMBO(zdot_combo, BARR), +}; + +/* + * Keymaps! + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// ┌───────────┌───────────┬───────────┬───────────┬───────────┬────────────┐ ┌──────┬────────────┬───────────┬───────────┬───────────┬───────────┐ +// │ esc │ q │ w │ f │ p │ b │ │ j │ l │ u │ y │ ; │ bkspc │ +// ├───────────├───────────┼───────────┼───────────┼───────────┼────────────┤ ├──────┼────────────┼───────────┼───────────┼───────────┼───────────┤ +// │ tab │ LGUI_T(a) │ LALT_T(r) │ LCTL_T(s) │ LSFT_T(t) │ g │ │ m │ RSFT_T(n) │ RCTL_T(e) │ RALT_T(i) │ RGUI_T(o) │ enter │ +// ├───────────├───────────┼───────────┼───────────┼───────────┼────────────┤ ├──────┼────────────┼───────────┼───────────┼───────────┼───────────┤ +// │ shift │ z │ x │ c │ d │ v │ │ k │ h │ , │ . │ LT(3, /) │ shift │ +// └───────────└───────────┴───────────┴───────────┼───────────┼────────────┼─────┐ ┌────────────┼──────┼────────────┼───────────┴───────────┴───────────┴───────────┘ +// │ MO(5) │ LT(2, esc) │ spc │ │ LT(1, ent) │ bspc │ LT(4, del) │ +// └───────────┴────────────┴─────┘ └────────────┴──────┴────────────┘ +[_BASE] = LAYOUT_3x6( + KC_ESC ,KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , KC_BSPC, + KC_TAB ,LGUI_T(KC_A) , LALT_T(KC_R) , LCTL_T(KC_S) , LSFT_T(KC_T) , KC_G , KC_M , RSFT_T(KC_N) , RCTL_T(KC_E) , RALT_T(KC_I) , RGUI_T(KC_O) , KC_ENTER, + KC_LSFT ,KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , LT(3, KC_SLSH), KC_RSFT, + MO(5) , LT(2, KC_ESC) , KC_SPC , LT(1, KC_ENT) , KC_BSPC , LT(4, KC_DEL) +), + +// ┌──────┬───┬───┬───────────┬──────┐ ┌──────┬───────────┬───────────┬──────┬─────┐ +// │ S(8) │ 7 │ 8 │ 9 │ / │ │ \ │ S(9) │ S(0) │ S(\) │ │ +// ├──────┼───┼───┼───────────┼──────┤ ├──────┼───────────┼───────────┼──────┼─────┤ +// │ - │ 4 │ 5 │ LSFT_T(6) │ S(=) │ │ S(5) │ RSFT_T([) │ RCTL_T(]) │ S(;) │ ; │ +// ├──────┼───┼───┼───────────┼──────┤ ├──────┼───────────┼───────────┼──────┼─────┤ +// │ ` │ 1 │ 2 │ 3 │ = │ │ [ │ ] │ │ │ │ +// └──────┴───┴───┼───────────┼──────┼─────┐ ┌─────┼──────┼───────────┼───────────┴──────┴─────┘ +// │ │ 0 │ │ │ │ │ │ +// └───────────┴──────┴─────┘ └─────┴──────┴───────────┘ +[_NUM] = LAYOUT_3x6( + KC_NO, S(KC_8) , KC_7 , KC_8 , KC_9 , KC_SLSH , KC_BSLS , S(KC_9) , S(KC_0) , S(KC_BSLS) , KC_TRNS, KC_NO, + KC_NO, KC_MINS , KC_4 , KC_5 , LSFT_T(KC_6) , S(KC_EQL) , S(KC_5) , RSFT_T(KC_LBRC) , RCTL_T(KC_RBRC) , S(KC_SCLN) , KC_SCLN, KC_NO, + KC_NO, KC_GRV , KC_1 , KC_2 , KC_3 , KC_EQL , KC_LBRC , KC_RBRC , KC_TRNS , KC_TRNS , KC_TRNS, KC_NO, + KC_TRNS , KC_0 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS +), + +// ┌──────┬──────┬──────┬───────┬────┐ ┌────┬──────┬──────┬──────┬──────┐ +// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ +// ├──────┼──────┼──────┼───────┼────┤ ├────┼──────┼──────┼──────┼──────┤ +// │ lgui │ lalt │ lctl │ lsft │ no │ │ no │ left │ down │ up │ rght │ +// ├──────┼──────┼──────┼───────┼────┤ ├────┼──────┼──────┼──────┼──────┤ +// │ no │ no │ copy │ paste │ no │ │ no │ home │ end │ pgdn │ pgup │ +// └──────┴──────┴──────┼───────┼────┼────┐ ┌────┼────┼──────┼──────┴──────┴──────┘ +// │ no │ no │ no │ │ no │ no │ no │ +// └───────┴────┴────┘ └────┴────┴──────┘ +[_NAV] = LAYOUT_3x6( + KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, + KC_NO, KC_LGUI , KC_LALT , KC_LCTL , KC_LSFT , KC_NO , KC_NO , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT, KC_NO, + KC_NO, KC_NO , KC_NO , KC_COPY , KC_PSTE , KC_NO , KC_NO , KC_HOME , KC_END , KC_PGDN , KC_PGUP, KC_NO, + KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO +), + +// ┌──────┬──────┬──────┬──────┬──────┐ ┌────┬────┬────┬────┬────┐ +// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ +// ├──────┼──────┼──────┼──────┼──────┤ ├────┼────┼────┼────┼────┤ +// │ mprv │ vold │ mply │ volu │ mnxt │ │ no │ no │ no │ no │ no │ +// ├──────┼──────┼──────┼──────┼──────┤ ├────┼────┼────┼────┼────┤ +// │ no │ no │ no │ no │ no │ │ no │ no │ no │ no │ no │ +// └──────┴──────┴──────┼──────┼──────┼────┐ ┌────┼────┼────┼────┴────┴────┘ +// │ no │ no │ no │ │ no │ no │ no │ +// └──────┴──────┴────┘ └────┴────┴────┘ +[_MEDIA] = LAYOUT_3x6( + KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, KC_NO, + KC_NO, KC_MPRV , KC_VOLD , KC_MPLY , KC_VOLU , KC_MNXT , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, KC_NO, + KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, KC_NO, + KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO +), + +// ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬──────┬──────┬──────┬──────┐ +// │ f11 │ f12 │ f13 │ f14 │ f15 │ │ │ │ │ │ │ +// ├─────┼─────┼─────┼─────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ +// │ f6 │ f7 │ f8 │ f9 │ f10 │ │ │ rsft │ rctl │ ralt │ rgui │ +// ├─────┼─────┼─────┼─────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ +// │ f1 │ f2 │ f3 │ f4 │ f5 │ │ │ │ │ │ │ +// └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼──────┼──────┴──────┴──────┘ +// │ │ │ │ │ │ │ │ +// └─────┴─────┴─────┘ └─────┴─────┴──────┘ +[_FUNC] = LAYOUT_3x6( + KC_NO, KC_F11 , KC_F12 , KC_F13 , KC_F14 , KC_F15 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, KC_NO, + KC_NO, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_TRNS , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, KC_NO, + KC_NO, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, KC_NO, + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS +), + +// ┌──────┬─────────┬─────────┬─────────────┬────┐ ┌────────┬─────────┬─────────┬──────┬─────────┐ +// │ lsft │ lalt │ no │ no │ no │ │ EE_CLR │ MSE_INC │ MSE_DEC │ no │ no │ +// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼──────┼─────────┤ +// │ lctl │ MS_BTN3 │ MS_BTN2 │ MS_BTN1 │ no │ │ no │ rsft │ rctl │ ralt │ rgui │ +// ├──────┼─────────┼─────────┼─────────────┼────┤ ├────────┼─────────┼─────────┼──────┼─────────┤ +// │ lgui │ no │ no │ DRAG_SCROLL │ no │ │ no │ no │ no │ no │ DB_TOGG │ +// └──────┴─────────┴─────────┼─────────────┼────┼────┐ ┌────┼────────┼─────────┼─────────┴──────┴─────────┘ +// │ │ no │ no │ │ no │ no │ no │ +// └─────────────┴────┴────┘ └────┴────────┴─────────┘ +[_MOUS] = LAYOUT_3x6( + KC_NO, KC_LSFT , KC_LALT , KC_NO , KC_NO , KC_NO , EE_CLR , MSE_INC , MSE_DEC , KC_NO , KC_NO , KC_NO, + KC_NO, KC_LCTL , MS_BTN3 , MS_BTN2 , MS_BTN1 , KC_NO , KC_NO , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, KC_NO, + KC_NO, KC_LGUI , KC_NO , KC_NO , DRAG_SCROLL , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , DB_TOGG, KC_NO, + KC_TRNS , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO +) +}; + +// clang-format on + +bool process_record_user(uint16_t keycode, keyrecord_t* record) { + if (!process_achordion(keycode, record)) { + return false; + } + switch (keycode) { + case RSFT_T(KC_LBRC): + if (record->tap.count && record->event.pressed) { + tap_code16(S(KC_LBRC)); + return false; + } + break; + + case RCTL_T(KC_RBRC): + if (record->tap.count && record->event.pressed) { + tap_code16(S(KC_RBRC)); + return false; + } + break; + + case VIMS: + if (record->event.pressed) { + tap_code16(KC_ESC); + SEND_STRING(":w\n"); + + return false; + } + break; + + case EPIP: + if (record->event.pressed) { + SEND_STRING("|> "); + + return false; + } + break; + + case LARR: + if (record->event.pressed) { + SEND_STRING("-> "); + + return false; + } + break; + + case FARR: + if (record->event.pressed) { + SEND_STRING("=> "); + + return false; + } + break; + + case BARR: + if (record->event.pressed) { + SEND_STRING("<- "); + + return false; + } + break; + case MSE_INC: + if (record->event.pressed) { + change_pointer_dpi(&global_user_config, true); + debug_config_to_console(&global_user_config); + + return false; + } + break; + case MSE_DEC: + if (record->event.pressed) { + change_pointer_dpi(&global_user_config, false); + debug_config_to_console(&global_user_config); + + return false; + } + break; + case DRAG_SCROLL: + set_scrolling = record->event.pressed; + break; + } + + return true; +} + +bool achordion_chord(uint16_t tap_hold_keycode, keyrecord_t* tap_hold_record, uint16_t other_keycode, keyrecord_t* other_record) { + switch (tap_hold_keycode) { + case 0x4128: + return true; + break; + } + + return achordion_opposite_hands(tap_hold_record, other_record); +} + +void matrix_scan_user(void) { + achordion_task(); +} + +#ifdef OLED_ENABLE + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (!is_keyboard_master()) { + return OLED_ROTATION_180; + } + + return rotation; +} + +static void render_logo(void) { + static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; + + oled_write_P(qmk_logo, false); +} + +bool oled_task_user(void) { + render_logo(); + + const char* layer_names[] = { + [_BASE] = ">> BASE ", [_NUM] = ">> PROG ", [_NAV] = ">> NAVI ", [_MEDIA] = ">>> MEDIA ", [_FUNC] = ">>> FUNC ", [_MOUS] = ">>> MOUSE ", + }; + + oled_write_P(PSTR(layer_names[get_highest_layer(layer_state)]), false); + + return false; +} +#endif /* ifdef OLED_ENABLE */ + +void pointing_device_init_user(void) { + set_auto_mouse_layer(_MOUS); + set_auto_mouse_enable(true); +} diff --git a/keyboards/gggw/crosses/3x6/keymaps/default/rules.mk b/keyboards/gggw/crosses/3x6/keymaps/stock/rules.mk similarity index 100% rename from keyboards/gggw/crosses/3x6/keymaps/default/rules.mk rename to keyboards/gggw/crosses/3x6/keymaps/stock/rules.mk diff --git a/keyboards/gggw/crosses/4x6/keymaps/default/keymap.c b/keyboards/gggw/crosses/4x6/keymaps/default/keymap.c index 3c75e8a36f3..1bd98a38498 100644 --- a/keyboards/gggw/crosses/4x6/keymaps/default/keymap.c +++ b/keyboards/gggw/crosses/4x6/keymaps/default/keymap.c @@ -3,223 +3,18 @@ #include QMK_KEYBOARD_H -#include "lib/crosses.h" - -/* - * Keycodes, combos, and layers! oh my! - */ - -enum CROSSES_LAYERS { _BASE, _NUM, _NAV, _MEDIA, _FUNC, _MOUS, _CUST }; - -enum crosses_keycode { C_MINC = QK_KB_0, C_MDEC, C_MTOGG, C_DRAG }; - -#define CTAB LCTL_T(KC_TAB) -#define SCLM LT(_MEDIA, KC_SCLN) -#define C_SMOUS LT(_MOUS, KC_SPC) -#define LNAV MO(_NAV) -#define RENTR LT(_NUM, KC_ENT) -#define LNUM MO(_NUM) -#define RALTD RALT_T(KC_DEL) - -/* - * Keymaps! - */ - -// clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_4x6( - //,-------------------------------------------------------. ,--------------------------------------------------------. - KC_GRV ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 , KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINUS , - //|--------+--------+--------+--------+--------+----------| |------+--------+--------+-----------+--------+----------| - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC , - //|--------+--------+--------+--------+--------+----------| |------+--------+--------+-----------+--------+----------| - CTAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SCLM, KC_QUOT , - //|--------+--------+--------+--------+--------+----------| |------+--------+--------+-----------+--------+----------| - 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_LGUI, LNAV, C_SMOUS, RENTR, LNUM, RALTD - //`-----------------------------' `-----------------------' - ), - [_NUM] = LAYOUT_4x6( - //,-------------------------------------------------------. ,--------------------------------------------------------. - KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_ESC, S(KC_8), KC_7, KC_8, KC_9, KC_SLSH, KC_BSLS, S(KC_9), S(KC_0), S(KC_BSLS), KC_TRNS, KC_BSPC, - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_LCTL, KC_MINS, KC_4, KC_5, KC_6, S(KC_EQL), S(KC_5), KC_LBRC, KC_RBRC, S(KC_SCLN), KC_SCLN, KC_QUOT, - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_LSFT, KC_GRV, KC_1, KC_2, KC_3, KC_EQL, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, KC_TRNS, KC_RSFT, - //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| - KC_TRNS, KC_0, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - //`-----------------------------' `--------------------------' - ), - [_NAV] = LAYOUT_4x6( - //,-------------------------------------------------------. ,--------------------------------------------------------. - KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_NO, KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_NO, KC_NO, KC_NO, KC_COPY, KC_PSTE, KC_NO, KC_NO, KC_HOME, KC_END, KC_PGDN, KC_PGUP, KC_NO, - //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO - //`-----------------------------' `--------------------------' - ), - [_MEDIA] = LAYOUT_4x6( - //,-------------------------------------------------------. ,--------------------------------------------------------. - KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_NO, KC_MPRV, KC_VOLD, KC_MPLY, KC_VOLU, KC_MNXT , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO - //`-----------------------------' `--------------------------' - ), - [_FUNC] = LAYOUT_4x6( - //,-------------------------------------------------------. ,--------------------------------------------------------. - KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_NO ,KC_F11 ,KC_F12 ,KC_F13 ,KC_F14, KC_F15 , KC_TRNS, KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_NO , - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_NO , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9, KC_F10 , KC_TRNS ,KC_RSFT ,KC_RCTL ,KC_RALT ,KC_RGUI ,KC_NO , - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_NO ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 , KC_F5 , KC_TRNS ,KC_TRNS , KC_TRNS,KC_TRNS ,KC_TRNS, KC_NO , - //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS ,KC_TRNS ,KC_TRNS - //`-----------------------------' `--------------------------' - ), - [_MOUS] = LAYOUT_4x6( - //,-------------------------------------------------------. ,--------------------------------------------------------. - KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_NO ,KC_LSFT ,KC_LALT ,KC_NO ,KC_NO ,KC_NO , KC_NO ,C_MINC ,C_MDEC ,KC_NO ,KC_NO ,C_MTOGG , - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_NO ,KC_LCTL ,MS_BTN3 ,MS_BTN2 ,MS_BTN1 ,KC_NO , KC_NO ,KC_RSFT ,KC_RCTL ,KC_RALT ,KC_RGUI ,KC_NO , - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_NO ,KC_LGUI ,KC_NO ,KC_NO ,C_DRAG ,KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , - //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| - KC_TRNS ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO - //`-----------------------------' `--------------------------' - ), - [_CUST] = LAYOUT_4x6( - //,-------------------------------------------------------. ,--------------------------------------------------------. - KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , - //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| - KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , - //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| - KC_NO ,KC_NO ,KC_NO , KC_NO ,KC_NO , KC_NO - //`-----------------------------' `--------------------------' + [0] = LAYOUT_4x6( + //,-------------------------------------------------------. ,-----------------------------------------------------------. + KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINUS , + //|--------+--------+--------+--------+--------+----------| |---------+--------+--------+-----------+--------+----------| + KC_ESC , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC , + //|--------+--------+--------+--------+--------+----------| |---------+--------+--------+-----------+--------+----------| + KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_BSPC, KC_QUOT , + //|--------+--------+--------+--------+--------+----------| |---------+--------+--------+-----------+--------+----------| + 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_LGUI , KC_SPC ,XXXXXXX , KC_ENTER, XXXXXXX , KC_RALT + //`-----------------------------' `--------------------------' ) }; - -// clang-format on - -bool process_record_user(uint16_t keycode, keyrecord_t* record) { - switch (keycode) { - case RSFT_T(KC_LBRC): - if (record->tap.count && record->event.pressed) { - tap_code16(S(KC_LBRC)); - return false; - } - break; - - case RCTL_T(KC_RBRC): - if (record->tap.count && record->event.pressed) { - tap_code16(S(KC_RBRC)); - return false; - } - break; - - case C_MINC: - if (record->event.pressed) { - change_pointer_dpi(&global_user_config, true); - debug_config_to_console(&global_user_config); - - return false; - } - break; - - case C_MDEC: - if (record->event.pressed) { - change_pointer_dpi(&global_user_config, false); - debug_config_to_console(&global_user_config); - - return false; - } - break; - - case C_MTOGG: - if (record->event.pressed) { - bool current_state = get_auto_mouse_enable(); - set_auto_mouse_enable(!current_state); - - return false; - } - break; - - case C_DRAG: - if (record->event.pressed) { - set_scrolling = record->event.pressed; - return true; - } - break; - } - - return true; -} - -#ifdef OLED_ENABLE - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (!is_keyboard_master()) { - return OLED_ROTATION_180; - } - - return rotation; -} - -static void render_logo(void) { - static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; - - oled_write_P(qmk_logo, false); -} - -bool oled_task_user(void) { - render_logo(); - - // clang-format off - const char* layer_names[] = { - [_BASE] = "BASE CPI: ", - [_NUM] = "PROG CPI: ", - [_NAV] = "NAVI CPI: ", - [_MEDIA] = "MEDIA CPI: ", - [_FUNC] = "FUNC CPI: ", - [_MOUS] = "MOUSE CPI: ", - [_CUST] = "CUST CPI: ", - }; - // clang-format on - - char cpi_str[6]; - uint16_t current_dpi = get_pointer_dpi(&global_user_config); - - snprintf(cpi_str, sizeof(cpi_str), "%u", (unsigned int)current_dpi); - - oled_write(PSTR(layer_names[get_highest_layer(layer_state)]), false); - oled_write(cpi_str, false); - - return false; -} -#endif /* ifdef OLED_ENABLE */ - -void pointing_device_init_user(void) { - set_auto_mouse_layer(_MOUS); - set_auto_mouse_enable(true); -} diff --git a/keyboards/gggw/crosses/4x6/keymaps/stock/keymap.c b/keyboards/gggw/crosses/4x6/keymaps/stock/keymap.c new file mode 100644 index 00000000000..3c75e8a36f3 --- /dev/null +++ b/keyboards/gggw/crosses/4x6/keymaps/stock/keymap.c @@ -0,0 +1,225 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +#include "lib/crosses.h" + +/* + * Keycodes, combos, and layers! oh my! + */ + +enum CROSSES_LAYERS { _BASE, _NUM, _NAV, _MEDIA, _FUNC, _MOUS, _CUST }; + +enum crosses_keycode { C_MINC = QK_KB_0, C_MDEC, C_MTOGG, C_DRAG }; + +#define CTAB LCTL_T(KC_TAB) +#define SCLM LT(_MEDIA, KC_SCLN) +#define C_SMOUS LT(_MOUS, KC_SPC) +#define LNAV MO(_NAV) +#define RENTR LT(_NUM, KC_ENT) +#define LNUM MO(_NUM) +#define RALTD RALT_T(KC_DEL) + +/* + * Keymaps! + */ + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_4x6( + //,-------------------------------------------------------. ,--------------------------------------------------------. + KC_GRV ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 , KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINUS , + //|--------+--------+--------+--------+--------+----------| |------+--------+--------+-----------+--------+----------| + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC , + //|--------+--------+--------+--------+--------+----------| |------+--------+--------+-----------+--------+----------| + CTAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SCLM, KC_QUOT , + //|--------+--------+--------+--------+--------+----------| |------+--------+--------+-----------+--------+----------| + 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_LGUI, LNAV, C_SMOUS, RENTR, LNUM, RALTD + //`-----------------------------' `-----------------------' + ), + [_NUM] = LAYOUT_4x6( + //,-------------------------------------------------------. ,--------------------------------------------------------. + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_ESC, S(KC_8), KC_7, KC_8, KC_9, KC_SLSH, KC_BSLS, S(KC_9), S(KC_0), S(KC_BSLS), KC_TRNS, KC_BSPC, + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_LCTL, KC_MINS, KC_4, KC_5, KC_6, S(KC_EQL), S(KC_5), KC_LBRC, KC_RBRC, S(KC_SCLN), KC_SCLN, KC_QUOT, + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_LSFT, KC_GRV, KC_1, KC_2, KC_3, KC_EQL, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, KC_TRNS, KC_RSFT, + //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| + KC_TRNS, KC_0, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + //`-----------------------------' `--------------------------' + ), + [_NAV] = LAYOUT_4x6( + //,-------------------------------------------------------. ,--------------------------------------------------------. + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO, KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO, KC_NO, KC_NO, KC_COPY, KC_PSTE, KC_NO, KC_NO, KC_HOME, KC_END, KC_PGDN, KC_PGUP, KC_NO, + //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + //`-----------------------------' `--------------------------' + ), + [_MEDIA] = LAYOUT_4x6( + //,-------------------------------------------------------. ,--------------------------------------------------------. + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO, KC_MPRV, KC_VOLD, KC_MPLY, KC_VOLU, KC_MNXT , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + //`-----------------------------' `--------------------------' + ), + [_FUNC] = LAYOUT_4x6( + //,-------------------------------------------------------. ,--------------------------------------------------------. + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_F11 ,KC_F12 ,KC_F13 ,KC_F14, KC_F15 , KC_TRNS, KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9, KC_F10 , KC_TRNS ,KC_RSFT ,KC_RCTL ,KC_RALT ,KC_RGUI ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 , KC_F5 , KC_TRNS ,KC_TRNS , KC_TRNS,KC_TRNS ,KC_TRNS, KC_NO , + //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| + KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS ,KC_TRNS ,KC_TRNS + //`-----------------------------' `--------------------------' + ), + [_MOUS] = LAYOUT_4x6( + //,-------------------------------------------------------. ,--------------------------------------------------------. + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_LSFT ,KC_LALT ,KC_NO ,KC_NO ,KC_NO , KC_NO ,C_MINC ,C_MDEC ,KC_NO ,KC_NO ,C_MTOGG , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_LCTL ,MS_BTN3 ,MS_BTN2 ,MS_BTN1 ,KC_NO , KC_NO ,KC_RSFT ,KC_RCTL ,KC_RALT ,KC_RGUI ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_LGUI ,KC_NO ,KC_NO ,C_DRAG ,KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| + KC_TRNS ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO + //`-----------------------------' `--------------------------' + ), + [_CUST] = LAYOUT_4x6( + //,-------------------------------------------------------. ,--------------------------------------------------------. + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------| |--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , KC_NO , KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO , + //|--------+--------+--------+--------+--------+----------+---------| |--------+--------+--------+--------+-----------+--------+--------| + KC_NO ,KC_NO ,KC_NO , KC_NO ,KC_NO , KC_NO + //`-----------------------------' `--------------------------' + ) +}; + +// clang-format on + +bool process_record_user(uint16_t keycode, keyrecord_t* record) { + switch (keycode) { + case RSFT_T(KC_LBRC): + if (record->tap.count && record->event.pressed) { + tap_code16(S(KC_LBRC)); + return false; + } + break; + + case RCTL_T(KC_RBRC): + if (record->tap.count && record->event.pressed) { + tap_code16(S(KC_RBRC)); + return false; + } + break; + + case C_MINC: + if (record->event.pressed) { + change_pointer_dpi(&global_user_config, true); + debug_config_to_console(&global_user_config); + + return false; + } + break; + + case C_MDEC: + if (record->event.pressed) { + change_pointer_dpi(&global_user_config, false); + debug_config_to_console(&global_user_config); + + return false; + } + break; + + case C_MTOGG: + if (record->event.pressed) { + bool current_state = get_auto_mouse_enable(); + set_auto_mouse_enable(!current_state); + + return false; + } + break; + + case C_DRAG: + if (record->event.pressed) { + set_scrolling = record->event.pressed; + return true; + } + break; + } + + return true; +} + +#ifdef OLED_ENABLE + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (!is_keyboard_master()) { + return OLED_ROTATION_180; + } + + return rotation; +} + +static void render_logo(void) { + static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; + + oled_write_P(qmk_logo, false); +} + +bool oled_task_user(void) { + render_logo(); + + // clang-format off + const char* layer_names[] = { + [_BASE] = "BASE CPI: ", + [_NUM] = "PROG CPI: ", + [_NAV] = "NAVI CPI: ", + [_MEDIA] = "MEDIA CPI: ", + [_FUNC] = "FUNC CPI: ", + [_MOUS] = "MOUSE CPI: ", + [_CUST] = "CUST CPI: ", + }; + // clang-format on + + char cpi_str[6]; + uint16_t current_dpi = get_pointer_dpi(&global_user_config); + + snprintf(cpi_str, sizeof(cpi_str), "%u", (unsigned int)current_dpi); + + oled_write(PSTR(layer_names[get_highest_layer(layer_state)]), false); + oled_write(cpi_str, false); + + return false; +} +#endif /* ifdef OLED_ENABLE */ + +void pointing_device_init_user(void) { + set_auto_mouse_layer(_MOUS); + set_auto_mouse_enable(true); +} diff --git a/keyboards/gggw/crosses/4x6/keymaps/default/rules.mk b/keyboards/gggw/crosses/4x6/keymaps/stock/rules.mk similarity index 100% rename from keyboards/gggw/crosses/4x6/keymaps/default/rules.mk rename to keyboards/gggw/crosses/4x6/keymaps/stock/rules.mk From 38a97b345cf7e9d69f8acb223a844e7f2c08af18 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 01:02:47 -0500 Subject: [PATCH 23/48] dead file --- keymap.json | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 keymap.json diff --git a/keymap.json b/keymap.json deleted file mode 100644 index 7ad4c889f4f..00000000000 --- a/keymap.json +++ /dev/null @@ -1,2 +0,0 @@ -{"keyboard": "gggw/crosses", "keymap": "default", "layout": "LAYOUT_default", "layers": [["KC_Q", "KC_W", "KC_F", "KC_P", "KC_B", "KC_J", "KC_L", "KC_U", "KC_Y", "KC_SCLN", "LGUI_T(KC_A)", "LALT_T(KC_R)", "LCTL_T(KC_S)", "LSFT_T(KC_T)", "KC_G", "KC_M", "RSFT_T(KC_N)", "RCTL_T(KC_E)", "RALT_T(KC_I)", "RGUI_T(KC_O)", "KC_Z", "KC_X", "KC_C", "KC_D", "KC_V", "KC_K", "KC_H", "KC_COMM", "KC_DOT", "LT(3, KC_SLSH)", "MO(5)", "LT(2, KC_ESC)", "KC_SPC", "LT(1, KC_ENT)", "KC_BSPC", "MO(4)"], ["S(KC_8)", "KC_7", "KC_8", "KC_9", "KC_SLSH", "KC_BSLS", "S(KC_9)", "S(KC_0)", "S(KC_BSLS)", "KC_TRNS", "KC_MINS", "KC_4", "KC_5", "LSFT_T(KC_6)", "S(KC_EQL)", "S(KC_5)", "RSFT_T(KC_LBRC)", "RCTL_T(KC_RBRC)", "S(KC_SCLN)", "KC_SCLN", "KC_GRV", "KC_1", "KC_2", "KC_3", "KC_EQL", "KC_LBRC", "KC_RBRC", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_0", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_LGUI", "KC_LALT", "KC_LCTL", "KC_LSFT", "KC_TRNS", "KC_TRNS", "KC_LEFT", "KC_DOWN", "KC_UP", "KC_RGHT", "KC_TRNS", "KC_TRNS", "KC_COPY", "KC_PSTE", "KC_TRNS", "KC_TRNS", "KC_HOME", "KC_END", "KC_PGDN", "KC_PGUP", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_MPRV", "KC_VOLD", "KC_MPLY", "KC_VOLU", "KC_MNXT", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_F11", "KC_F12", "KC_F13", "KC_F14", "KC_F15", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_F6", "KC_F7", "KC_F8", "KC_F9", "KC_F10", "KC_TRNS", "KC_RSFT", "KC_RCTL", "KC_RALT", "KC_RGUI", "KC_F1", "KC_F2", "KC_F3", "KC_F4", "KC_F5", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_LSFT", "KC_LALT", "KC_NO", "KC_NO", "KC_NO", "EE_CLR", "MSE_INC", "MSE_DEC", "KC_NO", "KC_NO", "KC_LCTL", "MS_BTN3", "MS_BTN2", "MS_BTN1", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "DRAG_SCROLL", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "DB_TOGG", "KC_TRNS", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO"]]} - From 4ff33707c27b5192241c967d447d78b8706661a1 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 01:06:31 -0500 Subject: [PATCH 24/48] Delete sweepy --- .../gggw/crosses/3x5/keymaps/sweepy/keymap.c | 192 ------------------ .../gggw/crosses/3x5/keymaps/sweepy/rules.mk | 2 - 2 files changed, 194 deletions(-) delete mode 100644 keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c delete mode 100644 keyboards/gggw/crosses/3x5/keymaps/sweepy/rules.mk diff --git a/keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c deleted file mode 100644 index c14b590ea02..00000000000 --- a/keyboards/gggw/crosses/3x5/keymaps/sweepy/keymap.c +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright 2023 QMK -// SPDX-License-Identifier: GPL-2.0-or-later - -#include QMK_KEYBOARD_H - -#include "lib/crosses.h" - -enum CROSSES_LAYERS { - _BASE, - _MOUS, - _NAV, - _SYM, - _BRC, - _FUNC, - _NUM, - _MISC, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -// ┌───────────┬───────────┬───────────┬──────────┬──────┐ ┌────────────┬──────────┬───────────┬───────────┬───────────┐ -// │ q │ w │ e │ r │ t │ │ y │ u │ i │ o │ p │ -// ├───────────┼───────────┼───────────┼──────────┼──────┤ ├────────────┼──────────┼───────────┼───────────┼───────────┤ -// │ LSFT_T(a) │ LT(5, s) │ LT(1, d) │ LT(3, f) │ g │ │ h │ LT(4, j) │ LT(2, k) │ LT(6, l) │ LSFT_T(;) │ -// ├───────────┼───────────┼───────────┼──────────┼──────┤ ├────────────┼──────────┼───────────┼───────────┼───────────┤ -// │ z │ LCTL_T(x) │ LALT_T(c) │ v │ b │ │ n │ m │ LALT_T(,) │ LCTL_T(.) │ / │ -// └───────────┴───────────┴───────────┼──────────┼──────┼────────────┐ ┌──────┼────────────┼──────────┼───────────┴───────────┴───────────┘ -// │ kp_0 │ bspc │ LT(7, spc) │ │ kp_1 │ LT(7, spc) │ kp_1 │ -// └──────────┴──────┴────────────┘ └──────┴────────────┴──────────┘ -[_BASE] = LAYOUT_default( - KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , - LSFT_T(KC_A) , LT(5, KC_S) , LT(1, KC_D) , LT(3, KC_F) , KC_G , KC_H , LT(4, KC_J) , LT(2, KC_K) , LT(6, KC_L) , LSFT_T(KC_SCLN), - KC_Z , LCTL_T(KC_X) , LALT_T(KC_C) , KC_V , KC_B , KC_N , KC_M , LALT_T(KC_COMM) , LCTL_T(KC_DOT) , KC_SLSH , - KC_P0 , KC_BSPC , LT(7, KC_SPC) , KC_P1 , LT(7, KC_SPC) , KC_P1 -), - -// ┌─────┬──────┬─────┬──────┬─────┐ ┌─────┬──────┬──────┬──────┬──────┐ -// │ │ │ │ │ │ │ │ btn1 │ wh_u │ btn2 │ │ -// ├─────┼──────┼─────┼──────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ -// │ │ btn2 │ no │ btn1 │ │ │ │ ms_l │ ms_d │ ms_u │ ms_r │ -// ├─────┼──────┼─────┼──────┼─────┤ ├─────┼──────┼──────┼──────┼──────┤ -// │ │ │ │ │ │ │ │ wh_l │ wh_d │ wh_r │ │ -// └─────┴──────┴─────┼──────┼─────┼─────┐ ┌─────┼─────┼──────┼──────┴──────┴──────┘ -// │ │ │ │ │ │ no │ no │ -// └──────┴─────┴─────┘ └─────┴─────┴──────┘ -[_MOUS] = LAYOUT_default( - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_BTN1 , KC_WH_U , KC_BTN2 , KC_TRNS, - KC_TRNS , KC_BTN2 , KC_NO , KC_BTN1 , KC_TRNS , KC_TRNS , KC_MS_L , KC_MS_D , KC_MS_U , KC_MS_R, - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_WH_L , KC_WH_D , KC_WH_R , KC_TRNS, - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_NO , KC_NO -), - -// ┌──────┬──────┬──────┬──────┬─────┐ ┌─────┬──────┬─────┬────────────┬───────────┐ -// │ │ │ pgup │ │ │ │ │ │ │ │ │ -// ├──────┼──────┼──────┼──────┼─────┤ ├─────┼──────┼─────┼────────────┼───────────┤ -// │ left │ up │ down │ rght │ │ │ │ lgui │ no │ LCTL(lalt) │ LCA(lsft) │ -// ├──────┼──────┼──────┼──────┼─────┤ ├─────┼──────┼─────┼────────────┼───────────┤ -// │ │ home │ pgdn │ end │ │ │ │ │ │ │ │ -// └──────┴──────┴──────┼──────┼─────┼─────┐ ┌─────┼─────┼──────┼─────┴────────────┴───────────┘ -// │ │ │ │ │ │ no │ no │ -// └──────┴─────┴─────┘ └─────┴─────┴──────┘ -[_NAV] = LAYOUT_default( - KC_TRNS , KC_TRNS , KC_PGUP , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , - KC_LEFT , KC_UP , KC_DOWN , KC_RGHT , KC_TRNS , KC_TRNS , KC_LGUI , KC_NO , LCTL(KC_LALT) , LCA(KC_LSFT), - KC_TRNS , KC_HOME , KC_PGDN , KC_END , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_NO , KC_NO -), - -// ┌─────┬─────┬─────┬─────────┬─────┐ ┌─────┬────┬───┬───┬─────┐ -// │ │ │ │ │ │ │ │ _ │ | │ ' │ │ -// ├─────┼─────┼─────┼─────────┼─────┤ ├─────┼────┼───┼───┼─────┤ -// │ ^ │ * │ & │ no │ │ │ # │ ~ │ / │ " │ $ │ -// ├─────┼─────┼─────┼─────────┼─────┤ ├─────┼────┼───┼───┼─────┤ -// │ │ │ │ │ │ │ │ - │ \ │ ` │ │ -// └─────┴─────┴─────┼─────────┼─────┼─────┐ ┌─────────┼─────┼────┼───┴───┴─────┘ -// │ RM_PREV │ │ │ │ RM_NEXT │ no │ no │ -// └─────────┴─────┴─────┘ └─────────┴─────┴────┘ -[_SYM] = LAYOUT_default( - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_UNDS , KC_PIPE , KC_QUOT , KC_TRNS, - KC_CIRC , KC_ASTR , KC_AMPR , KC_NO , KC_TRNS , KC_HASH , KC_TILD , KC_SLSH , KC_DQUO , KC_DLR , - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_MINS , KC_BSLS , KC_GRV , KC_TRNS, - RM_PREV , KC_TRNS , KC_TRNS , RM_NEXT , KC_NO , KC_NO -), - -// ┌─────┬───┬───┬──────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ -// │ │ : │ < │ > │ ; │ │ │ │ │ │ │ -// ├─────┼───┼───┼──────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ -// │ { │ } │ ( │ ) │ @ │ │ │ no │ = │ + │ % │ -// ├─────┼───┼───┼──────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ -// │ │ ! │ [ │ ] │ │ │ │ │ │ │ │ -// └─────┴───┴───┼──────┼─────┼─────┐ ┌──────┼─────┼─────┼─────┴─────┴─────┘ -// │ vold │ │ │ │ volu │ no │ no │ -// └──────┴─────┴─────┘ └──────┴─────┴─────┘ -[_BRC] = LAYOUT_default( - KC_TRNS , KC_COLN , KC_LT , KC_GT , KC_SCLN , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, - KC_LCBR , KC_RCBR , KC_LPRN , KC_RPRN , KC_AT , KC_TRNS , KC_NO , KC_EQL , KC_PLUS , KC_PERC, - KC_TRNS , KC_EXLM , KC_LBRC , KC_RBRC , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, - KC_VOLD , KC_TRNS , KC_TRNS , KC_VOLU , KC_NO , KC_NO -), - -// ┌─────┬─────┬────────────┬─────┬─────┐ ┌─────┬────┬────┬────┬─────┐ -// │ │ │ │ │ │ │ │ f7 │ f8 │ f9 │ f10 │ -// ├─────┼─────┼────────────┼─────┼─────┤ ├─────┼────┼────┼────┼─────┤ -// │ │ no │ LCTL(lalt) │ │ │ │ │ f4 │ f5 │ f6 │ f11 │ -// ├─────┼─────┼────────────┼─────┼─────┤ ├─────┼────┼────┼────┼─────┤ -// │ │ │ │ │ │ │ │ f1 │ f2 │ f3 │ f12 │ -// └─────┴─────┴────────────┼─────┼─────┼─────┐ ┌─────┼─────┼────┼────┴────┴─────┘ -// │ │ │ │ │ │ no │ no │ -// └─────┴─────┴─────┘ └─────┴─────┴────┘ -[_FUNC] = LAYOUT_default( - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_F7 , KC_F8 , KC_F9 , KC_F10, - KC_TRNS , KC_NO , LCTL(KC_LALT) , KC_TRNS , KC_TRNS , KC_TRNS , KC_F4 , KC_F5 , KC_F6 , KC_F11, - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_F1 , KC_F2 , KC_F3 , KC_F12, - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_NO , KC_NO -), - -// ┌──────┬───┬───┬─────┬──────┐ ┌─────┬─────┬─────┬─────┬─────┐ -// │ kp_/ │ 7 │ 8 │ 9 │ kp_+ │ │ │ │ │ │ │ -// ├──────┼───┼───┼─────┼──────┤ ├─────┼─────┼─────┼─────┼─────┤ -// │ 0 │ 1 │ 2 │ 3 │ kp_- │ │ │ │ │ no │ │ -// ├──────┼───┼───┼─────┼──────┤ ├─────┼─────┼─────┼─────┼─────┤ -// │ kp_* │ 4 │ 5 │ 6 │ kp_= │ │ │ │ │ │ │ -// └──────┴───┴───┼─────┼──────┼─────┐ ┌─────┼─────┼─────┼─────┴─────┴─────┘ -// │ │ │ │ │ │ no │ no │ -// └─────┴──────┴─────┘ └─────┴─────┴─────┘ -[_NUM] = LAYOUT_default( - KC_PSLS , KC_7 , KC_8 , KC_9 , KC_PPLS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, - KC_0 , KC_1 , KC_2 , KC_3 , KC_PMNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_NO , KC_TRNS, - KC_PAST , KC_4 , KC_5 , KC_6 , KC_PEQL , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, - KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_NO , KC_NO -), - -// ┌─────┬─────┬─────┬─────┬─────┐ ┌───────┬──────┬───────────┬───────────┬─────────┐ -// │ │ │ : │ esc │ │ │ │ │ │ │ del │ -// ├─────┼─────┼─────┼─────┼─────┤ ├───────┼──────┼───────────┼───────────┼─────────┤ -// │ │ % │ / │ ent │ │ │ DF(1) │ lgui │ │ │ │ -// ├─────┼─────┼─────┼─────┼─────┤ ├───────┼──────┼───────────┼───────────┼─────────┤ -// │ │ │ │ ! │ │ │ DF(0) │ │ RALT_T(,) │ RCTL_T(.) │ QK_BOOT │ -// └─────┴─────┴─────┼─────┼─────┼────┐ ┌─────┼───────┼──────┼───────────┴───────────┴─────────┘ -// │ │ tab │ no │ │ │ no │ no │ -// └─────┴─────┴────┘ └─────┴───────┴──────┘ -[_MISC] = LAYOUT_default( - KC_TRNS , KC_TRNS , KC_COLN , KC_ESC , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_DEL , - KC_TRNS , KC_PERC , KC_SLSH , KC_ENT , KC_TRNS , DF(1) , KC_LGUI , KC_TRNS , KC_TRNS , KC_TRNS, - KC_TRNS , KC_TRNS , KC_TRNS , KC_EXLM , KC_TRNS , DF(0) , KC_TRNS , RALT_T(KC_COMM) , RCTL_T(KC_DOT) , QK_BOOT, - KC_TRNS , KC_TAB , KC_NO , KC_TRNS , KC_NO , KC_NO -) -}; - -#ifdef OLED_ENABLE - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (!is_keyboard_master()) { - return OLED_ROTATION_180; - } - - return rotation; -} - -static void render_logo(void) { - static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; - - oled_write_P(qmk_logo, false); -} - -bool oled_task_user(void) { - render_logo(); - const char *layer_names[] = { - [ _BASE ] = ">>> BASE ", - [ _MOUS ] = ">>> MOUSE ", - [ _NAV ] = ">>> NAVI ", - [ _SYM ] = ">>> SYM", - [ _BRC ] = ">>> BRC", - [ _FUNC ] = ">>> FUNC ", - [ _NUM ] = ">>> NUM", - [ _MISC ] = ">>> MISC" - }; - - oled_write_P(PSTR(layer_names[get_highest_layer(layer_state)]), false); - return false; -} -#endif /* ifdef OLED_ENABLE */ - -void keyboard_post_init_user(void) { - global_user_config.raw = eeconfig_read_user(); - update_pointer_cpi(&global_user_config); - write_config_to_eeprom(&global_user_config); -} - -void pointing_device_init_user(void) { - set_auto_mouse_layer(_MOUS); - set_auto_mouse_enable(true); -} diff --git a/keyboards/gggw/crosses/3x5/keymaps/sweepy/rules.mk b/keyboards/gggw/crosses/3x5/keymaps/sweepy/rules.mk deleted file mode 100644 index 9d9e625c983..00000000000 --- a/keyboards/gggw/crosses/3x5/keymaps/sweepy/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -COMBO_ENABLE = no -CAPS_WORD_ENABLE = yes From 7bf8e81b15392d58febdc17d5bfbcc3f9daec0c9 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 01:13:15 -0500 Subject: [PATCH 25/48] PR CI catches more than QMK lint. --- keyboards/gggw/crosses/lib/crosses-font.c | 16 ++++++++++++++++ keyboards/gggw/crosses/lib/crosses.h | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/keyboards/gggw/crosses/lib/crosses-font.c b/keyboards/gggw/crosses/lib/crosses-font.c index 04d8239d408..78e865cf283 100644 --- a/keyboards/gggw/crosses/lib/crosses-font.c +++ b/keyboards/gggw/crosses/lib/crosses-font.c @@ -1,3 +1,19 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ #include "progmem.h" static const unsigned char PROGMEM font[] = { diff --git a/keyboards/gggw/crosses/lib/crosses.h b/keyboards/gggw/crosses/lib/crosses.h index 242e872821c..9c2efd2efca 100644 --- a/keyboards/gggw/crosses/lib/crosses.h +++ b/keyboards/gggw/crosses/lib/crosses.h @@ -1,3 +1,19 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ #pragma once #include "quantum.h" From 9d033e2e6ca30ddd2a76458bad71587b0dcd2e99 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 01:16:33 -0500 Subject: [PATCH 26/48] base info --- keyboards/gggw/info.json | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 keyboards/gggw/info.json diff --git a/keyboards/gggw/info.json b/keyboards/gggw/info.json new file mode 100644 index 00000000000..b3b756cc147 --- /dev/null +++ b/keyboards/gggw/info.json @@ -0,0 +1,8 @@ +{ + "manufacturer": "Good Great Grand Wonderful", + "maintainer": "Vincent Franco", + "url": "https://ergokeyboards.com", + "usb": { + "vid": "0x3034" + } +} From b442399e9bb9af6b256e0a7627a3d47b5129fe56 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 10:45:05 -0500 Subject: [PATCH 27/48] Update keyboards/gggw/crosses/config.h Co-authored-by: jack --- keyboards/gggw/crosses/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/gggw/crosses/config.h b/keyboards/gggw/crosses/config.h index 5a8242557bb..70c65c01648 100644 --- a/keyboards/gggw/crosses/config.h +++ b/keyboards/gggw/crosses/config.h @@ -68,9 +68,9 @@ along with this program. If not, see . * Reset */ #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET - #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP17 #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 1000U + #define PERMISSIVE_HOLD #define QUICK_TAP_TERM_PER_KEY From 84030cf84b0fbd42acbb75d9a340f9e48da04ab0 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 10:55:32 -0500 Subject: [PATCH 28/48] fixup --- keyboards/gggw/crosses/3x5/rev1/keyboard.json | 31 ------------------- keyboards/gggw/crosses/3x5/rev2/keyboard.json | 31 ------------------- keyboards/gggw/crosses/3x6/rev1/keyboard.json | 31 ------------------- keyboards/gggw/crosses/3x6/rev2/keyboard.json | 31 ------------------- keyboards/gggw/crosses/4x6/rev1/keyboard.json | 31 ------------------- keyboards/gggw/crosses/4x6/rev2/keyboard.json | 31 ------------------- keyboards/gggw/crosses/config.h | 4 +++ keyboards/gggw/crosses/info.json | 26 ++++++++++++++++ keyboards/gggw/crosses/post_config.h | 4 --- 9 files changed, 30 insertions(+), 190 deletions(-) create mode 100644 keyboards/gggw/crosses/info.json diff --git a/keyboards/gggw/crosses/3x5/rev1/keyboard.json b/keyboards/gggw/crosses/3x5/rev1/keyboard.json index 4802cd0f142..db2dbdb10a4 100644 --- a/keyboards/gggw/crosses/3x5/rev1/keyboard.json +++ b/keyboards/gggw/crosses/3x5/rev1/keyboard.json @@ -1,43 +1,12 @@ { - "manufacturer": "Good Great Grand Wonderful LLC", "keyboard_name": "Crosses 3x5", - "maintainer": "vinniefranco", - "bootloader": "rp2040", - "diode_direction": "COL2ROW", - "features": { - "bootmagic": true, - "command": false, - "console": true, - "extrakey": true, - "mousekey": true, - "nkro": true - }, "matrix_pins": { "cols": ["GP26", "GP22", "GP21", "GP23", "GP20"], "rows": ["GP27", "GP28", "GP29", "GP9"] }, - "processor": "RP2040", - "split": { - "enabled": true, - "serial": { - "driver": "vendor", - "pin": "GP4" - }, - "transport": { - "sync": { - "layer_state": true, - "matrix_state": true - } - } - }, - "tapping": { - "term": 195 - }, - "url": "https://ergokeyboards.com", "usb": { "device_version": "0.3.0", "pid": "0x5647", - "vid": "0x3034" }, "layouts": { "LAYOUT_default": { diff --git a/keyboards/gggw/crosses/3x5/rev2/keyboard.json b/keyboards/gggw/crosses/3x5/rev2/keyboard.json index 7a79d5255bd..d4ef088271b 100644 --- a/keyboards/gggw/crosses/3x5/rev2/keyboard.json +++ b/keyboards/gggw/crosses/3x5/rev2/keyboard.json @@ -1,43 +1,12 @@ { - "manufacturer": "Good Great Grand Wonderful LLC", "keyboard_name": "Crosses 36 Rev2", - "maintainer": "vinniefranco", - "bootloader": "rp2040", - "diode_direction": "COL2ROW", - "features": { - "bootmagic": true, - "command": false, - "console": false, - "extrakey": true, - "mousekey": true, - "nkro": true - }, "matrix_pins": { "cols": ["GP26", "GP22", "GP21", "GP23", "GP20"], "rows": ["GP27", "GP28", "GP29", "GP7"] }, - "processor": "RP2040", - "split": { - "enabled": true, - "serial": { - "driver": "vendor", - "pin": "GP4" - }, - "transport": { - "sync": { - "layer_state": true, - "matrix_state": true - } - } - }, - "tapping": { - "term": 195 - }, - "url": "https://ergokeyboards.com", "usb": { "device_version": "0.3.0", "pid": "0x5657", - "vid": "0x3034" }, "layouts": { "LAYOUT_default": { diff --git a/keyboards/gggw/crosses/3x6/rev1/keyboard.json b/keyboards/gggw/crosses/3x6/rev1/keyboard.json index aaa539783d1..a31879b793a 100644 --- a/keyboards/gggw/crosses/3x6/rev1/keyboard.json +++ b/keyboards/gggw/crosses/3x6/rev1/keyboard.json @@ -1,43 +1,12 @@ { - "manufacturer": "Good Great Grand Wonderful LLC", "keyboard_name": "Crosses 3x6 rev1", - "maintainer": "vinniefranco", - "bootloader": "rp2040", - "diode_direction": "COL2ROW", - "features": { - "bootmagic": true, - "command": false, - "console": true, - "extrakey": true, - "mousekey": true, - "nkro": true - }, "matrix_pins": { "cols": ["GP13", "GP26", "GP22", "GP21", "GP23", "GP20"], "rows": ["GP27", "GP28", "GP29", "GP9"] }, - "processor": "RP2040", - "split": { - "enabled": true, - "serial": { - "driver": "vendor", - "pin": "GP4" - }, - "transport": { - "sync": { - "layer_state": true, - "matrix_state": true - } - } - }, - "tapping": { - "term": 195 - }, - "url": "https://ergokeyboards.com", "usb": { "device_version": "0.3.0", "pid": "0x5648", - "vid": "0x3034" }, "layouts": { "LAYOUT_3x6": { diff --git a/keyboards/gggw/crosses/3x6/rev2/keyboard.json b/keyboards/gggw/crosses/3x6/rev2/keyboard.json index 602f016b78f..96984d68fcb 100644 --- a/keyboards/gggw/crosses/3x6/rev2/keyboard.json +++ b/keyboards/gggw/crosses/3x6/rev2/keyboard.json @@ -1,43 +1,12 @@ { - "manufacturer": "Good Great Grand Wonderful LLC", - "keyboard_name": "Crosses 42 rev2", "maintainer": "vinniefranco", - "bootloader": "rp2040", - "diode_direction": "COL2ROW", - "features": { - "bootmagic": true, - "command": false, - "console": true, - "extrakey": true, - "mousekey": true, - "nkro": true - }, "matrix_pins": { "cols": ["GP1", "GP26", "GP22", "GP21", "GP23", "GP20"], "rows": ["GP27", "GP28", "GP29", "GP7"] }, - "processor": "RP2040", - "split": { - "enabled": true, - "serial": { - "driver": "vendor", - "pin": "GP4" - }, - "transport": { - "sync": { - "layer_state": true, - "matrix_state": true - } - } - }, - "tapping": { - "term": 195 - }, - "url": "https://ergokeyboards.com", "usb": { "device_version": "0.3.0", "pid": "0x5658", - "vid": "0x3034" }, "layouts": { "LAYOUT_3x6": { diff --git a/keyboards/gggw/crosses/4x6/rev1/keyboard.json b/keyboards/gggw/crosses/4x6/rev1/keyboard.json index 24dabaf25a1..04448bc9423 100644 --- a/keyboards/gggw/crosses/4x6/rev1/keyboard.json +++ b/keyboards/gggw/crosses/4x6/rev1/keyboard.json @@ -1,43 +1,12 @@ { - "manufacturer": "Good Great Grand Wonderful LLC", "keyboard_name": "Crosses 4x6 rev1", - "maintainer": "vinniefranco", - "bootloader": "rp2040", - "diode_direction": "COL2ROW", - "features": { - "bootmagic": true, - "command": false, - "console": true, - "extrakey": true, - "mousekey": true, - "nkro": true - }, "matrix_pins": { "cols": ["GP13", "GP26", "GP22", "GP21", "GP23", "GP20"], "rows": ["GP12", "GP27", "GP28", "GP29", "GP9"] }, - "processor": "RP2040", - "split": { - "enabled": true, - "serial": { - "driver": "vendor", - "pin": "GP4" - }, - "transport": { - "sync": { - "layer_state": true, - "matrix_state": true - } - } - }, - "tapping": { - "term": 195 - }, - "url": "https://ergokeyboards.com", "usb": { "device_version": "0.3.0", "pid": "0x5649", - "vid": "0x3034" }, "layouts": { "LAYOUT_4x6": { diff --git a/keyboards/gggw/crosses/4x6/rev2/keyboard.json b/keyboards/gggw/crosses/4x6/rev2/keyboard.json index bb22b964ff5..504d0521c52 100644 --- a/keyboards/gggw/crosses/4x6/rev2/keyboard.json +++ b/keyboards/gggw/crosses/4x6/rev2/keyboard.json @@ -1,43 +1,12 @@ { - "manufacturer": "Good Great Grand Wonderful LLC", "keyboard_name": "Crosses 54 Rev2", - "maintainer": "vinniefranco", - "bootloader": "rp2040", - "diode_direction": "COL2ROW", - "features": { - "bootmagic": true, - "command": false, - "console": true, - "extrakey": true, - "mousekey": true, - "nkro": true - }, "matrix_pins": { "cols": ["GP13", "GP26", "GP22", "GP21", "GP23", "GP20"], "rows": ["GP5", "GP27", "GP28", "GP29", "GP7"] }, - "processor": "RP2040", - "split": { - "enabled": true, - "serial": { - "driver": "vendor", - "pin": "GP4" - }, - "transport": { - "sync": { - "layer_state": true, - "matrix_state": true - } - } - }, - "tapping": { - "term": 195 - }, - "url": "https://ergokeyboards.com", "usb": { "device_version": "0.3.0", "pid": "0x5659", - "vid": "0x3034" }, "layouts": { "LAYOUT_4x6": { diff --git a/keyboards/gggw/crosses/config.h b/keyboards/gggw/crosses/config.h index 70c65c01648..5e4ba7e972e 100644 --- a/keyboards/gggw/crosses/config.h +++ b/keyboards/gggw/crosses/config.h @@ -79,3 +79,7 @@ along with this program. If not, see . */ #define OLED_FONT_H "lib/crosses-font.c" +/* + * Sync + */ +#define SPLIT_TRANSACTION_IDS_KB CROSSES_SECONDARY_SYNC_ID diff --git a/keyboards/gggw/crosses/info.json b/keyboards/gggw/crosses/info.json new file mode 100644 index 00000000000..75702f7c255 --- /dev/null +++ b/keyboards/gggw/crosses/info.json @@ -0,0 +1,26 @@ +{ + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "command": false, + "console": true, + "extrakey": true, + "mousekey": true, + "nkro": true + }, + "processor": "RP2040", + "split": { + "enabled": true, + "serial": { + "driver": "vendor", + "pin": "GP4" + }, + "transport": { + "sync": { + "layer_state": true, + "matrix_state": true + } + } + } +} diff --git a/keyboards/gggw/crosses/post_config.h b/keyboards/gggw/crosses/post_config.h index 9c63c203103..40eb1e1b12c 100644 --- a/keyboards/gggw/crosses/post_config.h +++ b/keyboards/gggw/crosses/post_config.h @@ -16,7 +16,3 @@ along with this program. If not, see . */ #pragma once -/* - * Sync - */ -#define SPLIT_TRANSACTION_IDS_KB CROSSES_SECONDARY_SYNC_ID From 1f46d996141ca60ec6399ad977c281decff7c096 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 11:02:18 -0500 Subject: [PATCH 29/48] fixup --- .../gggw/crosses/3x5/keymaps/default/keymap.c | 2 +- keyboards/gggw/crosses/3x5/rev1/config.h | 17 +++++++++++++++++ keyboards/gggw/crosses/3x5/rev1/keyboard.json | 2 +- keyboards/gggw/crosses/3x5/rev2/keyboard.json | 2 +- keyboards/gggw/crosses/lib/crosses.c | 6 ++++-- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c index 919abd68907..d4d4125f450 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c @@ -4,7 +4,7 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_default( + [0] = LAYOUT( KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , KC_A , KC_R , KC_S , KC_T , KC_G , KC_M , KC_N , KC_E , KC_I , KC_O , KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , KC_SLSH , diff --git a/keyboards/gggw/crosses/3x5/rev1/config.h b/keyboards/gggw/crosses/3x5/rev1/config.h index f9f7a914aa6..449a1f86b8e 100644 --- a/keyboards/gggw/crosses/3x5/rev1/config.h +++ b/keyboards/gggw/crosses/3x5/rev1/config.h @@ -1,3 +1,20 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + /* * OLED */ diff --git a/keyboards/gggw/crosses/3x5/rev1/keyboard.json b/keyboards/gggw/crosses/3x5/rev1/keyboard.json index db2dbdb10a4..a5af389bda6 100644 --- a/keyboards/gggw/crosses/3x5/rev1/keyboard.json +++ b/keyboards/gggw/crosses/3x5/rev1/keyboard.json @@ -9,7 +9,7 @@ "pid": "0x5647", }, "layouts": { - "LAYOUT_default": { + "LAYOUT": { "layout": [ {"matrix": [0, 0], "x": 0, "y": 0.25}, {"matrix": [0, 1], "x": 1, "y": 0.125}, diff --git a/keyboards/gggw/crosses/3x5/rev2/keyboard.json b/keyboards/gggw/crosses/3x5/rev2/keyboard.json index d4ef088271b..d5ab6401e0a 100644 --- a/keyboards/gggw/crosses/3x5/rev2/keyboard.json +++ b/keyboards/gggw/crosses/3x5/rev2/keyboard.json @@ -9,7 +9,7 @@ "pid": "0x5657", }, "layouts": { - "LAYOUT_default": { + "LAYOUT": { "layout": [ {"matrix": [0, 0], "x": 0, "y": 0.25}, {"matrix": [0, 1], "x": 1, "y": 0.125}, diff --git a/keyboards/gggw/crosses/lib/crosses.c b/keyboards/gggw/crosses/lib/crosses.c index ee59d00aaa6..adb1b3b7b55 100644 --- a/keyboards/gggw/crosses/lib/crosses.c +++ b/keyboards/gggw/crosses/lib/crosses.c @@ -39,7 +39,7 @@ const uint16_t MAX_DEFAULT_DPI = 10000; global_user_config_t global_user_config = {0}; void write_config_to_eeprom(global_user_config_t* config) { - eeconfig_update_user(config->raw); + eeconfig_update_kb(config->raw); } uint16_t get_pointer_dpi(global_user_config_t* config) { @@ -213,7 +213,7 @@ void housekeeping_task_kb(void) { } } -void keyboard_post_init_user(void) { +void keyboard_post_init_kb(void) { global_user_config.raw = eeconfig_read_user(); transaction_register_rpc(CROSSES_SECONDARY_SYNC_ID, secondary_sync_handler); @@ -222,4 +222,6 @@ void keyboard_post_init_user(void) { #endif /* ifdef POINTING_DEVICE_* */ write_config_to_eeprom(&global_user_config); + + keyboard_post_init_user(); } From d6dd8ee5dcc648c1ae1c24b71bbe6b0e130cdb39 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 11:07:08 -0500 Subject: [PATCH 30/48] fixup --- keyboards/gggw/crosses/3x5/rev1/keyboard.json | 2 +- keyboards/gggw/crosses/3x5/rev2/keyboard.json | 2 +- keyboards/gggw/crosses/3x6/rev1/keyboard.json | 2 +- keyboards/gggw/crosses/3x6/rev2/keyboard.json | 2 +- keyboards/gggw/crosses/4x6/rev1/keyboard.json | 2 +- keyboards/gggw/crosses/4x6/rev2/keyboard.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/gggw/crosses/3x5/rev1/keyboard.json b/keyboards/gggw/crosses/3x5/rev1/keyboard.json index a5af389bda6..aa94ce2b911 100644 --- a/keyboards/gggw/crosses/3x5/rev1/keyboard.json +++ b/keyboards/gggw/crosses/3x5/rev1/keyboard.json @@ -6,7 +6,7 @@ }, "usb": { "device_version": "0.3.0", - "pid": "0x5647", + "pid": "0x5647" }, "layouts": { "LAYOUT": { diff --git a/keyboards/gggw/crosses/3x5/rev2/keyboard.json b/keyboards/gggw/crosses/3x5/rev2/keyboard.json index d5ab6401e0a..9f0ec4cf7ec 100644 --- a/keyboards/gggw/crosses/3x5/rev2/keyboard.json +++ b/keyboards/gggw/crosses/3x5/rev2/keyboard.json @@ -6,7 +6,7 @@ }, "usb": { "device_version": "0.3.0", - "pid": "0x5657", + "pid": "0x5657" }, "layouts": { "LAYOUT": { diff --git a/keyboards/gggw/crosses/3x6/rev1/keyboard.json b/keyboards/gggw/crosses/3x6/rev1/keyboard.json index a31879b793a..1467d4fe830 100644 --- a/keyboards/gggw/crosses/3x6/rev1/keyboard.json +++ b/keyboards/gggw/crosses/3x6/rev1/keyboard.json @@ -6,7 +6,7 @@ }, "usb": { "device_version": "0.3.0", - "pid": "0x5648", + "pid": "0x5648" }, "layouts": { "LAYOUT_3x6": { diff --git a/keyboards/gggw/crosses/3x6/rev2/keyboard.json b/keyboards/gggw/crosses/3x6/rev2/keyboard.json index 96984d68fcb..982e9082fe3 100644 --- a/keyboards/gggw/crosses/3x6/rev2/keyboard.json +++ b/keyboards/gggw/crosses/3x6/rev2/keyboard.json @@ -6,7 +6,7 @@ }, "usb": { "device_version": "0.3.0", - "pid": "0x5658", + "pid": "0x5658" }, "layouts": { "LAYOUT_3x6": { diff --git a/keyboards/gggw/crosses/4x6/rev1/keyboard.json b/keyboards/gggw/crosses/4x6/rev1/keyboard.json index 04448bc9423..0742133eb90 100644 --- a/keyboards/gggw/crosses/4x6/rev1/keyboard.json +++ b/keyboards/gggw/crosses/4x6/rev1/keyboard.json @@ -6,7 +6,7 @@ }, "usb": { "device_version": "0.3.0", - "pid": "0x5649", + "pid": "0x5649" }, "layouts": { "LAYOUT_4x6": { diff --git a/keyboards/gggw/crosses/4x6/rev2/keyboard.json b/keyboards/gggw/crosses/4x6/rev2/keyboard.json index 504d0521c52..6aa88f63bbe 100644 --- a/keyboards/gggw/crosses/4x6/rev2/keyboard.json +++ b/keyboards/gggw/crosses/4x6/rev2/keyboard.json @@ -6,7 +6,7 @@ }, "usb": { "device_version": "0.3.0", - "pid": "0x5659", + "pid": "0x5659" }, "layouts": { "LAYOUT_4x6": { From f48fe8cc33f8192dc1a649fbf627bea3a82a8620 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 11:19:20 -0500 Subject: [PATCH 31/48] fixup --- .../gggw/crosses/3x5/keymaps/stock/keymap.c | 32 +- .../gggw/crosses/3x6/keymaps/stock/keymap.c | 3 - .../gggw/crosses/4x6/keymaps/stock/keymap.c | 2 - keyboards/gggw/crosses/config.h | 2 +- .../gggw/crosses/{lib => }/crosses-font.c | 0 keyboards/gggw/crosses/{lib => }/crosses.c | 0 keyboards/gggw/crosses/{lib => }/crosses.h | 17 - keyboards/gggw/crosses/lib/achordion.c | 364 ------------------ keyboards/gggw/crosses/lib/achordion.h | 191 --------- keyboards/gggw/crosses/post_config.h | 18 - keyboards/gggw/crosses/rules.mk | 4 - 11 files changed, 7 insertions(+), 626 deletions(-) rename keyboards/gggw/crosses/{lib => }/crosses-font.c (100%) rename keyboards/gggw/crosses/{lib => }/crosses.c (100%) rename keyboards/gggw/crosses/{lib => }/crosses.h (89%) delete mode 100644 keyboards/gggw/crosses/lib/achordion.c delete mode 100644 keyboards/gggw/crosses/lib/achordion.h delete mode 100644 keyboards/gggw/crosses/post_config.h diff --git a/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c index 52acd596d0f..3e638e051fa 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c @@ -3,9 +3,6 @@ #include QMK_KEYBOARD_H -#include "lib/achordion.h" -#include "lib/crosses.h" - /* * Keycodes, combos, and layers! oh my! */ @@ -89,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // └───────────┴───────────┴───────────┼───────────┼────────────┼─────┐ ┌────────────┼──────┼────────────┼───────────┴───────────┴───────────┘ // │ MO(5) │ LT(2, esc) │ spc │ │ LT(1, ent) │ bspc │ LT(4, del) │ // └───────────┴────────────┴─────┘ └────────────┴──────┴────────────┘ -[_BASE] = LAYOUT_default( +[_BASE] = LAYOUT( KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , LGUI_T(KC_A) , LALT_T(KC_R) , LCTL_T(KC_S) , LSFT_T(KC_T) , KC_G , KC_M , RSFT_T(KC_N) , RCTL_T(KC_E) , RALT_T(KC_I) , RGUI_T(KC_O) , KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , LT(3, KC_SLSH), @@ -105,7 +102,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // └──────┴───┴───┼───────────┼──────┼─────┐ ┌─────┼──────┼───────────┼───────────┴──────┴─────┘ // │ │ 0 │ │ │ │ │ │ // └───────────┴──────┴─────┘ └─────┴──────┴───────────┘ -[_NUM] = LAYOUT_default( +[_NUM] = LAYOUT( S(KC_8) , KC_7 , KC_8 , KC_9 , KC_SLSH , KC_BSLS , S(KC_9) , S(KC_0) , S(KC_BSLS) , KC_TRNS, KC_MINS , KC_4 , KC_5 , LSFT_T(KC_6) , S(KC_EQL) , S(KC_5) , RSFT_T(KC_LBRC) , RCTL_T(KC_RBRC) , S(KC_SCLN) , KC_SCLN, KC_GRV , KC_1 , KC_2 , KC_3 , KC_EQL , KC_LBRC , KC_RBRC , KC_TRNS , KC_TRNS , KC_TRNS, @@ -121,7 +118,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // └──────┴──────┴──────┼───────┼────┼────┐ ┌────┼────┼──────┼──────┴──────┴──────┘ // │ no │ no │ no │ │ no │ no │ no │ // └───────┴────┴────┘ └────┴────┴──────┘ -[_NAV] = LAYOUT_default( +[_NAV] = LAYOUT( KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_LGUI , KC_LALT , KC_LCTL , KC_LSFT , KC_NO , KC_NO , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT, KC_NO , KC_NO , KC_COPY , KC_PSTE , KC_NO , KC_NO , KC_HOME , KC_END , KC_PGDN , KC_PGUP, @@ -137,7 +134,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // └──────┴──────┴──────┼──────┼──────┼────┐ ┌────┼────┼────┼────┴────┴────┘ // │ no │ no │ no │ │ no │ no │ no │ // └──────┴──────┴────┘ └────┴────┴────┘ -[_MEDIA] = LAYOUT_default( +[_MEDIA] = LAYOUT( KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, KC_MPRV , KC_VOLD , KC_MPLY , KC_VOLU , KC_MNXT , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, @@ -153,7 +150,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼──────┼──────┴──────┴──────┘ // │ │ │ │ │ │ │ │ // └─────┴─────┴─────┘ └─────┴─────┴──────┘ -[_FUNC] = LAYOUT_default( +[_FUNC] = LAYOUT( KC_F11 , KC_F12 , KC_F13 , KC_F14 , KC_F15 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_TRNS , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, @@ -169,7 +166,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // └──────┴─────────┴─────────┼─────────────┼────┼────┐ ┌────┼────────┼─────────┼─────────┴──────────┴─────────┘ // │ │ no │ no │ │ no │ no │ no │ // └─────────────┴────┴────┘ └────┴────────┴─────────┘ -[_MOUS] = LAYOUT_default( +[_MOUS] = LAYOUT( KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , EE_CLR , MSE_INC , MSE_DEC , KC_NO , KC_NO , KC_NO , MS_BTN3 , MS_BTN2 , MS_BTN1 , KC_NO , KC_NO , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, KC_NO , KC_NO , KC_NO , DRAG_SCROLL , KC_NO , KC_NO , KC_NO , KC_NO , MSE_TOGG , DB_TOGG, @@ -180,9 +177,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // clang-format on bool process_record_user(uint16_t keycode, keyrecord_t* record) { - if (!process_achordion(keycode, record)) { - return false; - } switch (keycode) { case RSFT_T(KC_LBRC): if (record->tap.count && record->event.pressed) { @@ -274,20 +268,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { return true; } -bool achordion_chord(uint16_t tap_hold_keycode, keyrecord_t* tap_hold_record, uint16_t other_keycode, keyrecord_t* other_record) { - switch (tap_hold_keycode) { - case 0x4128: - return true; - break; - } - - return achordion_opposite_hands(tap_hold_record, other_record); -} - -void matrix_scan_user(void) { - achordion_task(); -} - #ifdef OLED_ENABLE oled_rotation_t oled_init_user(oled_rotation_t rotation) { diff --git a/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c b/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c index 55b913591c9..46402e1e77b 100644 --- a/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c +++ b/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c @@ -4,9 +4,6 @@ #include "action_layer.h" #include QMK_KEYBOARD_H -#include "lib/achordion.h" -#include "lib/crosses.h" - /* * Keycodes, combos, and layers! oh my! */ diff --git a/keyboards/gggw/crosses/4x6/keymaps/stock/keymap.c b/keyboards/gggw/crosses/4x6/keymaps/stock/keymap.c index 3c75e8a36f3..bffd93eb7b5 100644 --- a/keyboards/gggw/crosses/4x6/keymaps/stock/keymap.c +++ b/keyboards/gggw/crosses/4x6/keymaps/stock/keymap.c @@ -3,8 +3,6 @@ #include QMK_KEYBOARD_H -#include "lib/crosses.h" - /* * Keycodes, combos, and layers! oh my! */ diff --git a/keyboards/gggw/crosses/config.h b/keyboards/gggw/crosses/config.h index 5e4ba7e972e..098d88ccc4a 100644 --- a/keyboards/gggw/crosses/config.h +++ b/keyboards/gggw/crosses/config.h @@ -77,7 +77,7 @@ along with this program. If not, see . /* * Font */ -#define OLED_FONT_H "lib/crosses-font.c" +#define OLED_FONT_H "crosses-font.c" /* * Sync diff --git a/keyboards/gggw/crosses/lib/crosses-font.c b/keyboards/gggw/crosses/crosses-font.c similarity index 100% rename from keyboards/gggw/crosses/lib/crosses-font.c rename to keyboards/gggw/crosses/crosses-font.c diff --git a/keyboards/gggw/crosses/lib/crosses.c b/keyboards/gggw/crosses/crosses.c similarity index 100% rename from keyboards/gggw/crosses/lib/crosses.c rename to keyboards/gggw/crosses/crosses.c diff --git a/keyboards/gggw/crosses/lib/crosses.h b/keyboards/gggw/crosses/crosses.h similarity index 89% rename from keyboards/gggw/crosses/lib/crosses.h rename to keyboards/gggw/crosses/crosses.h index 9c2efd2efca..da81ad479a7 100644 --- a/keyboards/gggw/crosses/lib/crosses.h +++ b/keyboards/gggw/crosses/crosses.h @@ -18,13 +18,6 @@ along with this program. If not, see . #include "quantum.h" -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef CROSSES_CORE_H -# define CROSSES_CORE_H - /* * Pointer Storage */ @@ -50,10 +43,6 @@ void change_pointer_dpi(global_user_config_t* config, bool inc); void debug_config_to_console(global_user_config_t* config); -void eeconfig_init_user(void); - -void keyboard_post_init_user(void); - /* * Pointing Device Config */ @@ -72,9 +61,3 @@ report_mouse_t pointing_device_task_combined_user(report_mouse_t left_report, re # endif // POINTINTG_DEVICE_COMBINED layer_state_t layer_state_set_user(layer_state_t state); - -#endif // CROSSES_CORE_H - -#ifdef __cplusplus -} -#endif diff --git a/keyboards/gggw/crosses/lib/achordion.c b/keyboards/gggw/crosses/lib/achordion.c deleted file mode 100644 index 91e545e1466..00000000000 --- a/keyboards/gggw/crosses/lib/achordion.c +++ /dev/null @@ -1,364 +0,0 @@ -// Copyright 2022-2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file achordion.c - * @brief Achordion implementation - * - * For full documentation, see - * - */ - -#include "achordion.h" - -#if !defined(IS_QK_MOD_TAP) -// Attempt to detect out-of-date QMK installation, which would fail with -// implicit-function-declaration errors in the code below. -# error "achordion: QMK version is too old to build. Please update QMK." -#else - -// Copy of the `record` and `keycode` args for the current active tap-hold key. -static keyrecord_t tap_hold_record; -static uint16_t tap_hold_keycode = KC_NO; -// Timeout timer. When it expires, the key is considered held. -static uint16_t hold_timer = 0; -// Eagerly applied mods, if any. -static uint8_t eager_mods = 0; -// Flag to determine whether another key is pressed within the timeout. -static bool pressed_another_key_before_release = false; - -# ifdef ACHORDION_STREAK -// Timer for typing streak -static uint16_t streak_timer = 0; -# else -// When disabled, is_streak is never true -# define is_streak false -# endif - -// Achordion's current state. -enum { - // A tap-hold key is pressed, but hasn't yet been settled as tapped or held. - STATE_UNSETTLED, - // Achordion is inactive. - STATE_RELEASED, - // Active tap-hold key has been settled as tapped. - STATE_TAPPING, - // Active tap-hold key has been settled as held. - STATE_HOLDING, - // This state is set while calling `process_record()`, which will recursively - // call `process_achordion()`. This state is checked so that we don't process - // events generated by Achordion and potentially create an infinite loop. - STATE_RECURSING, -}; -static uint8_t achordion_state = STATE_RELEASED; - -# ifdef ACHORDION_STREAK -static void update_streak_timer(uint16_t keycode, keyrecord_t* record) { - if (achordion_streak_continue(keycode)) { - // We use 0 to represent an unset timer, so `| 1` to force a nonzero value. - streak_timer = record->event.time | 1; - } else { - streak_timer = 0; - } -} -# endif - -// Presses or releases eager_mods through process_action(), which skips the -// usual event handling pipeline. The action is considered as a mod-tap hold or -// release, with Retro Tapping if enabled. -static void process_eager_mods_action(void) { - action_t action; - action.code = ACTION_MODS_TAP_KEY(eager_mods, QK_MOD_TAP_GET_TAP_KEYCODE(tap_hold_keycode)); - process_action(&tap_hold_record, action); -} - -// Calls `process_record()` with state set to RECURSING. -static void recursively_process_record(keyrecord_t* record, uint8_t state) { - achordion_state = STATE_RECURSING; -# if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) - int8_t mouse_key_tracker = get_auto_mouse_key_tracker(); -# endif - process_record(record); -# if defined(POINTING_DEVICE_ENABLE) && defined(POINTING_DEVICE_AUTO_MOUSE_ENABLE) - set_auto_mouse_key_tracker(mouse_key_tracker); -# endif - achordion_state = state; -} - -// Sends hold press event and settles the active tap-hold key as held. -static void settle_as_hold(void) { - if (eager_mods) { - // If eager mods are being applied, nothing needs to be done besides - // updating the state. - dprintln("Achordion: Settled eager mod as hold."); - achordion_state = STATE_HOLDING; - } else { - // Create hold press event. - dprintln("Achordion: Plumbing hold press."); - recursively_process_record(&tap_hold_record, STATE_HOLDING); - } -} - -// Sends tap press and release and settles the active tap-hold key as tapped. -static void settle_as_tap(void) { - if (eager_mods) { // Clear eager mods if set. -# if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) -# ifdef DUMMY_MOD_NEUTRALIZER_KEYCODE - neutralize_flashing_modifiers(get_mods()); -# endif // DUMMY_MOD_NEUTRALIZER_KEYCODE -# endif // defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) - tap_hold_record.event.pressed = false; - // To avoid falsely triggering Retro Tapping, process eager mods release as - // a regular mods release rather than a mod-tap release. - action_t action; - action.code = ACTION_MODS(eager_mods); - process_action(&tap_hold_record, action); - eager_mods = 0; - } - - dprintln("Achordion: Plumbing tap press."); - tap_hold_record.event.pressed = true; - tap_hold_record.tap.count = 1; // Revise event as a tap. - tap_hold_record.tap.interrupted = true; - // Plumb tap press event. - recursively_process_record(&tap_hold_record, STATE_TAPPING); - - send_keyboard_report(); -# if TAP_CODE_DELAY > 0 - wait_ms(TAP_CODE_DELAY); -# endif // TAP_CODE_DELAY > 0 - - dprintln("Achordion: Plumbing tap release."); - tap_hold_record.event.pressed = false; - // Plumb tap release event. - recursively_process_record(&tap_hold_record, STATE_TAPPING); -} - -bool process_achordion(uint16_t keycode, keyrecord_t* record) { - // Don't process events that Achordion generated. - if (achordion_state == STATE_RECURSING) { - return true; - } - - // Determine whether the current event is for a mod-tap or layer-tap key. - const bool is_mt = IS_QK_MOD_TAP(keycode); - const bool is_tap_hold = is_mt || IS_QK_LAYER_TAP(keycode); - // Check that this is a normal key event, don't act on combos. - const bool is_key_event = IS_KEYEVENT(record->event); - - // Event while no tap-hold key is active. - if (achordion_state == STATE_RELEASED) { - if (is_tap_hold && record->tap.count == 0 && record->event.pressed && is_key_event) { - // A tap-hold key is pressed and considered by QMK as "held". - const uint16_t timeout = achordion_timeout(keycode); - if (timeout > 0) { - achordion_state = STATE_UNSETTLED; - // Save info about this key. - tap_hold_keycode = keycode; - tap_hold_record = *record; - hold_timer = record->event.time + timeout; - pressed_another_key_before_release = false; - eager_mods = 0; - - if (is_mt) { // Apply mods immediately if they are "eager." - const uint8_t mod = mod_config(QK_MOD_TAP_GET_MODS(keycode)); - if ( -# if defined(CAPS_WORD_ENABLE) && defined(CAPS_WORD_INVERT_ON_SHIFT) - // Since eager mods bypass normal event handling, eager Shift does - // not work with CAPS_WORD_INVERT_ON_SHIFT. So if this option is - // enabled, we don't apply Shift eagerly when Caps Word is on. - !(is_caps_word_on() && (mod & MOD_LSFT) != 0) && -# endif // defined(CAPS_WORD_ENABLE) && defined(CAPS_WORD_INVERT_ON_SHIFT) - achordion_eager_mod(mod)) { - eager_mods = mod; - process_eager_mods_action(); - } - } - - dprintf("Achordion: Key 0x%04X pressed.%s\n", keycode, eager_mods ? " Set eager mods." : ""); - return false; // Skip default handling. - } - } - -# ifdef ACHORDION_STREAK - update_streak_timer(keycode, record); -# endif - return true; // Otherwise, continue with default handling. - } else if (record->event.pressed && tap_hold_keycode != keycode) { - // Track whether another key was pressed while using a tap-hold key. - pressed_another_key_before_release = true; - } - - // Release of the active tap-hold key. - if (keycode == tap_hold_keycode && !record->event.pressed) { - if (eager_mods) { - dprintln("Achordion: Key released. Clearing eager mods."); - tap_hold_record.event.pressed = false; - process_eager_mods_action(); - } else if (achordion_state == STATE_HOLDING) { - dprintln("Achordion: Key released. Plumbing hold release."); - tap_hold_record.event.pressed = false; - // Plumb hold release event. - recursively_process_record(&tap_hold_record, STATE_RELEASED); - } else if (!pressed_another_key_before_release) { - // No other key was pressed between the press and release of the tap-hold - // key, plumb a hold press and then a release. - dprintln("Achordion: Key released. Plumbing hold press and release."); - recursively_process_record(&tap_hold_record, STATE_HOLDING); - tap_hold_record.event.pressed = false; - recursively_process_record(&tap_hold_record, STATE_RELEASED); - } else { - dprintln("Achordion: Key released."); - } - - achordion_state = STATE_RELEASED; - tap_hold_keycode = KC_NO; - return false; - } - - if (achordion_state == STATE_UNSETTLED && record->event.pressed) { -# ifdef ACHORDION_STREAK - const uint16_t s_timeout = achordion_streak_chord_timeout(tap_hold_keycode, keycode); - const bool is_streak = streak_timer && s_timeout && !timer_expired(record->event.time, (streak_timer + s_timeout)); -# endif - - // Press event occurred on a key other than the active tap-hold key. - - // If the other key is *also* a tap-hold key and considered by QMK to be - // held, then we settle the active key as held. This way, things like - // chording multiple home row modifiers will work, but let's our logic - // consider simply a single tap-hold key as "active" at a time. - // - // Otherwise, we call `achordion_chord()` to determine whether to settle the - // tap-hold key as tapped vs. held. We implement the tap or hold by plumbing - // events back into the handling pipeline so that QMK features and other - // user code can see them. This is done by calling `process_record()`, which - // in turn calls most handlers including `process_record_user()`. - if (!is_streak && (!is_key_event || (is_tap_hold && record->tap.count == 0) || achordion_chord(tap_hold_keycode, &tap_hold_record, keycode, record))) { - settle_as_hold(); - -# ifdef REPEAT_KEY_ENABLE - // Edge case involving LT + Repeat Key: in a sequence of "LT down, other - // down" where "other" is on the other layer in the same position as - // Repeat or Alternate Repeat, the repeated keycode is set instead of the - // the one on the switched-to layer. Here we correct that. - if (get_repeat_key_count() != 0 && IS_QK_LAYER_TAP(tap_hold_keycode)) { - record->keycode = KC_NO; // Forget the repeated keycode. - clear_weak_mods(); - } -# endif // REPEAT_KEY_ENABLE - } else { - settle_as_tap(); - -# ifdef ACHORDION_STREAK - update_streak_timer(keycode, record); - if (is_streak && is_key_event && is_tap_hold && record->tap.count == 0) { - // If we are in a streak and resolved the current tap-hold key as a tap - // consider the next tap-hold key as active to be resolved next. - update_streak_timer(tap_hold_keycode, &tap_hold_record); - const uint16_t timeout = achordion_timeout(keycode); - tap_hold_keycode = keycode; - tap_hold_record = *record; - hold_timer = record->event.time + timeout; - achordion_state = STATE_UNSETTLED; - pressed_another_key_before_release = false; - return false; - } -# endif - } - - recursively_process_record(record, achordion_state); // Re-process event. - return false; // Block the original event. - } - -# ifdef ACHORDION_STREAK - // update idle timer on regular keys event - update_streak_timer(keycode, record); -# endif - return true; -} - -void achordion_task(void) { - if (achordion_state == STATE_UNSETTLED && timer_expired(timer_read(), hold_timer)) { - settle_as_hold(); // Timeout expired, settle the key as held. - } - -# ifdef ACHORDION_STREAK -# define MAX_STREAK_TIMEOUT 800 - if (streak_timer && timer_expired(timer_read(), (streak_timer + MAX_STREAK_TIMEOUT))) { - streak_timer = 0; // Expired. - } -# endif -} - -// Returns true if `pos` on the left hand of the keyboard, false if right. -static bool on_left_hand(keypos_t pos) { -# ifdef SPLIT_KEYBOARD - return pos.row < MATRIX_ROWS / 2; -# else - return (MATRIX_COLS > MATRIX_ROWS) ? pos.col < MATRIX_COLS / 2 : pos.row < MATRIX_ROWS / 2; -# endif -} - -bool achordion_opposite_hands(const keyrecord_t* tap_hold_record, const keyrecord_t* other_record) { - return on_left_hand(tap_hold_record->event.key) != on_left_hand(other_record->event.key); -} - -// By default, use the BILATERAL_COMBINATIONS rule to consider the tap-hold key -// "held" only when it and the other key are on opposite hands. -__attribute__((weak)) bool achordion_chord(uint16_t tap_hold_keycode, keyrecord_t* tap_hold_record, uint16_t other_keycode, keyrecord_t* other_record) { - return achordion_opposite_hands(tap_hold_record, other_record); -} - -// By default, the timeout is 1000 ms for all keys. -__attribute__((weak)) uint16_t achordion_timeout(uint16_t tap_hold_keycode) { - return 1000; -} - -// By default, Shift and Ctrl mods are eager, and Alt and GUI are not. -__attribute__((weak)) bool achordion_eager_mod(uint8_t mod) { - return (mod & (MOD_LALT | MOD_LGUI)) == 0; -} - -# ifdef ACHORDION_STREAK -__attribute__((weak)) bool achordion_streak_continue(uint16_t keycode) { - // If any mods other than shift or AltGr are held, don't continue the streak - if (get_mods() & (MOD_MASK_CG | MOD_BIT_LALT)) return false; - // This function doesn't get called for holds, so convert to tap version of - // keycodes - if (IS_QK_MOD_TAP(keycode)) keycode = QK_MOD_TAP_GET_TAP_KEYCODE(keycode); - if (IS_QK_LAYER_TAP(keycode)) keycode = QK_LAYER_TAP_GET_TAP_KEYCODE(keycode); - // Regular letters and punctuation continue the streak. - if (keycode >= KC_A && keycode <= KC_Z) return true; - switch (keycode) { - case KC_DOT: - case KC_COMMA: - case KC_QUOTE: - case KC_SPACE: - return true; - } - // All other keys end the streak - return false; -} - -__attribute__((weak)) uint16_t achordion_streak_chord_timeout(uint16_t tap_hold_keycode, uint16_t next_keycode) { - return achordion_streak_timeout(tap_hold_keycode); -} - -__attribute__((weak)) uint16_t achordion_streak_timeout(uint16_t tap_hold_keycode) { - return 200; -} -# endif - -#endif // version check diff --git a/keyboards/gggw/crosses/lib/achordion.h b/keyboards/gggw/crosses/lib/achordion.h deleted file mode 100644 index 775390eb19d..00000000000 --- a/keyboards/gggw/crosses/lib/achordion.h +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright 2022-2024 Google LLC -// -// -// Licensed under the Apache License, Version 1.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @file achordion.h - * @brief Achordion: Customizing the tap-hold decision. - * - * Overview - * -------- - * - * This library customizes when tap-hold keys are considered held vs. tapped - * based on the next pressed key, like Manna Harbour's Bilateral Combinations or - * ZMK's positional hold. The library works on top of QMK's existing tap-hold - * implementation. You define mod-tap and layer-tap keys as usual and use - * Achordion to fine-tune the behavior. - * - * When QMK settles a tap-hold key as held, Achordion intercepts the event. - * Achordion then revises the event as a tap or passes it along as a hold: - * - * * Chord condition: On the next key press, a customizable `achordion_chord()` - * function is called, which takes the tap-hold key and the next key pressed - * as args. When the function returns true, the tap-hold key is settled as - * held, and otherwise as tapped. - * - * * Timeout: If no other key press occurs within a timeout, the tap-hold key - * is settled as held. This is customizable with `achordion_timeout()`. - * - * Achordion only changes the behavior when QMK considered the key held. It - * changes some would-be holds to taps, but no taps to holds. - * - * @note Some QMK features handle events before the point where Achordion can - * intercept them, particularly: Combos, Key Lock, and Dynamic Macros. It's - * still possible to use these features and Achordion in your keymap, but beware - * they might behave poorly when used simultaneously with tap-hold keys. - * - * - * For full documentation, see - * - */ - -#pragma once - -#include "quantum.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Handler function for Achordion. - * - * Call this function from `process_record_user()` as - * - * #include "features/achordion.h" - * - * bool process_record_user(uint16_t keycode, keyrecord_t* record) { - * if (!process_achordion(keycode, record)) { return false; } - * // Your macros... - * return true; - * } - */ -bool process_achordion(uint16_t keycode, keyrecord_t* record); - -/** - * Matrix task function for Achordion. - * - * Call this function from `matrix_scan_user()` as - * - * void matrix_scan_user(void) { - * achordion_task(); - * } - */ -void achordion_task(void); - -/** - * Optional callback to customize which key chords are considered "held". - * - * In your keymap.c, define the callback - * - * bool achordion_chord(uint16_t tap_hold_keycode, - * keyrecord_t* tap_hold_record, - * uint16_t other_keycode, - * keyrecord_t* other_record) { - * // Conditions... - * } - * - * This callback is called if while `tap_hold_keycode` is pressed, - * `other_keycode` is pressed. Return true if the tap-hold key should be - * considered held, or false to consider it tapped. - * - * @param tap_hold_keycode Keycode of the tap-hold key. - * @param tap_hold_record keyrecord_t from the tap-hold press event. - * @param other_keycode Keycode of the other key. - * @param other_record keyrecord_t from the other key's press event. - * @return True if the tap-hold key should be considered held. - */ -bool achordion_chord(uint16_t tap_hold_keycode, keyrecord_t* tap_hold_record, uint16_t other_keycode, keyrecord_t* other_record); - -/** - * Optional callback to define a timeout duration per keycode. - * - * In your keymap.c, define the callback - * - * uint16_t achordion_timeout(uint16_t tap_hold_keycode) { - * // ... - * } - * - * The callback determines Achordion's timeout duration for `tap_hold_keycode` - * in units of milliseconds. The timeout be in the range 0 to 32767 ms (upper - * bound is due to 16-bit timer limitations). Use a timeout of 0 to bypass - * Achordion. - * - * @param tap_hold_keycode Keycode of the tap-hold key. - * @return Timeout duration in milliseconds in the range 0 to 32767. - */ -uint16_t achordion_timeout(uint16_t tap_hold_keycode); - -/** - * Optional callback defining which mods are "eagerly" applied. - * - * This callback defines which mods are "eagerly" applied while a mod-tap - * key is still being settled. This is helpful to reduce delay particularly when - * using mod-tap keys with an external mouse. - * - * Define this callback in your keymap.c. The default callback is eager for - * Shift and Ctrl, and not for Alt and GUI: - * - * bool achordion_eager_mod(uint8_t mod) { - * return (mod & (MOD_LALT | MOD_LGUI)) == 0; - * } - * - * @note `mod` should be compared with `MOD_` prefixed codes, not `KC_` codes, - * described at . - * - * @param mod Modifier `MOD_` code. - * @return True if the modifier should be eagerly applied. - */ -bool achordion_eager_mod(uint8_t mod); - -/** - * Returns true if the args come from keys on opposite hands. - * - * @param tap_hold_record keyrecord_t from the tap-hold key's event. - * @param other_record keyrecord_t from the other key's event. - * @return True if the keys are on opposite hands. - */ -bool achordion_opposite_hands(const keyrecord_t* tap_hold_record, const keyrecord_t* other_record); - -/** - * Suppress tap-hold mods within a *typing streak* by defining - * ACHORDION_STREAK. This can help preventing accidental mod - * activation when performing a fast tapping sequence. - * This is inspired by - * https://sunaku.github.io/home-row-mods.html#typing-streaks - * - * Enable with: - * - * #define ACHORDION_STREAK - * - * Adjust the maximum time between key events before modifiers can be enabled - * by defining the following callback in your keymap.c: - * - * uint16_t achordion_streak_chord_timeout( - * uint16_t tap_hold_keycode, uint16_t next_keycode) { - * return 200; // Default of 200 ms. - * } - */ -#ifdef ACHORDION_STREAK -uint16_t achordion_streak_chord_timeout(uint16_t tap_hold_keycode, uint16_t next_keycode); - -bool achordion_streak_continue(uint16_t keycode); - -/** @deprecated Use `achordion_streak_chord_timeout()` instead. */ -uint16_t achordion_streak_timeout(uint16_t tap_hold_keycode); -#endif - -#ifdef __cplusplus -} -#endif diff --git a/keyboards/gggw/crosses/post_config.h b/keyboards/gggw/crosses/post_config.h deleted file mode 100644 index 40eb1e1b12c..00000000000 --- a/keyboards/gggw/crosses/post_config.h +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2025 Vincent Franco - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#pragma once - diff --git a/keyboards/gggw/crosses/rules.mk b/keyboards/gggw/crosses/rules.mk index 4aa66610b68..9df91a3b72f 100644 --- a/keyboards/gggw/crosses/rules.mk +++ b/keyboards/gggw/crosses/rules.mk @@ -1,6 +1,2 @@ POINTING_DEVICE_ENABLE = yes OLED_ENABLE = yes - -SRC += lib/achordion.c -SRC += lib/crosses.c -WEAR_LEVELING_DRIVER = rp2040_flash From 9979420deb19a93979ee6ca6280a16d08379fd62 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 11:22:53 -0500 Subject: [PATCH 32/48] Imgur --- keyboards/gggw/crosses/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/gggw/crosses/readme.md b/keyboards/gggw/crosses/readme.md index 95b8c867440..14b3b8f2a5a 100644 --- a/keyboards/gggw/crosses/readme.md +++ b/keyboards/gggw/crosses/readme.md @@ -1,6 +1,6 @@ # Crosses by Good Great Grand Wonderful -![crosses](https://ergokeyboards.com/cdn/shop/files/3x5-dual-tb-oled.png) +![crosses](https://i.imgur.com/LWiT2bD.png) Our thumbs evolved to give us dexterity; shouldn't our keyboards evolve with them? From 0dd330458c6029ad69a33c82ab89f186eb3e093d Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 11:30:20 -0500 Subject: [PATCH 33/48] Removing vestigal remains of achordian --- .../gggw/crosses/3x6/keymaps/stock/keymap.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c b/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c index 46402e1e77b..31f5fd6ee09 100644 --- a/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c +++ b/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c @@ -177,9 +177,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // clang-format on bool process_record_user(uint16_t keycode, keyrecord_t* record) { - if (!process_achordion(keycode, record)) { - return false; - } switch (keycode) { case RSFT_T(KC_LBRC): if (record->tap.count && record->event.pressed) { @@ -259,20 +256,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { return true; } -bool achordion_chord(uint16_t tap_hold_keycode, keyrecord_t* tap_hold_record, uint16_t other_keycode, keyrecord_t* other_record) { - switch (tap_hold_keycode) { - case 0x4128: - return true; - break; - } - - return achordion_opposite_hands(tap_hold_record, other_record); -} - -void matrix_scan_user(void) { - achordion_task(); -} - #ifdef OLED_ENABLE oled_rotation_t oled_init_user(oled_rotation_t rotation) { From 3433b426c16295459dc3681ecdeb8873c66e7c0a Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 15:46:19 -0500 Subject: [PATCH 34/48] rules to features --- keyboards/gggw/crosses/crosses.c | 2 +- keyboards/gggw/crosses/info.json | 4 +++- keyboards/gggw/crosses/rules.mk | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 keyboards/gggw/crosses/rules.mk diff --git a/keyboards/gggw/crosses/crosses.c b/keyboards/gggw/crosses/crosses.c index adb1b3b7b55..a9b76d130d5 100644 --- a/keyboards/gggw/crosses/crosses.c +++ b/keyboards/gggw/crosses/crosses.c @@ -214,7 +214,7 @@ void housekeeping_task_kb(void) { } void keyboard_post_init_kb(void) { - global_user_config.raw = eeconfig_read_user(); + global_user_config.raw = eeconfig_read_kb(); transaction_register_rpc(CROSSES_SECONDARY_SYNC_ID, secondary_sync_handler); #if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_LEFT) diff --git a/keyboards/gggw/crosses/info.json b/keyboards/gggw/crosses/info.json index 75702f7c255..5edd778ac5c 100644 --- a/keyboards/gggw/crosses/info.json +++ b/keyboards/gggw/crosses/info.json @@ -7,7 +7,9 @@ "console": true, "extrakey": true, "mousekey": true, - "nkro": true + "nkro": true, + "oled": true, + "pointing_device": true }, "processor": "RP2040", "split": { diff --git a/keyboards/gggw/crosses/rules.mk b/keyboards/gggw/crosses/rules.mk deleted file mode 100644 index 9df91a3b72f..00000000000 --- a/keyboards/gggw/crosses/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -POINTING_DEVICE_ENABLE = yes -OLED_ENABLE = yes From c0132d8595cc889e238253f94fa4b35d9a29132a Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Sun, 30 Mar 2025 15:51:42 -0500 Subject: [PATCH 35/48] Lint fixup? --- keyboards/gggw/crosses/3x5/keymaps/default/keymap.c | 2 +- keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c | 12 ++++++------ keyboards/gggw/crosses/3x5/rev1/keyboard.json | 2 +- keyboards/gggw/crosses/3x5/rev2/keyboard.json | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c index d4d4125f450..b62fe1cd1d7 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/default/keymap.c @@ -4,7 +4,7 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( + [0] = LAYOUT_3x5( KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , KC_A , KC_R , KC_S , KC_T , KC_G , KC_M , KC_N , KC_E , KC_I , KC_O , KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , KC_SLSH , diff --git a/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c index 3e638e051fa..9b53d0e91be 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c @@ -86,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // └───────────┴───────────┴───────────┼───────────┼────────────┼─────┐ ┌────────────┼──────┼────────────┼───────────┴───────────┴───────────┘ // │ MO(5) │ LT(2, esc) │ spc │ │ LT(1, ent) │ bspc │ LT(4, del) │ // └───────────┴────────────┴─────┘ └────────────┴──────┴────────────┘ -[_BASE] = LAYOUT( +[_BASE] = LAYOUT_3x5( KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , LGUI_T(KC_A) , LALT_T(KC_R) , LCTL_T(KC_S) , LSFT_T(KC_T) , KC_G , KC_M , RSFT_T(KC_N) , RCTL_T(KC_E) , RALT_T(KC_I) , RGUI_T(KC_O) , KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , LT(3, KC_SLSH), @@ -102,7 +102,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // └──────┴───┴───┼───────────┼──────┼─────┐ ┌─────┼──────┼───────────┼───────────┴──────┴─────┘ // │ │ 0 │ │ │ │ │ │ // └───────────┴──────┴─────┘ └─────┴──────┴───────────┘ -[_NUM] = LAYOUT( +[_NUM] = LAYOUT_3x5( S(KC_8) , KC_7 , KC_8 , KC_9 , KC_SLSH , KC_BSLS , S(KC_9) , S(KC_0) , S(KC_BSLS) , KC_TRNS, KC_MINS , KC_4 , KC_5 , LSFT_T(KC_6) , S(KC_EQL) , S(KC_5) , RSFT_T(KC_LBRC) , RCTL_T(KC_RBRC) , S(KC_SCLN) , KC_SCLN, KC_GRV , KC_1 , KC_2 , KC_3 , KC_EQL , KC_LBRC , KC_RBRC , KC_TRNS , KC_TRNS , KC_TRNS, @@ -118,7 +118,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // └──────┴──────┴──────┼───────┼────┼────┐ ┌────┼────┼──────┼──────┴──────┴──────┘ // │ no │ no │ no │ │ no │ no │ no │ // └───────┴────┴────┘ └────┴────┴──────┘ -[_NAV] = LAYOUT( +[_NAV] = LAYOUT_3x5( KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_LGUI , KC_LALT , KC_LCTL , KC_LSFT , KC_NO , KC_NO , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT, KC_NO , KC_NO , KC_COPY , KC_PSTE , KC_NO , KC_NO , KC_HOME , KC_END , KC_PGDN , KC_PGUP, @@ -134,7 +134,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // └──────┴──────┴──────┼──────┼──────┼────┐ ┌────┼────┼────┼────┴────┴────┘ // │ no │ no │ no │ │ no │ no │ no │ // └──────┴──────┴────┘ └────┴────┴────┘ -[_MEDIA] = LAYOUT( +[_MEDIA] = LAYOUT_3x5( KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, KC_MPRV , KC_VOLD , KC_MPLY , KC_VOLU , KC_MNXT , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, @@ -150,7 +150,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼──────┼──────┴──────┴──────┘ // │ │ │ │ │ │ │ │ // └─────┴─────┴─────┘ └─────┴─────┴──────┘ -[_FUNC] = LAYOUT( +[_FUNC] = LAYOUT_3x5( KC_F11 , KC_F12 , KC_F13 , KC_F14 , KC_F15 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_TRNS , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS , KC_TRNS, @@ -166,7 +166,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // └──────┴─────────┴─────────┼─────────────┼────┼────┐ ┌────┼────────┼─────────┼─────────┴──────────┴─────────┘ // │ │ no │ no │ │ no │ no │ no │ // └─────────────┴────┴────┘ └────┴────────┴─────────┘ -[_MOUS] = LAYOUT( +[_MOUS] = LAYOUT_3x5( KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , EE_CLR , MSE_INC , MSE_DEC , KC_NO , KC_NO , KC_NO , MS_BTN3 , MS_BTN2 , MS_BTN1 , KC_NO , KC_NO , KC_RSFT , KC_RCTL , KC_RALT , KC_RGUI, KC_NO , KC_NO , KC_NO , DRAG_SCROLL , KC_NO , KC_NO , KC_NO , KC_NO , MSE_TOGG , DB_TOGG, diff --git a/keyboards/gggw/crosses/3x5/rev1/keyboard.json b/keyboards/gggw/crosses/3x5/rev1/keyboard.json index aa94ce2b911..4469b22fbec 100644 --- a/keyboards/gggw/crosses/3x5/rev1/keyboard.json +++ b/keyboards/gggw/crosses/3x5/rev1/keyboard.json @@ -9,7 +9,7 @@ "pid": "0x5647" }, "layouts": { - "LAYOUT": { + "LAYOUT_3x5": { "layout": [ {"matrix": [0, 0], "x": 0, "y": 0.25}, {"matrix": [0, 1], "x": 1, "y": 0.125}, diff --git a/keyboards/gggw/crosses/3x5/rev2/keyboard.json b/keyboards/gggw/crosses/3x5/rev2/keyboard.json index 9f0ec4cf7ec..fadcd84a5d9 100644 --- a/keyboards/gggw/crosses/3x5/rev2/keyboard.json +++ b/keyboards/gggw/crosses/3x5/rev2/keyboard.json @@ -9,7 +9,7 @@ "pid": "0x5657" }, "layouts": { - "LAYOUT": { + "LAYOUT_3x5": { "layout": [ {"matrix": [0, 0], "x": 0, "y": 0.25}, {"matrix": [0, 1], "x": 1, "y": 0.125}, From 4d37510469d33a505c0ca17e56ef6da2f69381b0 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Mon, 31 Mar 2025 19:31:21 -0500 Subject: [PATCH 36/48] Update keyboards/gggw/crosses/crosses.c Co-authored-by: jack --- keyboards/gggw/crosses/crosses.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/keyboards/gggw/crosses/crosses.c b/keyboards/gggw/crosses/crosses.c index a9b76d130d5..e8dd08c6ffc 100644 --- a/keyboards/gggw/crosses/crosses.c +++ b/keyboards/gggw/crosses/crosses.c @@ -110,12 +110,14 @@ void debug_config_to_console(global_user_config_t* config) { #endif // CONSOLE_ENABLE } -void eeconfig_init_user(void) { +void eeconfig_init_kb(void) { global_user_config.raw = 0; global_user_config.mse_cpi = MIN_DEFAULT_DPI; write_config_to_eeprom(&global_user_config); debug_config_to_console(&global_user_config); + + eeconfig_init_user(); } /*********************************************************************** From e9c8c9feb1ab424a9dbfbba34dcd903e8551859b Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Mon, 31 Mar 2025 19:31:37 -0500 Subject: [PATCH 37/48] Update keyboards/gggw/crosses/crosses.c Co-authored-by: jack --- keyboards/gggw/crosses/crosses.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/gggw/crosses/crosses.c b/keyboards/gggw/crosses/crosses.c index e8dd08c6ffc..f9893b5a90b 100644 --- a/keyboards/gggw/crosses/crosses.c +++ b/keyboards/gggw/crosses/crosses.c @@ -126,7 +126,7 @@ void eeconfig_init_kb(void) { #if defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_LEFT) -report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { +report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) { if (set_scrolling) { // Calculate and accumulate scroll values based on mouse movement and divisors scroll_acc_h += (float)mouse_report.x / SCROLL_DIVISOR_H; @@ -145,7 +145,7 @@ report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { mouse_report.y = 0; } - return mouse_report; + return pointing_device_task_user(mouse_report); } #endif /* RIGHT || LEFT */ From f3b12ba921eee7189b0a46e7ba60d1919dcd53cf Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Mon, 31 Mar 2025 19:32:07 -0500 Subject: [PATCH 38/48] Update keyboards/gggw/crosses/crosses.c Co-authored-by: jack --- keyboards/gggw/crosses/crosses.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/gggw/crosses/crosses.c b/keyboards/gggw/crosses/crosses.c index f9893b5a90b..273efbdf12d 100644 --- a/keyboards/gggw/crosses/crosses.c +++ b/keyboards/gggw/crosses/crosses.c @@ -178,14 +178,14 @@ report_mouse_t pointing_device_task_combined_user(report_mouse_t left_report, re #endif /* ifdef POINTING_DEVICE_COMBINED */ -layer_state_t layer_state_set_user(layer_state_t state) { +layer_state_t layer_state_set_kb(layer_state_t state) { #if defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_LEFT) if (get_highest_layer(state) != 5) { set_scrolling = false; } #endif /* ifndef POINTING_DEVICE_* */ - return state; + return layer_state_set_user(state); } void secondary_sync_handler(uint8_t in_buflen, const void* in_data, uint8_t out_buflen, void* out_data) { From 8a5c53bcf3af6d5c69ac3c68502f060bc8e760ff Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Mon, 31 Mar 2025 19:32:50 -0500 Subject: [PATCH 39/48] Update keyboards/gggw/crosses/crosses.h Co-authored-by: jack --- keyboards/gggw/crosses/crosses.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/keyboards/gggw/crosses/crosses.h b/keyboards/gggw/crosses/crosses.h index da81ad479a7..90d03119db3 100644 --- a/keyboards/gggw/crosses/crosses.h +++ b/keyboards/gggw/crosses/crosses.h @@ -51,13 +51,3 @@ extern bool set_scrolling; extern float scroll_acc_h; extern float scroll_acc_v; - -# if defined(POINTING_DEVICE_LEFT) || defined(POINTING_DEVICE_RIGHT) -report_mouse_t pointing_device_task_user(report_mouse_t mouse_report); -# endif // POINTING_DEVICE - // -# ifdef POINTING_DEVICE_COMBINED -report_mouse_t pointing_device_task_combined_user(report_mouse_t left_report, report_mouse_t right_report); -# endif // POINTINTG_DEVICE_COMBINED - -layer_state_t layer_state_set_user(layer_state_t state); From 40c56e9975119aa5ef4862194d2b62eeec04d733 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Mon, 31 Mar 2025 19:33:02 -0500 Subject: [PATCH 40/48] Update keyboards/gggw/crosses/3x5/rev1/keyboard.json Co-authored-by: jack --- keyboards/gggw/crosses/3x5/rev1/keyboard.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/gggw/crosses/3x5/rev1/keyboard.json b/keyboards/gggw/crosses/3x5/rev1/keyboard.json index 4469b22fbec..866ed8176a4 100644 --- a/keyboards/gggw/crosses/3x5/rev1/keyboard.json +++ b/keyboards/gggw/crosses/3x5/rev1/keyboard.json @@ -1,5 +1,5 @@ { - "keyboard_name": "Crosses 3x5", + "keyboard_name": "Crosses 3x5 rev1", "matrix_pins": { "cols": ["GP26", "GP22", "GP21", "GP23", "GP20"], "rows": ["GP27", "GP28", "GP29", "GP9"] From af5fd5a8ec4aa23f460e6dd959792943a31e2749 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Mon, 31 Mar 2025 19:33:22 -0500 Subject: [PATCH 41/48] Update keyboards/gggw/crosses/3x6/rev2/keyboard.json Co-authored-by: jack --- keyboards/gggw/crosses/3x6/rev2/keyboard.json | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/gggw/crosses/3x6/rev2/keyboard.json b/keyboards/gggw/crosses/3x6/rev2/keyboard.json index 982e9082fe3..9f6cd339b82 100644 --- a/keyboards/gggw/crosses/3x6/rev2/keyboard.json +++ b/keyboards/gggw/crosses/3x6/rev2/keyboard.json @@ -1,5 +1,4 @@ { - "maintainer": "vinniefranco", "matrix_pins": { "cols": ["GP1", "GP26", "GP22", "GP21", "GP23", "GP20"], "rows": ["GP27", "GP28", "GP29", "GP7"] From 930016b34bea86fdb5c877e7f5a67ef56992d736 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Mon, 31 Mar 2025 19:43:22 -0500 Subject: [PATCH 42/48] Add headers --- keyboards/gggw/crosses/3x5/rev2/config.h | 17 +++++++++++++++++ keyboards/gggw/crosses/3x6/rev1/config.h | 17 +++++++++++++++++ keyboards/gggw/crosses/3x6/rev2/config.h | 17 +++++++++++++++++ keyboards/gggw/crosses/4x6/rev1/config.h | 17 +++++++++++++++++ keyboards/gggw/crosses/4x6/rev2/config.h | 17 +++++++++++++++++ 5 files changed, 85 insertions(+) diff --git a/keyboards/gggw/crosses/3x5/rev2/config.h b/keyboards/gggw/crosses/3x5/rev2/config.h index 82917b27c1b..4f0cf3975de 100644 --- a/keyboards/gggw/crosses/3x5/rev2/config.h +++ b/keyboards/gggw/crosses/3x5/rev2/config.h @@ -1,3 +1,20 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + /* * OLED */ diff --git a/keyboards/gggw/crosses/3x6/rev1/config.h b/keyboards/gggw/crosses/3x6/rev1/config.h index f9f7a914aa6..449a1f86b8e 100644 --- a/keyboards/gggw/crosses/3x6/rev1/config.h +++ b/keyboards/gggw/crosses/3x6/rev1/config.h @@ -1,3 +1,20 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + /* * OLED */ diff --git a/keyboards/gggw/crosses/3x6/rev2/config.h b/keyboards/gggw/crosses/3x6/rev2/config.h index 82917b27c1b..4f0cf3975de 100644 --- a/keyboards/gggw/crosses/3x6/rev2/config.h +++ b/keyboards/gggw/crosses/3x6/rev2/config.h @@ -1,3 +1,20 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + /* * OLED */ diff --git a/keyboards/gggw/crosses/4x6/rev1/config.h b/keyboards/gggw/crosses/4x6/rev1/config.h index f9f7a914aa6..449a1f86b8e 100644 --- a/keyboards/gggw/crosses/4x6/rev1/config.h +++ b/keyboards/gggw/crosses/4x6/rev1/config.h @@ -1,3 +1,20 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + /* * OLED */ diff --git a/keyboards/gggw/crosses/4x6/rev2/config.h b/keyboards/gggw/crosses/4x6/rev2/config.h index 82917b27c1b..4f0cf3975de 100644 --- a/keyboards/gggw/crosses/4x6/rev2/config.h +++ b/keyboards/gggw/crosses/4x6/rev2/config.h @@ -1,3 +1,20 @@ +/* +Copyright 2025 Vincent Franco + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + /* * OLED */ From c2e2fe6479176f445c2225bcd436472ad045f0a8 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Mon, 31 Mar 2025 19:45:56 -0500 Subject: [PATCH 43/48] more _user -> _kb --- keyboards/gggw/crosses/crosses.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/gggw/crosses/crosses.c b/keyboards/gggw/crosses/crosses.c index 273efbdf12d..3d3622e7243 100644 --- a/keyboards/gggw/crosses/crosses.c +++ b/keyboards/gggw/crosses/crosses.c @@ -116,7 +116,7 @@ void eeconfig_init_kb(void) { write_config_to_eeprom(&global_user_config); debug_config_to_console(&global_user_config); - + eeconfig_init_user(); } @@ -156,7 +156,7 @@ report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) { #ifdef POINTING_DEVICE_COMBINED -report_mouse_t pointing_device_task_combined_user(report_mouse_t left_report, report_mouse_t right_report) { +report_mouse_t pointing_device_task_combined_kb(report_mouse_t left_report, report_mouse_t right_report) { // Calculate and accumulate scroll values based on mouse movement and divisors scroll_acc_h += (float)left_report.x / SCROLL_DIVISOR_H; scroll_acc_v += (float)left_report.y / SCROLL_DIVISOR_V; From c02539c03d4d8ec7c0b7cf3c9eb54994880d37f5 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Thu, 15 May 2025 11:07:08 -0500 Subject: [PATCH 44/48] Update keyboards/gggw/crosses/4x6/rev1/config.h Co-authored-by: Drashna Jaelre --- keyboards/gggw/crosses/4x6/rev1/config.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/gggw/crosses/4x6/rev1/config.h b/keyboards/gggw/crosses/4x6/rev1/config.h index 449a1f86b8e..6554246f64c 100644 --- a/keyboards/gggw/crosses/4x6/rev1/config.h +++ b/keyboards/gggw/crosses/4x6/rev1/config.h @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#pragma once + /* * OLED */ From c93b94ea099fcec342fac1625aca018d00604e9c Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Thu, 15 May 2025 11:07:14 -0500 Subject: [PATCH 45/48] Update keyboards/gggw/crosses/4x6/rev2/config.h Co-authored-by: Drashna Jaelre --- keyboards/gggw/crosses/4x6/rev2/config.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/gggw/crosses/4x6/rev2/config.h b/keyboards/gggw/crosses/4x6/rev2/config.h index 4f0cf3975de..d6760849043 100644 --- a/keyboards/gggw/crosses/4x6/rev2/config.h +++ b/keyboards/gggw/crosses/4x6/rev2/config.h @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#pragma once + /* * OLED */ From 6b81da659ddd54afe68e0daa1cf989e1324be959 Mon Sep 17 00:00:00 2001 From: vinniefranco Date: Thu, 22 May 2025 13:09:43 -0500 Subject: [PATCH 46/48] Cle aning up based on feedback --- .../gggw/crosses/3x5/keymaps/stock/keymap.c | 53 +--------------- .../gggw/crosses/3x6/keymaps/stock/keymap.c | 34 ---------- keyboards/gggw/crosses/3x6/rev2/keyboard.json | 1 + .../gggw/crosses/4x6/keymaps/stock/keymap.c | 48 -------------- keyboards/gggw/crosses/4x6/rev2/keyboard.json | 2 +- keyboards/gggw/crosses/crosses.c | 63 +++++++++++++++++-- 6 files changed, 62 insertions(+), 139 deletions(-) diff --git a/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c index 9b53d0e91be..de0c3b22d1d 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c @@ -234,7 +234,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { break; case MSE_INC: if (record->event.pressed) { -#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT) +#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_LEFT) change_pointer_dpi(&global_user_config, true); #endif /* ifdef POINTING_DEVICE */ debug_config_to_console(&global_user_config); @@ -252,7 +252,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { break; case MSE_TOGG: if (record->event.pressed) { -#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT) +#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_LEFT) bool current_state = get_auto_mouse_enable(); set_auto_mouse_enable(!current_state); #endif /* ifdef POINTING_DEVICE */ @@ -267,52 +267,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { return true; } - -#ifdef OLED_ENABLE - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (!is_keyboard_master()) { - return OLED_ROTATION_180; - } - - return rotation; -} - -static void render_logo(void) { - static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; - - oled_write_P(qmk_logo, false); -} - -bool oled_task_user(void) { - render_logo(); - - // clang-format off - const char* layer_names[] = { - [_BASE] = "BASE CPI: ", - [_NUM] = "PROG CPI: ", - [_NAV] = "NAVI CPI: ", - [_MEDIA] = "MEDIA CPI: ", - [_FUNC] = "FUNC CPI: ", - [_MOUS] = "MOUSE CPI: ", - }; - // clang-format on - - char cpi_str[6]; - uint16_t current_dpi = get_pointer_dpi(&global_user_config); - - snprintf(cpi_str, sizeof(cpi_str), "%u", (unsigned int)current_dpi); - - oled_write(PSTR(layer_names[get_highest_layer(layer_state)]), false); - oled_write(cpi_str, false); - - return false; -} -#endif /* ifdef OLED_ENABLE */ - -#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT) -void pointing_device_init_user(void) { - set_auto_mouse_layer(_MOUS); - set_auto_mouse_enable(false); -} -#endif /* ifdef POINTING_DEVICE */ diff --git a/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c b/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c index 31f5fd6ee09..7d44af0d90d 100644 --- a/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c +++ b/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c @@ -255,37 +255,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { return true; } - -#ifdef OLED_ENABLE - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (!is_keyboard_master()) { - return OLED_ROTATION_180; - } - - return rotation; -} - -static void render_logo(void) { - static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; - - oled_write_P(qmk_logo, false); -} - -bool oled_task_user(void) { - render_logo(); - - const char* layer_names[] = { - [_BASE] = ">> BASE ", [_NUM] = ">> PROG ", [_NAV] = ">> NAVI ", [_MEDIA] = ">>> MEDIA ", [_FUNC] = ">>> FUNC ", [_MOUS] = ">>> MOUSE ", - }; - - oled_write_P(PSTR(layer_names[get_highest_layer(layer_state)]), false); - - return false; -} -#endif /* ifdef OLED_ENABLE */ - -void pointing_device_init_user(void) { - set_auto_mouse_layer(_MOUS); - set_auto_mouse_enable(true); -} diff --git a/keyboards/gggw/crosses/3x6/rev2/keyboard.json b/keyboards/gggw/crosses/3x6/rev2/keyboard.json index 9f6cd339b82..deb6c844e7b 100644 --- a/keyboards/gggw/crosses/3x6/rev2/keyboard.json +++ b/keyboards/gggw/crosses/3x6/rev2/keyboard.json @@ -1,4 +1,5 @@ { + "keyboard_name": "Crosses 3x6 rev2", "matrix_pins": { "cols": ["GP1", "GP26", "GP22", "GP21", "GP23", "GP20"], "rows": ["GP27", "GP28", "GP29", "GP7"] diff --git a/keyboards/gggw/crosses/4x6/keymaps/stock/keymap.c b/keyboards/gggw/crosses/4x6/keymaps/stock/keymap.c index bffd93eb7b5..eb60a5e9cb5 100644 --- a/keyboards/gggw/crosses/4x6/keymaps/stock/keymap.c +++ b/keyboards/gggw/crosses/4x6/keymaps/stock/keymap.c @@ -173,51 +173,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { return true; } - -#ifdef OLED_ENABLE - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (!is_keyboard_master()) { - return OLED_ROTATION_180; - } - - return rotation; -} - -static void render_logo(void) { - static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; - - oled_write_P(qmk_logo, false); -} - -bool oled_task_user(void) { - render_logo(); - - // clang-format off - const char* layer_names[] = { - [_BASE] = "BASE CPI: ", - [_NUM] = "PROG CPI: ", - [_NAV] = "NAVI CPI: ", - [_MEDIA] = "MEDIA CPI: ", - [_FUNC] = "FUNC CPI: ", - [_MOUS] = "MOUSE CPI: ", - [_CUST] = "CUST CPI: ", - }; - // clang-format on - - char cpi_str[6]; - uint16_t current_dpi = get_pointer_dpi(&global_user_config); - - snprintf(cpi_str, sizeof(cpi_str), "%u", (unsigned int)current_dpi); - - oled_write(PSTR(layer_names[get_highest_layer(layer_state)]), false); - oled_write(cpi_str, false); - - return false; -} -#endif /* ifdef OLED_ENABLE */ - -void pointing_device_init_user(void) { - set_auto_mouse_layer(_MOUS); - set_auto_mouse_enable(true); -} diff --git a/keyboards/gggw/crosses/4x6/rev2/keyboard.json b/keyboards/gggw/crosses/4x6/rev2/keyboard.json index 6aa88f63bbe..e2997285fb3 100644 --- a/keyboards/gggw/crosses/4x6/rev2/keyboard.json +++ b/keyboards/gggw/crosses/4x6/rev2/keyboard.json @@ -1,5 +1,5 @@ { - "keyboard_name": "Crosses 54 Rev2", + "keyboard_name": "Crosses 4x6 rev2", "matrix_pins": { "cols": ["GP13", "GP26", "GP22", "GP21", "GP23", "GP20"], "rows": ["GP5", "GP27", "GP28", "GP29", "GP7"] diff --git a/keyboards/gggw/crosses/crosses.c b/keyboards/gggw/crosses/crosses.c index 3d3622e7243..d37349b8af4 100644 --- a/keyboards/gggw/crosses/crosses.c +++ b/keyboards/gggw/crosses/crosses.c @@ -195,20 +195,24 @@ void secondary_sync_handler(uint8_t in_buflen, const void* in_data, uint8_t out_ } void housekeeping_task_kb(void) { - if (!is_keyboard_master()) { return; } + if (!is_keyboard_master()) { + return; + } static global_user_config_t last_config = {0}; - static uint32_t last_sync = 0; - bool should_sync = false; + static uint32_t last_sync = 0; + bool should_sync = false; if (memcmp(&global_user_config, &last_config, sizeof(global_user_config))) { should_sync = true; memcpy(&last_config, &global_user_config, sizeof(global_user_config)); } - should_sync = (timer_elapsed32(last_sync) > 500); + should_sync = (timer_elapsed32(last_sync) > 500); - if (!should_sync) { return; } + if (!should_sync) { + return; + } if (transaction_rpc_send(CROSSES_SECONDARY_SYNC_ID, sizeof(global_user_config), &global_user_config)) { last_sync = timer_read32(); @@ -227,3 +231,52 @@ void keyboard_post_init_kb(void) { keyboard_post_init_user(); } + +#ifdef OLED_ENABLE + +oled_rotation_t oled_init_kb(oled_rotation_t rotation) { + if (!is_keyboard_master()) { + return OLED_ROTATION_180; + } + + return rotation; +} + +# if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_LEFT) +void pointing_device_init_kb(void) { + set_auto_mouse_layer(_MOUS); + set_auto_mouse_enable(false); +} +# endif /* ifdef POINTING_DEVICE */ + +static void render_logo(void) { + static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; + + oled_write_P(qmk_logo, false); +} + +bool oled_task_kb(void) { + render_logo(); + + // clang-format off + const char* layer_names[] = { + [0] = "BASE CPI: ", + [1] = "PROG CPI: ", + [2] = "NAVI CPI: ", + [3] = "MEDIA CPI: ", + [4] = "FUNC CPI: ", + [5] = "MOUSE CPI: ", + }; + // clang-format on + + char cpi_str[6]; + uint16_t current_dpi = get_pointer_dpi(&global_user_config); + + snprintf(cpi_str, sizeof(cpi_str), "%u", (unsigned int)current_dpi); + + oled_write(PSTR(layer_names[get_highest_layer(layer_state)]), false); + oled_write(cpi_str, false); + + return false; +} +#endif /* ifdef OLED_ENABLE */ From a84f6524c1dabefc3ba119965f20c8ecb1ff976a Mon Sep 17 00:00:00 2001 From: vinniefranco Date: Thu, 22 May 2025 14:32:26 -0500 Subject: [PATCH 47/48] Fixup --- keyboards/gggw/crosses/crosses.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/gggw/crosses/crosses.c b/keyboards/gggw/crosses/crosses.c index d37349b8af4..1c3d66d95bc 100644 --- a/keyboards/gggw/crosses/crosses.c +++ b/keyboards/gggw/crosses/crosses.c @@ -244,7 +244,7 @@ oled_rotation_t oled_init_kb(oled_rotation_t rotation) { # if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_LEFT) void pointing_device_init_kb(void) { - set_auto_mouse_layer(_MOUS); + set_auto_mouse_layer(5); set_auto_mouse_enable(false); } # endif /* ifdef POINTING_DEVICE */ From f7065c9005f70feb84b2dc768e3fb82864130b51 Mon Sep 17 00:00:00 2001 From: Vincent Franco Date: Mon, 9 Jun 2025 09:33:37 -0500 Subject: [PATCH 48/48] Update crosses.c Better out of the box CPI --- keyboards/gggw/crosses/crosses.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/gggw/crosses/crosses.c b/keyboards/gggw/crosses/crosses.c index 1c3d66d95bc..c2b8065940b 100644 --- a/keyboards/gggw/crosses/crosses.c +++ b/keyboards/gggw/crosses/crosses.c @@ -112,7 +112,7 @@ void debug_config_to_console(global_user_config_t* config) { void eeconfig_init_kb(void) { global_user_config.raw = 0; - global_user_config.mse_cpi = MIN_DEFAULT_DPI; + global_user_config.mse_cpi = 400; write_config_to_eeprom(&global_user_config); debug_config_to_console(&global_user_config);