From 4d3a6d96f76793696fbcccefc02b6d8659c9a0c7 Mon Sep 17 00:00:00 2001 From: nvhung9 Date: Wed, 9 Nov 2022 15:07:42 +0700 Subject: [PATCH] update_bongocat_mousekey --- .../shields/corne/boards/nrfmicro_13.overlay | 39 +++++ app/boards/shields/corne/corne.conf | 36 +++- app/boards/shields/corne/corne.keymap | 157 +++++++++++++----- app/boards/shields/corne/corne_left.conf | 17 ++ app/boards/shields/corne/corne_right.conf | 16 ++ app/src/display/Kconfig | 2 +- app/src/display/widgets/Kconfig | 5 +- app/src/display/widgets/battery_status.c | 4 +- app/src/display/widgets/output_status.c | 2 +- 9 files changed, 224 insertions(+), 54 deletions(-) create mode 100644 app/boards/shields/corne/boards/nrfmicro_13.overlay diff --git a/app/boards/shields/corne/boards/nrfmicro_13.overlay b/app/boards/shields/corne/boards/nrfmicro_13.overlay new file mode 100644 index 00000000..b2e5d04e --- /dev/null +++ b/app/boards/shields/corne/boards/nrfmicro_13.overlay @@ -0,0 +1,39 @@ +#include + + +&spi1 { + + compatible = "nordic,nrf-spim"; + /* Cannot be used together with i2c0. */ + status = "okay"; + mosi-pin = <6>; //gpio 0.06 + // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. + sck-pin = <5>; + miso-pin = <7>; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; + spi-max-frequency = <5250000>; + + /* WS2812 */ + chain-length = <27>; /* number of LEDs */ + spi-one-frame = <0x70>; /* make sure to configure this properly for your SOC */ + spi-zero-frame = <0x40>; /* make sure to configure this properly for your SOC */ + color-mapping = ; + }; +}; + +/ { + + chosen { + zmk,underglow = &led_strip; + zmk,battery = &vbatt; + }; + +}; diff --git a/app/boards/shields/corne/corne.conf b/app/boards/shields/corne/corne.conf index 974243c8..1cab0190 100644 --- a/app/boards/shields/corne/corne.conf +++ b/app/boards/shields/corne/corne.conf @@ -1,6 +1,36 @@ # Uncomment the following lines to enable the Corne RGB Underglow -# CONFIG_ZMK_RGB_UNDERGLOW=y -# CONFIG_WS2812_STRIP=y +CONFIG_ZMK_RGB_UNDERGLOW=y +# Use the STRIP config specific to the LEDs you're using +CONFIG_WS2812_STRIP=y # Uncomment the following line to enable the Corne OLED Display -# CONFIG_ZMK_DISPLAY=y +CONFIG_ZMK_DISPLAY=y +#CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=n + +# Enable a widget to show words per minute +# CONFIG_ZMK_WIDGET_WPM_STATUS=n + +# CONFIG_ZMK_WIDGET_LAYER_STATUS=n +# CONFIG_ZMK_WIDGET_PERIPHERAL_STATUS=n + +# Bongo cat +# CONFIG_ZMK_WIDGET_BONGO_CAT=y + +# Mouse key +CONFIG_ZMK_MOUSE=y + + + + + +# OLED Reverse "black on white" or "white on black" +CONFIG_SSD1306_REVERSE_MODE=y + +# Milliseconds of inactivity before entering idle state (5 minute) +# CONFIG_ZMK_IDLE_TIMEOUT=300000 + +# Enable deep sleep support +CONFIG_ZMK_SLEEP=y + +# Milliseconds of inactivity before entering deep sleep (15 minutes) +CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000 diff --git a/app/boards/shields/corne/corne.keymap b/app/boards/shields/corne/corne.keymap index 53218a86..7806161a 100644 --- a/app/boards/shields/corne/corne.keymap +++ b/app/boards/shields/corne/corne.keymap @@ -3,54 +3,121 @@ * * SPDX-License-Identifier: MIT */ +/* THIS FILE WAS GENERATED! + * + * This file was generated automatically. You may or may not want to + * edit it directly + */ #include #include #include +#include +#include +#include +#include +#include -/ { - keymap { - compatible = "zmk,keymap"; - - default_layer { -// ----------------------------------------------------------------------------------------- -// | TAB | Q | W | E | R | T | | Y | U | I | O | P | BKSP | -// | CTRL | A | S | D | F | G | | H | J | K | L | ; | ' | -// | SHFT | Z | X | C | V | B | | N | M | , | . | / | ESC | -// | GUI | LWR | SPC | | ENT | RSE | ALT | - bindings = < - &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC - &kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT - &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp ESC - &kp LGUI &mo 1 &kp SPACE &kp RET &mo 2 &kp RALT - >; - }; - lower_layer { -// ----------------------------------------------------------------------------------------- -// | TAB | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BKSP | -// | BTCLR| BT1 | BT2 | BT3 | BT4 | BT5 | | LFT | DWN | UP | RGT | | | -// | SHFT | | | | | | | | | | | | | -// | GUI | | SPC | | ENT | | ALT | - bindings = < - &kp TAB &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp BSPC - &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans &trans - &kp LSHFT &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans - &kp LGUI &trans &kp SPACE &kp RET &trans &kp RALT - >; - }; - - raise_layer { -// ----------------------------------------------------------------------------------------- -// | TAB | ! | @ | # | $ | % | | ^ | & | * | ( | ) | BKSP | -// | CTRL | | | | | | | - | = | [ | ] | \ | ` | -// | SHFT | | | | | | | _ | + | { | } | "|" | ~ | -// | GUI | | SPC | | ENT | | ALT | - bindings = < - &kp TAB &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp KP_MULTIPLY &kp LPAR &kp RPAR &kp BSPC - &kp LCTRL &trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp GRAVE - &kp LSHFT &trans &trans &trans &trans &trans &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE &kp TILDE - &kp LGUI &trans &kp SPACE &kp RET &trans &kp RALT - >; - }; - }; +#define LOWER 1 +#define RAISE 2 +#define SHIFT 3 +#define OPTION 4 +#define LOCK 5 +&mmv { + time-to-max-speed-ms = <1000>; + acceleration-exponent=<1>; +}; +&mwh { + time-to-max-speed-ms = <2000>; + acceleration-exponent=<0>; +}; +/ { + behaviors { + hm: homerow_mods { + compatible = "zmk,behavior-hold-tap"; + label = "homerow mods"; + #binding-cells = <2>; + tapping_term_ms = <200>; + flavor = "tap-preferred"; + bindings = + <&kp>, + <&kp>; + }; + }; + + conditional_layers { + compatible = "zmk,conditional-layers"; + + tri_layer { + if-layers = ; + then-layer =