From 7e829ab0cb25f0701025860d73c8f623557f3893 Mon Sep 17 00:00:00 2001 From: Adi Ron Date: Sat, 20 Apr 2024 18:20:47 +0300 Subject: [PATCH] Added keyboard config for Helix --- .../helix/rev3_5rows/keymaps/adi/config.h | 14 + .../helix/rev3_5rows/keymaps/adi/helixfont.h | 233 +++++++++++ .../helix/rev3_5rows/keymaps/adi/keymap.c | 183 ++++++++ .../rev3_5rows/keymaps/adi/oled_display.c | 129 ++++++ .../helix/rev3_5rows/keymaps/adi/readme.md | 81 ++++ .../helix/rev3_5rows/keymaps/adi/rules.mk | 6 + users/adi/adi.h | 389 ++++++++++++++++++ users/adi/rules.mk | 1 + 8 files changed, 1036 insertions(+) create mode 100644 keyboards/helix/rev3_5rows/keymaps/adi/config.h create mode 100644 keyboards/helix/rev3_5rows/keymaps/adi/helixfont.h create mode 100644 keyboards/helix/rev3_5rows/keymaps/adi/keymap.c create mode 100644 keyboards/helix/rev3_5rows/keymaps/adi/oled_display.c create mode 100644 keyboards/helix/rev3_5rows/keymaps/adi/readme.md create mode 100644 keyboards/helix/rev3_5rows/keymaps/adi/rules.mk create mode 100644 users/adi/adi.h create mode 100644 users/adi/rules.mk diff --git a/keyboards/helix/rev3_5rows/keymaps/adi/config.h b/keyboards/helix/rev3_5rows/keymaps/adi/config.h new file mode 100644 index 000000000000..49bb53136aad --- /dev/null +++ b/keyboards/helix/rev3_5rows/keymaps/adi/config.h @@ -0,0 +1,14 @@ +// This sets a custom font. Somehow it wouldn't work without it. +#ifdef OLED_FONT_H + #undef OLED_FONT_H +#endif +#ifdef MASTER_LEFT + #undef MASTER_LEFT +#endif +#ifdef SPLIT_HAND_MATRIX_GRID + #undef SPLIT_HAND_MATRIX_GRID + #undef SPLIT_HAND_MATRIX_GRID_LOW_IS_RIGHT +#endif +// #define MASTER_LEFT +#define MASTER_RIGHT +#define OLED_FONT_H "keyboards/helix/rev3_5rows/keymaps/adi/helixfont.h" diff --git a/keyboards/helix/rev3_5rows/keymaps/adi/helixfont.h b/keyboards/helix/rev3_5rows/keymaps/adi/helixfont.h new file mode 100644 index 000000000000..147060f95695 --- /dev/null +++ b/keyboards/helix/rev3_5rows/keymaps/adi/helixfont.h @@ -0,0 +1,233 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#include "progmem.h" + +// Standard ASCII 5x7 font + +static const unsigned char font[] PROGMEM = { + 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, 0xA4, 0xA4, 0xA4, 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, + 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0xFC, 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, 0x80, 0xC0, 0xE0, + 0x00, 0x00, 0x80, 0xE0, 0xF0, 0xF0, + 0xF0, 0xE0, 0xE0, 0xC0, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x00, 0x00, 0x00, 0xB8, 0xB8, 0xB8, + 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, + 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, + 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, + 0x00, 0x00, 0xB8, 0xB8, 0xB8, 0x00, + 0x00, 0xF8, 0xF8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, + 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, + 0x00, 0x80, 0x80, 0x00, 0x80, 0x80, + 0x80, 0x00, 0x80, 0x80, 0x80, 0x00, + 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, + 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, + 0x80, 0x00, 0x00, 0x00, 0x00, 0xF8, + 0xF8, 0xF8, 0x00, 0x00, 0x80, 0x80, + 0x80, 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, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFC, 0xF8, 0xF0, 0xE1, 0xC3, 0x87, + 0x0F, 0x1F, 0x3F, 0xFF, 0xFF, 0xFE, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, + 0xCF, 0xDF, 0x99, 0x19, 0x39, 0xF3, + 0xF3, 0xE2, 0x00, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x03, + 0x01, 0x01, 0x03, 0xFF, 0xFF, 0xFF, + 0x03, 0x01, 0x01, 0x03, 0xFF, 0xFF, + 0xFC, 0x00, 0xFF, 0xFF, 0xFF, 0x00, + 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x7C, + 0xFF, 0xE7, 0x83, 0x83, 0x81, 0x83, + 0xC3, 0xFF, 0xFF, 0xFF, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0x0E, 0x07, 0x03, + 0x03, 0x00, 0x01, 0x1F, 0xFF, 0xF0, + 0xC0, 0xFC, 0x3F, 0x07, 0x1F, 0xFF, + 0xF0, 0xC0, 0xFC, 0x3F, 0x07, 0x01, + 0x7C, 0xFF, 0xFF, 0x9B, 0x99, 0x19, + 0x9B, 0xDF, 0xDF, 0x5C, 0x00, 0xFF, + 0xFF, 0xFF, 0xC7, 0x83, 0x81, 0x81, + 0x83, 0xC7, 0xFF, 0xFE, 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, 0x03, 0x03, 0x07, + 0x0F, 0x0F, 0x0F, 0x0F, 0x07, 0x03, + 0x00, 0x00, 0x04, 0x03, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x01, 0x00, 0x00, 0x03, 0x03, 0x03, + 0x00, 0x00, 0x03, 0x03, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, + 0x03, 0x00, 0x03, 0x03, 0x03, 0x00, + 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x03, 0x03, 0x03, 0x01, + 0x01, 0x03, 0x03, 0x03, 0x00, 0x00, + 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x03, 0x03, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x03, 0x01, 0x01, 0x03, 0x03, + 0x03, 0x01, 0x01, 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/helix/rev3_5rows/keymaps/adi/keymap.c b/keyboards/helix/rev3_5rows/keymaps/adi/keymap.c new file mode 100644 index 000000000000..8a948ef0a4dc --- /dev/null +++ b/keyboards/helix/rev3_5rows/keymaps/adi/keymap.c @@ -0,0 +1,183 @@ +/* Copyright 2020 yushakobo + * + * 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 QMK_KEYBOARD_H +#include "adi.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc | A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | PgUp |P-Tab | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl |Adjust| Alt | GUI |Lower |Space | PgDn |N-Tab |Space |Raise |EntFn | GUI | Alt | Ctrl | + * `-------------------------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + F_ESCFN, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, F_MOUSE, F_QUOTE, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PGUP, M_PTAB, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, MO(_ADJUST), KC_LALT, KC_LGUI, MO(_LOWER), KC_SPC, KC_PGDN, M_NTAB, KC_SPC, MO(_RAISE), F_ENTFN, KC_RGUI, KC_RALT, KC_RCTL + ), + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | F12 | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_HOME, _______, KC_F12, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_END, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | CAPS | F7 | F8 | F9 | F10 | F11 | | | F12 | | |PageDn|PageUp| | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_HOME, _______, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, KC_END, _______, _______, _______, _______, _______, _______, _______ + ), + + /* Adjust + * ,-----------------------------------------. ,-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Reset|DEBUG | | | | | | | | | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | Mac | | Win | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | |RGB ON| HUE+ | SAT+ | VAL+ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | |Win | Mac | | | | | | | MODE | HUE- | SAT- | VAL- | + * `-------------------------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, QK_BOOT, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, + _______, _______, AG_SWAP, AG_NORM, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD + ), + /* EnterFn layer + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | PTab | NTab | NSpc | PSpc | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | Left | Down | Up | Right| | CEnt | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | Back | Fwrd | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ + [_ENTFN] = LAYOUT( + _______, _______, _______, _______, _______,_______ , _______, _______, _______, _______, _______, _______, + _______, M_PTAB, M_NTAB, M_PSPC, M_NSPC, _______, _______, _______, _______, M_ZOUT, M_ZOIN, _______, + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, M_ENTR, + _______, M_BACK, M_FWRD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + /* EnterFn layer + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Brt- | Brt+ | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Vol+ | | | | | | | Rewd | Play | FFwd | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | Vol- | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ + [_MEDIA] = LAYOUT( + _______, _______, _______, _______, _______,_______ , _______, _______, _______, _______, _______, _______, + _______, KC_SCRL, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_VOLU, _______, _______, _______, _______, _______, KC_MEDIA_REWIND, KC_MPLY, KC_MEDIA_FAST_FORWARD, _______, _______, + _______, KC_VOLD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + /* EnterFn layer + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | LBtn | RBtn | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | MsL | MsD | MsU | MsR | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ + [_MOUSE] = LAYOUT( + _______, _______, _______, _______, _______,_______ , _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_BTN1, KC_BTN2, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* EscFn layer + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | ü | | ö | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | ä | ß | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ + [_ESCFN] = LAYOUT( + _______, _______, _______, _______, _______,_______ , _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, M_UUML, M_IUML, M_OUML, _______, _______, + _______, M_AUML, M_SZET, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/helix/rev3_5rows/keymaps/adi/oled_display.c b/keyboards/helix/rev3_5rows/keymaps/adi/oled_display.c new file mode 100644 index 000000000000..36480146e73b --- /dev/null +++ b/keyboards/helix/rev3_5rows/keymaps/adi/oled_display.c @@ -0,0 +1,129 @@ +/* Copyright 2020 yushakobo + * + * 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 QMK_KEYBOARD_H + +// Defines names for use in layer keycodes and the keymap +enum adi_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _ENTFN, + _MEDIA, + _MOUSE, + _NUMPAD, +}; + +#ifdef OLED_ENABLE + +void render_status(void) { + + // Render to mode icon + static const char os_logo[][2][3] PROGMEM ={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; + if (is_mac_mode()) { + oled_write_P(os_logo[0][0], false); + oled_write_P(PSTR("\n"), false); + oled_write_P(os_logo[0][1], false); + }else{ + oled_write_P(os_logo[1][0], false); + oled_write_P(PSTR("\n"), false); + oled_write_P(os_logo[1][1], false); + } + + oled_write_P(PSTR(" "), false); + + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + + switch (get_highest_layer(layer_state)) { + case _QWERTY: + oled_write_P(PSTR("none :)\n"), false); + break; + case _RAISE: + oled_write_P(PSTR("Raise\n"), false); + break; + case _LOWER: + oled_write_P(PSTR("Lower\n"), false); + break; + case _ADJUST: + oled_write_P(PSTR("Adjust\n"), false); + break; + case _ENTFN: + oled_write_P(PSTR("Enter\n"), false); + break; + case _MEDIA: + oled_write_P(PSTR("Media\n"), false); + break; + case _MOUSE: + oled_write_P(PSTR("Mouse\n"), false); + break; + case _NUMPAD: + oled_write_P(PSTR("Numpad\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("Idk..."), false); + } + + oled_write_P(PSTR("\n"), false); + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); +} + + +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); +} + +static void render_rgbled_status(bool full) { +#ifdef RGBLIGHT_ENABLE + char buf[30]; + if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) { + if (full) { + snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ", + rgblight_get_mode(), + rgblight_get_hue()/RGBLIGHT_HUE_STEP, + rgblight_get_sat()/RGBLIGHT_SAT_STEP, + rgblight_get_val()/RGBLIGHT_VAL_STEP); + } else { + snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode()); + } + oled_write(buf, false); + } +#endif +} + +bool oled_task_user(void) { + if(is_keyboard_master()){ + render_status(); + }else{ + render_logo(); + render_rgbled_status(true); + } + return false; +} +#endif diff --git a/keyboards/helix/rev3_5rows/keymaps/adi/readme.md b/keyboards/helix/rev3_5rows/keymaps/adi/readme.md new file mode 100644 index 000000000000..423443ba7157 --- /dev/null +++ b/keyboards/helix/rev3_5rows/keymaps/adi/readme.md @@ -0,0 +1,81 @@ +# The default keymap for Helix rev3 5rows + +### Qwerty Layer (Base) +``` +,-----------------------------------------. ,-----------------------------------------. +| ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | +|------+------+------+------+------+------+------+------+------+------+------+------+------+------| +| Shift| Z | X | C | V | B | [ | ] | N | M | , | . | / |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------+------+------| +|Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | +`-------------------------------------------------------------------------------------------------' + +``` + +### Lower Layer +``` +,-----------------------------------------. ,-----------------------------------------. +| | | | | | | | | | | | | | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | | +|------+------+------+------+------+------+------+------+------+------+------+------+------+------| +| CAPS | F7 | F8 | F9 | F10 | F11 | ( | ) | F12 | | | Home | End | | +|------+------+------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | Next | Vol- | Vol+ | Play | +`-------------------------------------------------------------------------------------------------' + +``` + + +### Raise Layer +``` +,-----------------------------------------. ,-----------------------------------------. +| | | | | | | | | | | | | Bksp | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | +|------+------+------+------+------+------+------+------+------+------+------+------+------+------| +| CAPS | F7 | F8 | F9 | F10 | F11 | | | F12 | | |PageDn|PageUp| | +|------+------+------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | Next | Vol- | Vol+ | Play | +`-------------------------------------------------------------------------------------------------' + +``` + +### Adjust Layer (Lower + Raise) +``` +,-----------------------------------------. ,-----------------------------------------. +| F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| | Reset|RGBRST|EEPRST| | | | | | | | | Del | +|------+------+------+------+------+------| |------+------+------+------+------+------| +| | | | | | Mac | | Win | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | |RGB ON| HUE+ | SAT+ | VAL+ | +|------+------+------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | MODE | HUE- | SAT- | VAL- | +`-------------------------------------------------------------------------------------------------' +``` + +### Rotary Encoder Settings + +|L/R|Clockwise|Counter Clockwise| +|---|---|---| +|Left|Page Down|Page Up| +|Right|Down|Up| + +### DipSW Settings + +|Switch No.|| +|---|---| +|Left 1|Toggle Win/mac| +|Left 2|Not assigned| +|Right 1|Not assigned| +|Right 2|Not assigned| diff --git a/keyboards/helix/rev3_5rows/keymaps/adi/rules.mk b/keyboards/helix/rev3_5rows/keymaps/adi/rules.mk new file mode 100644 index 000000000000..ae3daf055e82 --- /dev/null +++ b/keyboards/helix/rev3_5rows/keymaps/adi/rules.mk @@ -0,0 +1,6 @@ +OLED_ENABLE = yes +RGBLIGHT_ENABLE = no +LOCAL_GLCDFONT = yes +WPM_ENABLE = yes +COMBO_ENABLE = yes +MOUSEKEY_ENABLE = yes diff --git a/users/adi/adi.h b/users/adi/adi.h new file mode 100644 index 000000000000..fa698217f2c1 --- /dev/null +++ b/users/adi/adi.h @@ -0,0 +1,389 @@ +/* Copyright 2019 Adi Ron + * + * 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 . +*/ + +/* This file includes all the different base settings for my usual keyboard + * layout. */ + +/* This sets the type of tap keys to hold on other keys. This is explained in: + * https://docs.qmk.fm/#/tap_hold?id=tap-or-hold-decision-modes */ +#define HOLD_ON_OTHER_KEY_PRESS + +#define MEDIA_KEY_DELAY 10 + +// Keycodes and layers and stuff + +#define F_ENTFN LT(_ENTFN, KC_ENT) +#define F_MOUSE LT(_MOUSE, KC_SCLN) +#define F_QUOTE LT(_MEDIA, KC_QUOT) +#define F_ESCFN LT(_ESCFN, KC_ESC) + +enum adi_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _ENTFN, + _MEDIA, + _MOUSE, + _NUMPAD, + _ESCFN, +}; + +enum adi_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + M_BACK, + M_FWRD, + M_PTAB, + M_NTAB, + M_ZOUT, + M_ZOIN, + M_ENTR, + M_NSPC, + M_PSPC, + M_APPN, + M_APPP, + M_UUML, + M_AUML, + M_OUML, + M_IUML, + M_SZET, +}; + +void adi_umlaut_macro(uint16_t keycode, keyrecord_t *record) { + /* Ü or ü (depending on shift) on macOS + This is done by reading the state of either right or left shift. If shift is pressed, unregister shift first, send alt+u, then register shift again. If shift is not pressed, just send alt+u. */ + if (record->event.pressed) { + if (get_mods() & MOD_BIT(KC_RSFT)) { + unregister_code(KC_RSFT); + SEND_STRING(SS_LALT(SS_TAP(X_U))); + register_code(KC_RSFT); + } else if (get_mods() & MOD_BIT(KC_LSFT)) { + unregister_code(KC_LSFT); + SEND_STRING(SS_LALT(SS_TAP(X_U))); + register_code(KC_LSFT); + } else { + SEND_STRING(SS_LALT(SS_TAP(X_U))); + } + register_code(keycode); + } else { + unregister_code(keycode); + } +} + +// Macro definitions + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + bool use_cmd = true; // Use, for example, Cmd-Tab, Cmd-C, Cmd-V, etc. + // Compare to MAGIC_SWAP_ALT_GUI and MAGIC_UNSWAP_ALT_GUI configs, set in: + // quantum/quantum.c + if (keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) { + use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc. + } + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + + case M_BACK: + /* Command + [ or previous page */ + if (record->event.pressed) { + if (use_cmd) { + SEND_STRING(SS_LGUI(SS_TAP(X_LBRC))); + } else { + SEND_STRING(SS_LALT(SS_TAP(X_LEFT))); + } + } + break; + case M_FWRD: + /* Command + ] or next page */ + if (record->event.pressed) { + if (use_cmd) { + SEND_STRING(SS_LGUI(SS_TAP(X_RBRC))); + } else { + SEND_STRING(SS_LALT(SS_TAP(X_RIGHT))); + } + } + break; + case M_PTAB: + /* Command + { or prev tab. */ + if (record->event.pressed) { + if (use_cmd) { + SEND_STRING(SS_LGUI(SS_RSFT(SS_TAP(X_LBRC)))); + } else { + SEND_STRING(SS_LCTL(SS_RSFT(SS_TAP(X_TAB)))); + } + } + break; + case M_NTAB: + /* Command + } or next tab*/ + if (record->event.pressed) { + if (use_cmd) { + SEND_STRING(SS_LGUI(SS_RSFT(SS_TAP(X_RBRC)))); + } else { + SEND_STRING(SS_LCTL(SS_TAP(X_TAB))); + } + } + break; + case M_ZOUT: + /* Command + - or Ctrl + -*/ + if (record->event.pressed) { + if (use_cmd) { + SEND_STRING(SS_LGUI(SS_TAP(X_MINS))); + } else { + SEND_STRING(SS_LCTL(SS_TAP(X_MINS))); + } + } + break; + case M_ZOIN: + /* Command + = or Ctrl + =*/ + if (record->event.pressed) { + if (use_cmd) { + SEND_STRING(SS_LGUI(SS_TAP(X_EQL))); + } else { + SEND_STRING(SS_LCTL(SS_TAP(X_EQL))); + } + } + break; + case M_ENTR: + /* Command + Enter or Ctrl + Enter*/ + if (record->event.pressed) { + if (use_cmd) { + SEND_STRING(SS_LGUI(SS_TAP(X_ENT))); + } else { + SEND_STRING(SS_LCTL(SS_TAP(X_ENT))); + } + } + break; + case M_NSPC: + /* Next space / desktop */ + if (record->event.pressed) { + if (use_cmd) { + SEND_STRING(SS_LCTL(SS_TAP(X_RIGHT))); + } else { + SEND_STRING(SS_LGUI(SS_TAP(X_RIGHT))); + } + } + break; + case M_PSPC: + /* Previous space / desktop */ + if (record->event.pressed) { + if (use_cmd) { + SEND_STRING(SS_LCTL(SS_TAP(X_LEFT))); + } else { + SEND_STRING(SS_LGUI(SS_TAP(X_LEFT))); + } + } + break; + case M_APPN: + /* Next or previous app */ + if (record->event.pressed) { + if (use_cmd) { + SEND_STRING(SS_LGUI(SS_TAP(X_GRV))); + } else { + SEND_STRING(SS_LALT(SS_TAP(X_TAB))); + } + break; + } + case M_APPP: + /* Next or previous app (reverse) */ + if (record->event.pressed) { + if (use_cmd) { + SEND_STRING(SS_LGUI(SS_LSFT(SS_TAP(X_GRV)))); + } else { + SEND_STRING(SS_LALT(SS_LSFT(SS_TAP(X_TAB)))); + } + break; + } + + case M_OUML: + adi_umlaut_macro(KC_O, record); + break; + + case M_AUML: + adi_umlaut_macro(KC_A, record); + break; + + case M_UUML: + adi_umlaut_macro(KC_U, record); + break; + + case M_IUML: + adi_umlaut_macro(KC_I, record); + break; + + case M_SZET: + if (record->event.pressed) { + register_code(KC_LALT); + register_code(KC_S); + } else { + unregister_code(KC_S); + unregister_code(KC_LALT); + } + break; + } + return true; +}; + +// Combo definitions + +#ifdef COMBO_ENABLE +enum combos { + COMBO_CAPS, + COMBO_SCROT, + COMBO_SCROT_SAVE, + COMBO_ESC, + COMBO_COPY, + COMBO_PASTE, + COMBO_CUT, + COMBO_BSPC, + COMBO_ALT_BSPC, + COMBO_UNDO, + COMBO_LENGTH, +}; + +uint16_t COMBO_LEN = COMBO_LENGTH; // remove the COMBO_COUNT define and use this instead! + +const uint16_t PROGMEM combo_caps[] = {KC_RSFT, KC_LSFT, COMBO_END}; +const uint16_t PROGMEM combo_scrot[] = {KC_DOT, KC_COMM, COMBO_END}; +const uint16_t PROGMEM combo_scrot_save[] = {KC_DOT, KC_COMM, KC_SLASH, COMBO_END}; +const uint16_t PROGMEM combo_esc[] = {KC_J, KC_K, COMBO_END}; +const uint16_t PROGMEM combo_copy[] = {KC_U, KC_J, COMBO_END}; +const uint16_t PROGMEM combo_paste[] = {KC_U, KC_I, KC_O, COMBO_END}; +const uint16_t PROGMEM combo_cut[] = {KC_U, KC_J, KC_O, COMBO_END}; +const uint16_t PROGMEM combo_bspc[] = {KC_M, KC_COMM, COMBO_END}; +const uint16_t PROGMEM combo_alt_bspc[] = {KC_M, KC_COMM, KC_DOT, COMBO_END}; +const uint16_t PROGMEM combo_undo[] = {KC_K, KC_I, COMBO_END}; + +combo_t key_combos[] = { + [COMBO_CAPS] = COMBO(combo_caps, CW_TOGG), + [COMBO_SCROT] = COMBO(combo_scrot, LGUI(LSFT(LCTL(KC_4)))), + [COMBO_SCROT_SAVE] = COMBO(combo_scrot_save, LGUI(LSFT(KC_4))), + [COMBO_ESC] = COMBO(combo_esc, KC_ESC), + [COMBO_COPY] = COMBO(combo_copy, LGUI(KC_C)), + [COMBO_PASTE] = COMBO(combo_paste, LGUI(KC_V)), + [COMBO_CUT] = COMBO(combo_cut, LGUI(KC_X)), + [COMBO_BSPC] = COMBO(combo_bspc, KC_BSPC), + [COMBO_ALT_BSPC] = COMBO(combo_alt_bspc, LALT(KC_BSPC)), + [COMBO_UNDO] = COMBO(combo_undo, LGUI(KC_Z)), +}; + +#ifdef COMBO_TERM_PER_COMBO +#define COMBO_TERM_SHORT 30 + +uint16_t get_combo_term(uint16_t index, combo_t *combo) { + switch (index) { + case COMBO_BSPC: + return COMBO_TERM_SHORT; + default: + return COMBO_TERM; + } +} +#endif + +#endif + +// Encoder definitions +#ifdef ENCODER_ENABLE +bool encoder_update_user(uint8_t index, bool counter_clockwise) { + bool clockwise = !counter_clockwise; + switch(get_highest_layer(layer_state|default_layer_state)) { + case _QWERTY: + // No layer is on + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + break; + + case _MEDIA: + if (clockwise) { + tap_code_delay(KC_VOLU, MEDIA_KEY_DELAY); + } else { + tap_code_delay(KC_VOLD, MEDIA_KEY_DELAY); + } + break; + + case _LOWER: + if (clockwise) { + tap_code(KC_RIGHT); + } else { + tap_code(KC_LEFT); + } + break; + + case _RAISE: + if (clockwise) { + tap_code(KC_DOWN); + } else { + tap_code(KC_UP); + } + break; + + case _MOUSE: + if (get_mods() & (MOD_BIT(KC_RGUI) | MOD_BIT(KC_LGUI))) { + if (clockwise) { + tap_code(KC_MS_D); + tap_code(KC_MS_D); + } else { + tap_code(KC_MS_U); + tap_code(KC_MS_U); + } + } else { + if (clockwise) { + tap_code(KC_MS_R); + tap_code(KC_MS_R); + } else { + tap_code(KC_MS_L); + tap_code(KC_MS_L); + } + } + break; + + case _ENTFN: + if (clockwise) { + SEND_STRING(SS_LGUI(SS_RSFT("]"))); + } else { + SEND_STRING(SS_LGUI(SS_RSFT("["))); + } + break; + } + + return false; +} +#endif diff --git a/users/adi/rules.mk b/users/adi/rules.mk new file mode 100644 index 000000000000..4711d2ff748d --- /dev/null +++ b/users/adi/rules.mk @@ -0,0 +1 @@ +CAPS_WORD_ENABLE = yes