diff options
author | toinux <toinux@gmail.com> | 2022-04-22 09:41:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 17:41:54 +1000 |
commit | d8b9796a32b9e7105e0af485d697886f230c094f (patch) | |
tree | 04af6e259035b0fad3da2ce2e43a292ea67c146f /keyboards/crkbd | |
parent | 97b861d104a006619d4563c4fc6cbe7acc3e3fe2 (diff) | |
download | qmk_firmware-d8b9796a32b9e7105e0af485d697886f230c094f.tar.gz qmk_firmware-d8b9796a32b9e7105e0af485d697886f230c094f.zip |
[Keymap] Toinux's crkbd keymap and userspace (#16437)
Diffstat (limited to 'keyboards/crkbd')
-rw-r--r-- | keyboards/crkbd/keymaps/toinux/config.h | 122 | ||||
-rw-r--r-- | keyboards/crkbd/keymaps/toinux/glcdfont.c | 232 | ||||
-rw-r--r-- | keyboards/crkbd/keymaps/toinux/keycodes.h | 49 | ||||
-rw-r--r-- | keyboards/crkbd/keymaps/toinux/keymap.c | 250 | ||||
-rw-r--r-- | keyboards/crkbd/keymaps/toinux/oled.c | 112 | ||||
-rw-r--r-- | keyboards/crkbd/keymaps/toinux/oled.h | 71 | ||||
-rw-r--r-- | keyboards/crkbd/keymaps/toinux/rgb.c | 68 | ||||
-rw-r--r-- | keyboards/crkbd/keymaps/toinux/rules.mk | 9 |
8 files changed, 913 insertions, 0 deletions
diff --git a/keyboards/crkbd/keymaps/toinux/config.h b/keyboards/crkbd/keymaps/toinux/config.h new file mode 100644 index 0000000000..e7a18800d8 --- /dev/null +++ b/keyboards/crkbd/keymaps/toinux/config.h @@ -0,0 +1,122 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako <wakojun@gmail.com> +Copyright 2015 Jack Humbert + +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 <http://www.gnu.org/licenses/>. +*/ + +#pragma once + +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +//#define TAPPING_FORCE_HOLD +//#define TAPPING_TERM 100 + +#ifdef RGBLIGHT_ENABLE + #define RGBLIGHT_EFFECT_BREATHING + // #define RGBLIGHT_EFFECT_RAINBOW_MOOD + // #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + #define RGBLIGHT_EFFECT_RGB_TEST + #define RGBLIGHT_EFFECT_ALTERNATING + #define RGBLIGHT_EFFECT_TWINKLE + #define RGBLIGHT_LIMIT_VAL 120 + #define RGBLIGHT_HUE_STEP 10 + #define RGBLIGHT_SAT_STEP 17 + #define RGBLIGHT_VAL_STEP 17 +#endif + +#ifdef RGB_MATRIX_ENABLE +# define RGB_MATRIX_KEYPRESSES // reacts to keypresses +// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) +// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS +// # define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) +// # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash. +# define RGB_MATRIX_HUE_STEP 8 +# define RGB_MATRIX_SAT_STEP 8 +# define RGB_MATRIX_VAL_STEP 8 +# define RGB_MATRIX_SPD_STEP 10 + +/* Enable the animations you want/need. You may need to enable only a small number of these because * + * they take up a lot of space. Enable and confirm that you can still successfully compile your firmware. */ +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +// # define ENABLE_RGB_MATRIX_ALPHAS_MODS +// # define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +// # define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +// # define ENABLE_RGB_MATRIX_BREATHING +// # define ENABLE_RGB_MATRIX_BAND_SAT +// # define ENABLE_RGB_MATRIX_BAND_VAL +// # define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +// # define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +// # define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +// # define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +// # define ENABLE_RGB_MATRIX_CYCLE_ALL +// # define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +// # define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +// # define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +// # define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +// # define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +// # define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +// # define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +// # define ENABLE_RGB_MATRIX_DUAL_BEACON +// # define ENABLE_RGB_MATRIX_RAINBOW_BEACON +// # define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +// # define ENABLE_RGB_MATRIX_RAINDROPS +// # define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +// # define ENABLE_RGB_MATRIX_HUE_BREATHING +// # define ENABLE_RGB_MATRIX_HUE_PENDULUM +// # define ENABLE_RGB_MATRIX_HUE_WAVE +// # define ENABLE_RGB_MATRIX_PIXEL_RAIN +// # define ENABLE_RGB_MATRIX_PIXEL_FLOW +// # define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +// # define ENABLE_RGB_MATRIX_TYPING_HEATMAP +// # define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +// # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +// # define ENABLE_RGB_MATRIX_SOLID_REACTIVE +// # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +// # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +// # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +// # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +// # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +# define ENABLE_RGB_MATRIX_SPLASH +// # define ENABLE_RGB_MATRIX_MULTISPLASH +// # define ENABLE_RGB_MATRIX_SOLID_SPLASH +// # define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH +#endif + +#define OLED_FONT_H "keyboards/crkbd/keymaps/toinux/glcdfont.c" + +#define SPLIT_LAYER_STATE_ENABLE +// #define SPLIT_LED_STATE_ENABLE + +#define LAYER_STATE_16BIT diff --git a/keyboards/crkbd/keymaps/toinux/glcdfont.c b/keyboards/crkbd/keymaps/toinux/glcdfont.c new file mode 100644 index 0000000000..74cce5a952 --- /dev/null +++ b/keyboards/crkbd/keymaps/toinux/glcdfont.c @@ -0,0 +1,232 @@ +// 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 +const unsigned char font[] PROGMEM = { + 0x24, 0x7E, 0x24, 0x24, 0x7E, 0x24, + 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, 0xD4, 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, + 0x48, 0x54, 0x54, 0x54, 0x28, 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, 0x50, 0x50, 0x50, 0x3C, 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, + 0x83, 0xC3, 0xC3, 0xC3, 0x9B, 0x03, + 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x36, 0x32, 0x32, 0x32, 0x32, 0x32, + 0x32, 0xE6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xE1, 0xFE, + 0xFF, 0xE1, 0xFF, 0xFF, 0xFF, 0xFF, + 0x80, 0x80, 0x80, 0x80, 0x9E, 0x81, + 0x80, 0x9E, 0x80, 0x80, 0x80, 0x80, + 0xFF, 0xEF, 0xD7, 0x0F, 0xDF, 0xDF, + 0xDF, 0xDF, 0x0F, 0xD7, 0xEF, 0xFF, + 0x01, 0x11, 0x29, 0xF1, 0x21, 0x21, + 0x21, 0x21, 0xF1, 0x29, 0x11, 0x01, + 0x00, 0x00, 0x00, 0xFC, 0xFE, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0xEF, + 0xDF, 0xBF, 0x7F, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFE, 0xFC, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xFC, 0x02, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x09, 0x11, + 0x21, 0x41, 0x81, 0x01, 0x01, 0x01, + 0x01, 0x02, 0xFC, 0x00, 0x00, 0x00, + 0x3E, 0xFF, 0xF8, 0xF8, 0xFF, 0x3E, + 0x00, 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, + 0x63, 0x73, 0x7B, 0x6F, 0x67, 0x63, + 0x07, 0x7F, 0x7F, 0x07, 0x7F, 0x7F, + 0x08, 0x08, 0x7F, 0x3E, 0x1C, 0x08, + 0x08, 0x1C, 0x3E, 0x7F, 0x08, 0x08, + 0x63, 0x7F, 0x7F, 0x63, 0x7F, 0x3E, + 0x1F, 0x3F, 0x63, 0x63, 0x3F, 0x1F, + 0x73, 0x3B, 0x1F, 0x1F, 0x3B, 0x73, + 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x8F, 0x8C, 0x0C, 0x0C, 0x0F, 0x0C, + 0x8C, 0xAC, 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, + 0x80, 0x83, 0x82, 0x82, 0x9E, 0x88, + 0x84, 0x82, 0x81, 0x80, 0x80, 0x80, + 0xFF, 0xEF, 0xD7, 0xE0, 0xF7, 0xF7, + 0xF7, 0xF7, 0xE0, 0xD7, 0xEF, 0xFF, + 0x00, 0x10, 0x28, 0x1F, 0x08, 0x08, + 0x08, 0x08, 0x1F, 0x28, 0x10, 0x00, + 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xEF, + 0xF7, 0xFB, 0xFD, 0xFE, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, + 0x08, 0x04, 0x02, 0x01, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0xFF, 0xFF, 0xBD, 0x81, 0x81, 0x00, + 0x63, 0x7F, 0x7F, 0x63, 0x7F, 0x3E, + 0x3E, 0x7F, 0x77, 0x77, 0x77, 0x77, + 0x08, 0x08, 0x7F, 0x3E, 0x1C, 0x08, + 0x08, 0x1C, 0x3E, 0x7F, 0x08, 0x08, + 0x7F, 0x7F, 0x03, 0x03, 0x7F, 0x7F, + 0x1C, 0x1C, 0x1C, 0x1C, 0x7F, 0x7F, + 0x03, 0x7F, 0x7F, 0x63, 0x7F, 0x1F, + 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xD9, 0x99, 0x9B, 0x9E, 0x9E, 0x9B, + 0x99, 0xD9, 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, + 0xFF, 0xFC, 0xFD, 0xFD, 0xE1, 0xF7, + 0xFB, 0xFD, 0xFE, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x7F, 0xBF, 0xDF, 0xE1, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x40, 0x3C, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3F, 0x7F, 0xFF, + 0xFF, 0x1F, 0xDF, 0xDF, 0xC3, 0xF7, + 0xEF, 0xDF, 0xBF, 0x7F, 0xFF, 0xFF, + 0xFF, 0x7F, 0x3F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3F, 0x40, 0x80, + 0x00, 0xE0, 0x20, 0x20, 0x3C, 0x08, + 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, + 0x80, 0x40, 0x3F, 0x00, 0x00, 0x00, + 0x00, 0x7F, 0xE3, 0xE3, 0x7F, 0x00, + 0x00, 0x07, 0x0F, 0x0F, 0x0F, 0x07, + 0x1C, 0x3E, 0x77, 0x63, 0x63, 0x63, + 0x63, 0x73, 0x7B, 0x6F, 0x67, 0x63, + 0x08, 0x08, 0x7F, 0x3E, 0x1C, 0x08, + 0x08, 0x1C, 0x3E, 0x7F, 0x08, 0x08, + 0x7F, 0x7F, 0x03, 0x03, 0x7F, 0x7F, + 0x7F, 0x7F, 0x03, 0x03, 0x7F, 0x7F, + 0x3E, 0x7F, 0x63, 0x63, 0x63, 0x63, + 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/keyboards/crkbd/keymaps/toinux/keycodes.h b/keyboards/crkbd/keymaps/toinux/keycodes.h new file mode 100644 index 0000000000..7d812f5c74 --- /dev/null +++ b/keyboards/crkbd/keymaps/toinux/keycodes.h @@ -0,0 +1,49 @@ +/* Copyright 2022 toinux + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#pragma once + +enum crkbd_layers { + _BASE, + _GAMING, + _GAMING2, + _ACCENTS, + _LOWER, + _RAISE, + _FUN, + _NAV, + _MOUSE, + _ADJUST +}; + +#define CTRLSC LCTL_T(KC_ESC) +#define QUORCTL RCTL_T(KC_QUOT) +#define MOSCLN LT(_MOUSE,KC_SCLN) +#define ACCENTS LT(_ACCENTS,KC_RALT) +#define FUN LT(_FUN,KC_SPC) +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define SPCNAV LT(_NAV,KC_SPC) +#define SFTENT MT(MOD_RSFT,KC_ENT) +#define TABLGUI LGUI_T(KC_TAB) +#define BASE DF(_BASE) +#define GAMING DF(_GAMING) +#define GAMING2 MO(_GAMING2) + +#define SC_F1 LSFT(LCTL(KC_F1)) +#define SC_F2 LSFT(LCTL(KC_F2)) +#define SC_F3 LSFT(LCTL(KC_F3)) +#define SC_F4 LSFT(LCTL(KC_F4)) diff --git a/keyboards/crkbd/keymaps/toinux/keymap.c b/keyboards/crkbd/keymaps/toinux/keymap.c new file mode 100644 index 0000000000..ae3de00b79 --- /dev/null +++ b/keyboards/crkbd/keymaps/toinux/keymap.c @@ -0,0 +1,250 @@ +/* +Copyright 2019 @foostan +Copyright 2020 Drashna Jaelre <@drashna> +Copyright 2022 @toinux + +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 <http://www.gnu.org/licenses/>. +*/ + +#include QMK_KEYBOARD_H +#include "users/toinux/keymap_qwerty_fr.h" +#include "keycodes.h" + +#ifdef OLED_ENABLE +#include "oled.h" +#endif + +// TEMPLATE +// ,-----------------------------------------------------. ,-----------------------------------------------------. +// | | | | | | | | | | | | | | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | | | | | | | | | | | | | | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | | | | | | | | | | | | | | +// `--------+--------+--------+--------+--------+--------+--------. .--------+--------+--------+--------+--------+--------+--------' +// | | | | | | | | +// `--------------------------' `--------------------------' + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Base +// ,-----------------------------------------------------. ,-----------------------------------------------------. +// |Tab/LGui| Q | W | E | R | T | | Y | U | I | O | P | Bksp | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | CtrlSc | A | S | D | F | G | | H | J | K | L | ;/Mous | '/Rctl | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | Shift | Z | X | C | V | B | | N | M | , | . | / | SftEnT | +// `--------+--------+--------+--------+--------+--------+--------. .--------+--------+--------+--------+--------+--------+--------' +// | LALT | LOWER |Spc/FUN | | Spc/NAV| RAISE |ACCENTS | +// `--------------------------' `--------------------------' + [_BASE] = LAYOUT_split_3x6_3( + TABLGUI, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + CTRLSC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, MOSCLN, QUORCTL, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFTENT, + KC_LALT, LOWER, FUN, SPCNAV, RAISE, ACCENTS + + ), + +// Gaming +// ,-----------------------------------------------------. ,-----------------------------------------------------. +// | Esc | Q | W | E | R | T | | Y | U | I | O | P | Bksp | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | Ctrl | A | S | D | F | G | | H | J | K | L | ;/Mous | ' | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | Shift | Z | X | C | V | B | | N | M | , | . | / | SftEnT | +// `--------+--------+--------+--------+--------+--------+--------. .--------+--------+--------+--------+--------+--------+--------' +// | LALT |GAMING2 | Space | | Spc/NAV| RAISE |ACCENTS | +// `--------------------------' `--------------------------' + [_GAMING] = LAYOUT_split_3x6_3( + 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_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, MOSCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFTENT, + KC_LALT, GAMING2, KC_SPC, SPCNAV, RAISE, ACCENTS + + ), + +// Gaming 2 +// ,-----------------------------------------------------. ,-----------------------------------------------------. +// | Tab | 1 | 2 | 3 | 4 | 5 | | | | | | | | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | Ctrl | 6 | 7 | 8 | 9 | 0 | | | | | | | | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | LGui | Base | | Vol- | Vol+ | Mute | | | | | | | | +// `--------+--------+--------+--------+--------+--------+--------. .--------+--------+--------+--------+--------+--------+--------' +// | | | | | | | | +// `--------------------------' `--------------------------' + [_GAMING2] = LAYOUT_split_3x6_3( + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LCTL, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LGUI, BASE, XXXXXXX, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, _______, _______ + + ), + +// Accents, see http://marin.jb.free.fr/qwerty-fr/ +// ,-----------------------------------------------------. ,-----------------------------------------------------. +// | | â | é | è | ê | € | | û | ù | î | ô | œ | | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | | à | æ | ë | | « | | » | ü | ï | ö | ° | | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | | à | | ç | | | | | | | | | | +// `--------+--------+--------+--------+--------+--------+--------. .--------+--------+--------+--------+--------+--------+--------' +// | | | | | | | | +// `--------------------------' `--------------------------' + [_ACCENTS] = LAYOUT_split_3x6_3( + _______, QF_ACIR, QF_EACU, QF_EGRV, QF_ECIR, QF_EURO, QF_UCIR, QF_UGRV, QF_ICIR, QF_OCIR, QF_OE, _______, + _______, QF_AGRV, QF_AE, QF_EDIA, _______, QF_LDAQ, QF_RDAQ, QF_UDIA, QF_IDIA, QF_ODIA, QF_DEG, _______, + _______, QF_AGRV, _______, QF_CCED, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______ + + ), + +// Lower +// ,-----------------------------------------------------. ,-----------------------------------------------------. +// | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Del | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | | SC_F1 | SC_F2 | SC_F3 | SC_F4 | | | | _ | + | { | } | | | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | | Gaming | | Vol- | Vol+ | Mute | | | | | | | | +// `--------+--------+--------+--------+--------+--------+--------. .--------+--------+--------+--------+--------+--------+--------' +// | | | | | | | | +// `--------------------------' `--------------------------' + [_LOWER] = LAYOUT_split_3x6_3( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, SC_F1, SC_F2, SC_F3, SC_F4, XXXXXXX, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, GAMING, XXXXXXX, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, _______, _______ + + ), + +// Raise +// ,-----------------------------------------------------. ,-----------------------------------------------------. +// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | | | | | | | | | - | = | [ | ] | \ | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | | | | | | | | | | | | | | +// `--------+--------+--------+--------+--------+--------+--------. .--------+--------+--------+--------+--------+--------+--------' +// | | | | | | | | +// `--------------------------' `--------------------------' + [_RAISE] = LAYOUT_split_3x6_3( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, _______, _______ + + ), + +// Functions and keypad +// ,-----------------------------------------------------. ,-----------------------------------------------------. +// | | F1 | F2 | F2 | F4 | | | | 7 | 8 | 9 | | | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | | F5 | F6 | F7 | F8 | | | | 4 | 5 | 6 | - | / | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | | F9 | F10 | F11 | F12 | | | | 1 | 2 | 3 | + | * | +// `--------+--------+--------+--------+--------+--------+--------. .--------+--------+--------+--------+--------+--------+--------' +// | | | | | = | 0 | . | +// `--------------------------' `--------------------------' + [_FUN] = LAYOUT_split_3x6_3( + _______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_P7, KC_P8, KC_P9, XXXXXXX, _______, + _______, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, XXXXXXX, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_PSLS, + _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PAST, + _______, _______, _______, KC_PENT, KC_P0, KC_PDOT + + ), + +// Navigation and function keys +// ,-----------------------------------------------------. ,-----------------------------------------------------. +// | | F1 | F2 | F2 | F4 | | | | Pg Up | Up | Pg Dn | Ins | Del | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | | F5 | F6 | F7 | F8 | | | Home | Left | Down | Right | | | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | | F9 | F10 | F11 | F12 | | | Space | End | | | | | +// `--------+--------+--------+--------+--------+--------+--------. .--------+--------+--------+--------+--------+--------+--------' +// | | | | | | | | +// `--------------------------' `--------------------------' + [_NAV] = LAYOUT_split_3x6_3( + _______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_INS, KC_DEL, + _______, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, + _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_SPC, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, _______, _______ + + ), + +// Mouse +// ,-----------------------------------------------------. ,-----------------------------------------------------. +// | | | Wh up | Ms up | Wh dn | | | | | | | | | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | | | Ms lft | Ms dn | Ms rgt | | | | btn1 | btn3 | btn2 | | | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | | | Wh lft | | Wh rgt | | | | | | | | | +// `--------+--------+--------+--------+--------+--------+--------. .--------+--------+--------+--------+--------+--------+--------' +// | | | | | | | | +// `--------------------------' `--------------------------' + [_MOUSE] = LAYOUT_split_3x6_3( + _______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, KC_BTN1, KC_BTN3, KC_BTN2, _______, _______, + _______, _______, KC_WH_L, _______, KC_WH_R, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______ + + ), + +// Adjust +// ,-----------------------------------------------------. ,-----------------------------------------------------. +// | Reset | | | | | Print | | Num | Caps | Scroll | | | | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | On/Off | Hue ↑ | Sat ↑ | Brght ↑| | | | | | | | | | +// |--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| +// | Cycle | Hue ↓ | Sat ↓ | Brght ↓| | | | | | | | | | +// `--------+--------+--------+--------+--------+--------+--------. .--------+--------+--------+--------+--------+--------+--------' +// | | | | | | | | +// `--------------------------' `--------------------------' + [_ADJUST] = LAYOUT_split_3x6_3( + RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, KC_NLCK, KC_CAPS, KC_SCRL, XXXXXXX, XXXXXXX, XXXXXXX, + RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, _______, _______ + ) +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + +#ifdef OLED_ENABLE + if (record->event.pressed) { + set_keylog(keycode, record); + } +#endif // OLED_ENABLE + + switch (keycode) { + case FUN: + if (!host_keyboard_led_state().num_lock) { + tap_code(KC_NUMLOCK); + } + return true; + break; + } + return true; +} + +void keyboard_post_init_user(void) { +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); + rgb_matrix_sethsv_noeeprom(HSV_OFF); +#endif +} diff --git a/keyboards/crkbd/keymaps/toinux/oled.c b/keyboards/crkbd/keymaps/toinux/oled.c new file mode 100644 index 0000000000..df2a693d8d --- /dev/null +++ b/keyboards/crkbd/keymaps/toinux/oled.c @@ -0,0 +1,112 @@ +/* Copyright 2022 @toinux + * + * 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 <http://www.gnu.org/licenses/>. + */ + + +#include QMK_KEYBOARD_H +#include "keycodes.h" +#include "oled.h" + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (!is_keyboard_master()) { + return OLED_ROTATION_180; // flips the display 180 degrees if offhand + } + return rotation; +} + + +void oled_render_mod_status(void) { + + const uint8_t modifiers = get_mods() | get_oneshot_mods(); + + for (uint8_t i = 0; i < 2; i++) { + oled_set_cursor(9,i); + oled_write_P(gui_icon[(modifiers & MOD_MASK_GUI) ? 1 : 0][i], false); + oled_write_P(ctrl_icon[(modifiers & MOD_MASK_CTRL) ? 1 : 0][i], false); + oled_set_cursor(9,i+2); + oled_write_P(alt_icon[(modifiers & MOD_MASK_ALT) ? 1 : 0][i], false); + oled_write_P(shift_icon[(modifiers & MOD_MASK_SHIFT) ? 1 : 0][i], false); + } + +} + +void oled_render_layer_state(void) { + + char c = 0x9F - get_highest_layer(layer_state|default_layer_state); + + oled_set_cursor(20,0); + oled_write_char(0X00, false); + + oled_set_cursor(20,1); + oled_write_char(c, false); + c += 32; + oled_set_cursor(20,2); + oled_write_char(c, false); + c += 32; + oled_set_cursor(20,3); + oled_write_char(c, false); + +} + +void oled_render_led_state(void) { + // oled_advance_page(false) instead of oled_write_ln_P to not break OLED_TIMEOUT + oled_write_P(PSTR("NUM"), host_keyboard_led_state().num_lock); + oled_advance_page(false); + oled_write_P(PSTR("CAP"), host_keyboard_led_state().caps_lock); + oled_advance_page(false); + oled_write_P(PSTR("SCL"), host_keyboard_led_state().scroll_lock); + oled_advance_page(false); +} + +uint8_t last_row = 0; +uint8_t last_col = 0; + +void set_keylog(uint16_t keycode, keyrecord_t *record) { + last_row = record->event.key.row; + last_col = record->event.key.col; +} + +void oled_render_keylog(void) { + oled_write_char(last_row + '0', false); + oled_write_char('x', false); + oled_write_char(last_col + '0', false); +} + +void oled_render_logo(void) { + static const char PROGMEM kpu_logo[][3] = { + {0x82, 0x83, 0}, + {0x80, 0x81, 0}, + {0xa0, 0xa1, 0}, + {0xc0, 0xc1, 0} + }; + for (uint8_t i = 0; i < 4; i++) { + oled_write_ln_P(kpu_logo[i], false); + } + +} + +bool oled_task_user(void) { + if (is_keyboard_master ()) { + oled_render_led_state(); + oled_render_keylog(); + oled_render_mod_status(); + oled_render_layer_state(); + } else { + oled_render_logo(); + oled_scroll_right(); + oled_scroll_set_speed(4); + } + return false; +} diff --git a/keyboards/crkbd/keymaps/toinux/oled.h b/keyboards/crkbd/keymaps/toinux/oled.h new file mode 100644 index 0000000000..30be16e602 --- /dev/null +++ b/keyboards/crkbd/keymaps/toinux/oled.h @@ -0,0 +1,71 @@ +/* Copyright 2022 @toinux + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#pragma once + +static const char PROGMEM ctrl_icon[2][2][4] = { + { + // off + {0x93, 0x94, 0x95, 0}, + {0xB3, 0xB4, 0xB5, 0}, + }, + { + // on + {0x8F ,0x90, 0x91, 0}, + {0xAF ,0xB0, 0xB1, 0}, + } +}; + +static const char PROGMEM shift_icon[2][2][4] = { + { + // off + {0xD3, 0xD4, 0xB5, 0}, + {0xA8, 0xA9, 0xD5, 0}, + }, + { + // on + {0xCF ,0xD0, 0xB1, 0}, + {0xC8 ,0xC9, 0xD1, 0}, + } +}; + +static const char PROGMEM gui_icon[2][2][4] = { + { + // off + {0x92, 0x8C, 0x8D, 0}, + {0xB2, 0xAC, 0xAD, 0}, + }, + { + // on + {0x8E ,0x8A, 0x8B, 0}, + {0xAE ,0xAA, 0xAB, 0}, + } +}; + +static const char PROGMEM alt_icon[2][2][4] = { + { + // off + {0xB2, 0xCC, 0xCD, 0}, + {0xD2, 0x88, 0x89, 0}, + }, + { + // on + {0xAE ,0xCA, 0xCB, 0}, + {0xCE ,0x86, 0x87, 0}, + } +}; + +void set_keylog(uint16_t keycode, keyrecord_t *record); diff --git a/keyboards/crkbd/keymaps/toinux/rgb.c b/keyboards/crkbd/keymaps/toinux/rgb.c new file mode 100644 index 0000000000..2c5de3b0a7 --- /dev/null +++ b/keyboards/crkbd/keymaps/toinux/rgb.c @@ -0,0 +1,68 @@ +/* Copyright 2022 @toinux + * + * 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 <http://www.gnu.org/licenses/>. + */ + + +#include QMK_KEYBOARD_H +#include "keycodes.h" + +static const char gaming_leds[] = {18, 22, 19, 16}; +static const char gaming2_leds[] = {23, 18, 17, 10, 9, 22, 19, 16, 11, 8}; +static const char nav_leds[] = {38, 43, 44, 46}; +static const char fun_leds[] = {45, 44, 37, 46, 43, 38, 47, 42, 39, 40}; +static const char mouse_leds[] = {11, 16, 17, 19}; + +void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + if (host_keyboard_led_state().caps_lock) { + rgb_matrix_set_color(26, RGB_RED); + } + switch(get_highest_layer(layer_state|default_layer_state)) { + case _GAMING: + if (is_keyboard_master()) { + for (uint8_t i = 0; i < 4; i++) { + rgb_matrix_set_color(gaming_leds[i], RGB_RED); + } + } + break; + case _GAMING2: + if (is_keyboard_master()) { + for (uint8_t i = 0; i < 10; i++) { + rgb_matrix_set_color(gaming2_leds[i], RGB_GREEN); + } + } + break; + case _NAV: + for (uint8_t i = 0; i < 4; i++) { + rgb_matrix_set_color(nav_leds[i], RGB_BLUE); + } + break; + case _FUN: + for (uint8_t i = 0; i < 10; i++) { + rgb_matrix_set_color(fun_leds[i], RGB_GREEN); + } + break; + case _ADJUST: + rgb_matrix_set_color(6, RGB_RED); + break; + case _MOUSE: + if (is_keyboard_master()) { + for (uint8_t i = 0; i < 4; i++) { + rgb_matrix_set_color(mouse_leds[i], RGB_PURPLE); + } + } + break; + + } +} diff --git a/keyboards/crkbd/keymaps/toinux/rules.mk b/keyboards/crkbd/keymaps/toinux/rules.mk new file mode 100644 index 0000000000..07c98a08f8 --- /dev/null +++ b/keyboards/crkbd/keymaps/toinux/rules.mk @@ -0,0 +1,9 @@ +MOUSEKEY_ENABLE = yes # Mouse keys +RGBLIGHT_ENABLE = no +RGB_MATRIX_ENABLE = yes +OLED_ENABLE = yes +OLED_DRIVER = SSD1306 +LTO_ENABLE = yes +BOOTLOADER = atmel-dfu + +SRC += ./oled.c ./rgb.c |