From 0677e64655f230722eaa35160acaefacf3684a43 Mon Sep 17 00:00:00 2001 From: wanleg <32079073+wanleg@users.noreply.github.com> Date: Wed, 5 Dec 2018 08:42:50 -0800 Subject: Keymap: Wanleg layout updates (#4550) * config fixes (including for issue #3678) * put back audio * jj40 backlighting setup * jj40 backlighting setup * rules.mk fix * jj40 backlighting settings * iris setup * iris setup * iris setup * iris setup * iris setup - onehand * remove commented-out section * edits due to #4403 * xd75 testing * fix 5x15 layout issues with 5x5 bluetooth & xd75 * commenting out unused placeholders * change iris to more wanleg-like 4x12 layout * formatting changes * onehand layout cleanup/fix * revert temp change --- keyboards/iris/keymaps/wanleg/config.h | 33 ++++++++++++ keyboards/iris/keymaps/wanleg/keymap.c | 76 ++++++++++++++++++++++++++++ keyboards/iris/keymaps/wanleg/rules.mk | 5 ++ layouts/community/ortho_4x12/wanleg/config.h | 13 ++++- layouts/community/ortho_4x12/wanleg/keymap.c | 17 ++++++- layouts/community/ortho_4x12/wanleg/rules.mk | 16 +++--- layouts/community/ortho_5x15/wanleg/config.h | 2 +- layouts/community/ortho_5x15/wanleg/keymap.c | 49 +++++++++--------- layouts/community/ortho_5x15/wanleg/rules.mk | 19 ++++--- users/wanleg/config.h | 12 ++--- users/wanleg/rules.mk | 10 +++- users/wanleg/tapdances.c | 4 +- users/wanleg/wanleg.h | 18 +++---- 13 files changed, 208 insertions(+), 66 deletions(-) create mode 100644 keyboards/iris/keymaps/wanleg/config.h create mode 100644 keyboards/iris/keymaps/wanleg/keymap.c create mode 100644 keyboards/iris/keymaps/wanleg/rules.mk diff --git a/keyboards/iris/keymaps/wanleg/config.h b/keyboards/iris/keymaps/wanleg/config.h new file mode 100644 index 000000000..9b9000768 --- /dev/null +++ b/keyboards/iris/keymaps/wanleg/config.h @@ -0,0 +1,33 @@ +/* +Copyright 2017 Danny Nguyen + +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 + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +#undef USE_I2C + +/* Select hand configuration */ + +// #define MASTER_LEFT +// #define MASTER_RIGHT +#define EE_HANDS + +#define QMK_ESC_OUTPUT F6 // usually COL +#define QMK_ESC_INPUT D7 // usually ROW +#define QMK_LED B0 diff --git a/keyboards/iris/keymaps/wanleg/keymap.c b/keyboards/iris/keymaps/wanleg/keymap.c new file mode 100644 index 000000000..6f8ff9066 --- /dev/null +++ b/keyboards/iris/keymaps/wanleg/keymap.c @@ -0,0 +1,76 @@ + +#include QMK_KEYBOARD_H +#include "wanleg.h" + + +#define LAYOUT_iris_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C \ + ) \ + LAYOUT_wrapper( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K31, K32, K33, K34, K35, K36, _______, _______, K37, K38, K39, K3A, K3B, K3C, \ + _______, _______, _______, _______, _______, _______ \ + ) +#define LAYOUT_iris_base_wrapper(...) LAYOUT_iris_base(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_GK] = LAYOUT_iris_base_wrapper( + _______________GherkinLike_0_______________, + _______________GherkinLike_1_______________, + _______________GherkinLike_2_______________, + _______________GherkinLike_3_OneHand_______ + ), + [ONE] = LAYOUT_wrapper( + _______________Qwerty_Row__0_______________, + _______________Qwerty_Row__1_______________, + _______________Qwerty_Row__2_______________, + KC_LCTL, KC_LGUI, KC_LALT, GHERKIN, SUBTER, SH_T(KC_SPC), _______, _______, SH_T(KC_SPC), SUPRA, KC_RGUI, KC_RALT, GHERKIN, KC_RCTL, + _______, _______, _______, _______, _______, _______ + ), + [SUP] = LAYOUT_iris_base_wrapper( + ________________SUPRA_Row_0________________, + ________________SUPRA_Row_1________________, + ________________SUPRA_Row_2________________, + ________________SUPRA_Row_3________________ + ), + [SUB] = LAYOUT_iris_base_wrapper( + _______________SUBTER_Row__0_______________, + _______________SUBTER_Row__1_______________, + _______________SUBTER_Row__2_______________, + _______________SUBTER_Row__3_______________ + ), + [NUM] = LAYOUT_iris_base_wrapper( + _______________NUMBERS_Row_0_______________, + _______________NUMBERS_Row_1_______________, + _______________NUMBERS_Row_2_______________, + _______________NUMBERS_Row_3_______________ + ), + [DIR] = LAYOUT_iris_base_wrapper( + _____________DIRECTIONS_Row__0_____________, + _____________DIRECTIONS_Row__1_____________, + _____________DIRECTIONS_Row__2_____________, + _______, _______, ONEHAND, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [ETC] = LAYOUT_iris_base_wrapper( + ______________ETCETERA_Row__0______________, + ______________ETCETERA_Row__1______________, + ______________ETCETERA_Row__2______________, + ______________ETCETERA_Row__3______________ + ) + +}; + + +void matrix_init_keymap(void) { + DDRD &= ~(1<<5); + PORTD &= ~(1<<5); + + DDRB &= ~(1<<0); + PORTB &= ~(1<<0); +} diff --git a/keyboards/iris/keymaps/wanleg/rules.mk b/keyboards/iris/keymaps/wanleg/rules.mk new file mode 100644 index 000000000..bbb05a5b4 --- /dev/null +++ b/keyboards/iris/keymaps/wanleg/rules.mk @@ -0,0 +1,5 @@ +RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = no + +SWAP_HANDS_ENABLE = yes +BOOTLOADER = qmk-dfu diff --git a/layouts/community/ortho_4x12/wanleg/config.h b/layouts/community/ortho_4x12/wanleg/config.h index 2b2072db2..f7650ddd3 100644 --- a/layouts/community/ortho_4x12/wanleg/config.h +++ b/layouts/community/ortho_4x12/wanleg/config.h @@ -1,5 +1,14 @@ #pragma once +#if defined(KEYBOARD_jj40) +#undef BACKLIGHT_BREATHING +#undef BACKLIGHT_LEVELS +#undef BREATHING_PERIOD +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 +#define BREATHING_PERIOD 15 +#endif + //QMK DFU settings (ProMicro boards with QMK bootloader) // set top left key as bootloader mode escape key on Lets Split rev2 #if defined(KEYBOARD_lets_split_rev2) @@ -12,7 +21,7 @@ #endif // set top left key as bootloader mode escape key on 4x4 48key layout -#if defined(KEYBOARD_4x4) && !defined(PRO_MICRO) +#if defined(KEYBOARD_40percentclub_4x4) && !defined(PRO_MICRO) #define QMK_LED B0 #define QMK_ESC_OUTPUT C6 // usually COL #define QMK_ESC_INPUT B2 // usually ROW @@ -20,7 +29,7 @@ // use alternate settings for 4x4 board using ProMicro instead of Micro // usage: make 4x4:wanleg PM=yes -#if defined(KEYBOARD_4x4) && defined(PRO_MICRO) +#if defined(KEYBOARD_40percentclub_4x4) && defined(PRO_MICRO) #define QMK_ESC_OUTPUT F4 // usually COL #define QMK_ESC_INPUT D1 // usually ROW #define QMK_LED B0 diff --git a/layouts/community/ortho_4x12/wanleg/keymap.c b/layouts/community/ortho_4x12/wanleg/keymap.c index 6fe8446f6..23e794dc4 100644 --- a/layouts/community/ortho_4x12/wanleg/keymap.c +++ b/layouts/community/ortho_4x12/wanleg/keymap.c @@ -15,8 +15,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______________Qwerty_Row__2_______________, KC_LCTL, KC_LGUI, KC_LALT, GHERKIN, SUBTER, SH_T(KC_SPC), SH_T(KC_SPC), SUPRA, KC_RGUI, KC_RALT, GHERKIN, KC_RCTL ), - -#elif defined(KEYBOARD_4x4) +[DIR] = LAYOUT_ortho_4x12_wrapper( + _____________DIRECTIONS_Row__0_____________, + _____________DIRECTIONS_Row__1_____________, + _____________DIRECTIONS_Row__2_____________, + _______, _______, ONEHAND, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +#elif defined(KEYBOARD_40percentclub_4x4) [_GK] = LAYOUT_ortho_4x12_wrapper( _______________GherkinLike_0_______________, _______________GherkinLike_1_______________, @@ -31,6 +36,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______________NUMPAD_Row__3_______________ ), +#elif defined(KEYBOARD_jj40) +[_GK] = LAYOUT_ortho_4x12_wrapper( + _______________GherkinLike_0_______________, + _______________GherkinLike_1_______________, + _______________GherkinLike_2_______________, + TD(RST_TAP_DANCE), BL_TOGG, BL_STEP, BL_BRTG, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL +), + #else [_GK] = LAYOUT_ortho_4x12_wrapper( _______________GherkinLike_0_______________, diff --git a/layouts/community/ortho_4x12/wanleg/rules.mk b/layouts/community/ortho_4x12/wanleg/rules.mk index 835022f4b..e8277610b 100644 --- a/layouts/community/ortho_4x12/wanleg/rules.mk +++ b/layouts/community/ortho_4x12/wanleg/rules.mk @@ -1,14 +1,10 @@ AUDIO_ENABLE = no -SWAP_HANDS_ENABLE = yes +SWAP_HANDS_ENABLE = no -ifeq ($(strip $(KEYBOARD)), jj40) - SWAP_HANDS_ENABLE = no +ifeq ($(strip $(KEYBOARD)), lets_split/rev2) + SWAP_HANDS_ENABLE = yes endif -ifeq ($(strip $(KEYBOARD)), 40percentclub/4x4) - SWAP_HANDS_ENABLE = no -endif - -ifeq ($(strip $(KEYBOARD)), zlant) - SWAP_HANDS_ENABLE = no -endif +ifeq ($(strip $(KEYBOARD)), planck/rev6) + AUDIO_ENABLE = yes +endif \ No newline at end of file diff --git a/layouts/community/ortho_5x15/wanleg/config.h b/layouts/community/ortho_5x15/wanleg/config.h index 1aeda2db4..d2b3d6719 100644 --- a/layouts/community/ortho_5x15/wanleg/config.h +++ b/layouts/community/ortho_5x15/wanleg/config.h @@ -1,7 +1,7 @@ #pragma once //5x5 powered by Adafruit Feather 32u4 Bluefruit LE -#if defined(KEYBOARD_5x5) && defined(BLUEFRUIT) +#if defined(KEYBOARD_40percentclub_5x5) && defined(BLUEFRUIT) //need to undefine standard 5x5 array before defining alternate Bluefruit array #undef MATRIX_ROW_PINS diff --git a/layouts/community/ortho_5x15/wanleg/keymap.c b/layouts/community/ortho_5x15/wanleg/keymap.c index 66b3ce018..51b020fcd 100644 --- a/layouts/community/ortho_5x15/wanleg/keymap.c +++ b/layouts/community/ortho_5x15/wanleg/keymap.c @@ -6,7 +6,7 @@ #define _________________Num_Row_75________________ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -#if defined(KEYBOARD_5x5) +#if defined(KEYBOARD_40percentclub_5x5) [GK75] = LAYOUT_ortho_5x15_wrapper( _________________Num_Row_75________________, QWERTY75, XXXXXXX, FUNCTION75, _______________GherkinLike_0_______________, KC_KP_7, KC_KP_8, KC_KP_9, @@ -23,6 +23,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TD(RST_TAP_DANCE), GHERKIN75, NUMPAD, gNUMBER, gETCETERA, KC_SPC,gDIRECTION, KC_RGUI, KC_RALT, KC_RGUI ), +[gNUM] = LAYOUT_ortho_5x10_wrapper( + _________________BLANK_50__________________, + _______________Gherkin_NUM_0_______________, + _______________Gherkin_NUM_1_______________, + _______________Gherkin_NUM_2_______________, + _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, _______, _______ +), + +[gDIR] = LAYOUT_ortho_5x10_wrapper( + _________________BLANK_50__________________, + _______________Gherkin_DIR_0_______________, + _______________Gherkin_DIR_1_______________, + _______________Gherkin_DIR_2_______________, + _________________BLANK_50__________________ +), + +[gETC] = LAYOUT_ortho_5x10_wrapper( + _________________BLANK_50__________________, + _______________Gherkin_ETC_0_______________, + _______________Gherkin_ETC_1_______________, + _______________Gherkin_ETC_2_______________, + _______, KC_CAPS, _______, _______, _______, LALT(LCTL(KC_DEL)), _______, _______, _______, _______ +), + #if defined(BLUEFRUIT) [PAD] = LAYOUT_ortho_5x5_wrapper( _______, _______, _______, OUT_BT, OUT_USB, @@ -210,27 +234,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R ), -[gNUM] = LAYOUT_ortho_5x10_wrapper( - _________________BLANK_50__________________, - _______________Gherkin_NUM_0_______________, - _______________Gherkin_NUM_1_______________, - _______________Gherkin_NUM_2_______________, - _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, _______, _______ -), - -[gDIR] = LAYOUT_ortho_5x10_wrapper( - _________________BLANK_50__________________, - _______________Gherkin_DIR_0_______________, - _______________Gherkin_DIR_1_______________, - _______________Gherkin_DIR_2_______________, - _________________BLANK_50__________________ -), - -[gETC] = LAYOUT_ortho_5x10_wrapper( - _________________BLANK_50__________________, - _______________Gherkin_ETC_0_______________, - _______________Gherkin_ETC_1_______________, - _______________Gherkin_ETC_2_______________, - _______, KC_CAPS, _______, _______, _______, LALT(LCTL(KC_DEL)), _______, _______, _______, _______ -), }; diff --git a/layouts/community/ortho_5x15/wanleg/rules.mk b/layouts/community/ortho_5x15/wanleg/rules.mk index bfc4c69d9..96bbaa458 100644 --- a/layouts/community/ortho_5x15/wanleg/rules.mk +++ b/layouts/community/ortho_5x15/wanleg/rules.mk @@ -1,8 +1,11 @@ -ifeq (,$(findstring yes,$(BLUEFRUIT))) - BLUETOOTH = AdafruitBLE - BLUETOOTH_ENABLE = yes - F_CPU = 8000000 - CONSOLE_ENABLE = no # Console for debug(+400) - COMMAND_ENABLE = no # Commands for debug and configuration - RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -endif \ No newline at end of file +#ifeq ($(strip $(KEYBOARD)), xd75) +#or +#ifeq (,$(findstring xd75,$(KEYBOARD))) +#something +#endif + +#ifeq ($(strip $(KEYBOARD)), 40percentclub/5x5) +#or +#ifeq (,$(findstring 40percentclub/5x5,$(KEYBOARD))) +#something +#endif \ No newline at end of file diff --git a/users/wanleg/config.h b/users/wanleg/config.h index f2e785659..0c8b048af 100644 --- a/users/wanleg/config.h +++ b/users/wanleg/config.h @@ -1,10 +1,12 @@ -#ifndef USERSPACE_CONFIG_H -#define USERSPACE_CONFIG_H +#pragma once //TAPPING_TERM //tapping term short (<100): on multi-purpose keys, slow taps may not register, but "holds" register easier. multi-tap keys may be difficult to activate. //tapping term long (>200): holds don't register as easily - noticeable when typing quickly (e.g. shift doesn't want to engage.) -#if defined(TAP_DANCE_ENABLE) && defined(KEYBOARD_lets_split_rev2) + + +//MIGHT HAVE TO SPLIT THIS INTO TWO CONDITIONS +#if defined(TAP_DANCE_ENABLE) && defined(KEYBOARD_lets_split_rev2) || defined(KEYBOARD_iris_rev2) //Kailh Coppers activate quickly and don't need a long tapping term #define TAPPING_TERM 100 @@ -39,6 +41,4 @@ // Disable mod tap interrrupt #ifndef IGNORE_MOD_TAP_INTERRUPT #define IGNORE_MOD_TAP_INTERRUPT -#endif // !mod tap interrrupt - -#endif // !USERSPACE_CONFIG_H +#endif // !mod tap interrrupt \ No newline at end of file diff --git a/users/wanleg/rules.mk b/users/wanleg/rules.mk index e3e802b4a..c6569594b 100644 --- a/users/wanleg/rules.mk +++ b/users/wanleg/rules.mk @@ -18,5 +18,13 @@ endif #use alternate settings for boards using "Adafruit Feather 32u4 Bluefruit LE" instead of Micro #example usage: make 5x5:wanleg BT=yes ifeq ($(strip $(BT)), yes) - OPT_DEFS += -DBLUEFRUIT + #opt_defs for alternate pin usage + OPT_DEFS += -DBLUEFRUIT + #Adafruit Bluefruit controller settings + BLUETOOTH = AdafruitBLE + BLUETOOTH_ENABLE = yes + F_CPU = 8000000 + CONSOLE_ENABLE = no # Console for debug(+400) + COMMAND_ENABLE = no # Commands for debug and configuration + RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow endif \ No newline at end of file diff --git a/users/wanleg/tapdances.c b/users/wanleg/tapdances.c index 3878e6d31..e5051f9ee 100644 --- a/users/wanleg/tapdances.c +++ b/users/wanleg/tapdances.c @@ -73,9 +73,9 @@ void CAD_finished (qk_tap_dance_state_t *state, void *user_data) { //register_code(KC_NO); //take a screenshot of a single window, open Paint and paste SEND_STRING(SS_LALT(SS_TAP(X_PSCREEN)) SS_LGUI("r")); - _delay_ms(500); + wait_ms(500); SEND_STRING("mspaint" SS_TAP(X_ENTER)); - _delay_ms(700); + wait_ms(700); SEND_STRING(SS_LCTRL("v")); break; //register this keycode when button is held case DOUBLE_TAP: diff --git a/users/wanleg/wanleg.h b/users/wanleg/wanleg.h index 9e0cf3ee5..c2644cd6c 100644 --- a/users/wanleg/wanleg.h +++ b/users/wanleg/wanleg.h @@ -1,5 +1,4 @@ -#ifndef USERSPACE -#define USERSPACE +#pragma once #include "quantum.h" @@ -32,7 +31,6 @@ enum userspace_layers { #elif KEYBOARD_xd75 enum userspace_layers { GK75 = 0, - PAD, QW75, SUB75, SUP75, @@ -43,6 +41,7 @@ enum userspace_layers { gGK, _GK, _QW, + PAD, ONE, SUB, SUP, @@ -54,7 +53,7 @@ enum userspace_layers { gETC, GK50, }; -#elif KEYBOARD_5x5 +#elif KEYBOARD_40percentclub_5x5 enum userspace_layers { GK50 = 0, gNUM, @@ -82,8 +81,8 @@ enum userspace_layers { #else enum userspace_layers { _GK = 0, - PAD, _QW, + PAD, ONE, SUB, SUP, @@ -156,11 +155,11 @@ enum { #define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_ortho_3x10_wrapper(...) LAYOUT_ortho_3x10(__VA_ARGS__) -#define LAYOUT_ortho_5x10_wrapper(...) LAYOUT_ortho_5x10(__VA_ARGS__) -#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) -#define LAYOUT_ortho_5x15_wrapper(...) LAYOUT_ortho_5x15(__VA_ARGS__) #define LAYOUT_ortho_4x4_wrapper(...) LAYOUT_ortho_4x4(__VA_ARGS__) +#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) #define LAYOUT_ortho_5x5_wrapper(...) LAYOUT_ortho_5x5(__VA_ARGS__) +#define LAYOUT_ortho_5x10_wrapper(...) LAYOUT_ortho_5x10(__VA_ARGS__) +#define LAYOUT_ortho_5x15_wrapper(...) LAYOUT_ortho_5x15(__VA_ARGS__) // Blocks for each of the major keyboard layouts // Organized so we can quickly adapt and modify all of them @@ -229,7 +228,7 @@ enum { /* Gherkin-Like * .-----------------------------------------------------------------------------------------------------------. - * | ESC | Q//ESC | W | E | R | T | Y | U | I | O | P | BSPC | + * | ESC | Q//ESC | W | E | R | T | Y | U | I | O | P | BSPC | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | TAB | A | S | D | F | G | H | J | K | L | SPACE | ' | * | | | | | | | | | | |SFThold | | @@ -361,4 +360,3 @@ enum { #define _______________NUMPAD_Row__1_______________ KC_KP_4, KC_KP_5, KC_KP_6, KC_SPC #define _______________NUMPAD_Row__2_______________ KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT #define _______________NUMPAD_Row__3_______________ KC_KP_0, TD(LYR_TAP_DANCE), KC_KP_DOT, KC_PMNS -#endif // !USERSPACE -- cgit v1.2.3-24-g4f1b