From c81e07fef5938a30ebf87b7e2beb99f8c135c59c Mon Sep 17 00:00:00 2001 From: Dan Hertz Date: Tue, 12 Jan 2021 17:53:15 -0800 Subject: [Keymap] Add dhertz' kanu layout (#11346) * Add dhertz' kanu layout * Fix delete button * Add weak user layer change --- keyboards/mechlovin/kanu/kanu.c | 5 +- keyboards/mechlovin/kanu/kanu.h | 15 ++++++ keyboards/mechlovin/kanu/keymaps/dhertz/keymap.c | 62 ++++++++++++++++++++++++ keyboards/mechlovin/kanu/rules.mk | 2 +- 4 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 keyboards/mechlovin/kanu/keymaps/dhertz/keymap.c (limited to 'keyboards/mechlovin') diff --git a/keyboards/mechlovin/kanu/kanu.c b/keyboards/mechlovin/kanu/kanu.c index 9917785161..d19b7f1031 100644 --- a/keyboards/mechlovin/kanu/kanu.c +++ b/keyboards/mechlovin/kanu/kanu.c @@ -35,7 +35,8 @@ bool led_update_kb(led_t led_state) { return true; } -layer_state_t layer_state_set_kb(layer_state_t state) { +__attribute__((weak)) +layer_state_t layer_state_set_user(layer_state_t state) { // if on layer 1, turn on D2 LED, otherwise off. writePin(D2, get_highest_layer(state) == 1); // if on layer 2, turn on D1 LED, otherwise off. @@ -43,4 +44,4 @@ layer_state_t layer_state_set_kb(layer_state_t state) { // if on layer 3, turn on D0 LED, otherwise off. writePin(D0, get_highest_layer(state) == 3); return state; -} \ No newline at end of file +} diff --git a/keyboards/mechlovin/kanu/kanu.h b/keyboards/mechlovin/kanu/kanu.h index be8f400a0f..54163529d6 100644 --- a/keyboards/mechlovin/kanu/kanu.h +++ b/keyboards/mechlovin/kanu/kanu.h @@ -48,6 +48,21 @@ { k61, k62, k63, KC_NO, KC_NO, KC_NO, k65, KC_NO, KC_NO, k66, k67, k68, k69, k70, k71 }, \ } +#define LAYOUT_65_iso_blocker( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, k66, \ + k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k29, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, k42, k43, k45, \ + k46, k47, k48, k49, k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k60, \ + k61, k62, k63, k65, k67, k68, k69, k70, k71 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, KC_NO }, \ + { k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, KC_NO, k29 }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, k42, k43, k45 }, \ + { k46, k47, k48, k49, k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k60 }, \ + { k61, k62, k63, KC_NO, KC_NO, KC_NO, k65, KC_NO, KC_NO, k66, k67, k68, k69, k70, k71 }, \ +} + #define LAYOUT_65_ansi_blocker( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, k66, \ k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \ diff --git a/keyboards/mechlovin/kanu/keymaps/dhertz/keymap.c b/keyboards/mechlovin/kanu/keymaps/dhertz/keymap.c new file mode 100644 index 0000000000..56fd470831 --- /dev/null +++ b/keyboards/mechlovin/kanu/keymaps/dhertz/keymap.c @@ -0,0 +1,62 @@ +#include QMK_KEYBOARD_H +#include "dhertz.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layer 0: Default Layer + * ,---------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Backsp|Del| + * |---------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Enter|Hom| + * |------------------------------------------------------` |---| + * |SrCtl | A| S| D| F| G| H| J| K| L| ;| '| \| |End| + * |---------------------------------------------------------------| + * |Shif| #| Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgD| + * |---------------------------------------------------------------| + * |NcCtl| Alt| CTab| LyrSpc | CGv| Alt|Lef|Dow|Rig| + * `---------------------------------------------------------------' + */ + [0] = LAYOUT_65_iso_blocker( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_HOME, + SRCH_CTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_END, + KC_LSFT, HSH_TLD, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + NC_CTL, KC_LALT, CMD_TAB_CMD, LYR_SPC, CMD_GRV_CMD, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT + ), + /* Layer 1: Special + * ,---------------------------------------------------------------. + * | ยง| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |Iso| + * |---------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |------------------------------------------------------` |---| + * | | | | | | | | | |CSL| | | `| | | + * |---------------------------------------------------------------| + * | | `| | |CAC| | | | | | | | |PgU| | + * |---------------------------------------------------------------| + * | | | | | | |Hom|PgD|End| + * `---------------------------------------------------------------' + */ + [1] = LAYOUT_65_iso_blocker( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, ISO_COUNTRY_CODE, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, CMD_SFT_L, KC_TRNS, KC_TRNS, KC_NUBS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_NUBS, KC_TRNS, KC_TRNS, CMD_ALT_C, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDOWN, KC_END + ), +}; + +void keyboard_post_init_user(void) { + rgblight_enable_noeeprom(); + rgblight_sethsv_teal(); +} + +layer_state_t layer_state_set_keymap(layer_state_t state) { + switch (get_highest_layer(state)) { + case 1: + rgblight_sethsv_noeeprom_magenta(); + break; + default: // for any other layers, or the default layer + rgblight_sethsv_noeeprom_teal(); + break; + } + return state; +} diff --git a/keyboards/mechlovin/kanu/rules.mk b/keyboards/mechlovin/kanu/rules.mk index 93bf55801f..2c7cbc4aed 100644 --- a/keyboards/mechlovin/kanu/rules.mk +++ b/keyboards/mechlovin/kanu/rules.mk @@ -21,4 +21,4 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow BLUETOOTH_ENABLE = no # Enable Bluetooth AUDIO_ENABLE = no # Audio output -LAYOUTS = 65_ansi_blocker 65_iso_blocker_split_bs +LAYOUTS = 65_ansi_blocker 65_iso_blocker_split_bs 65_iso_blocker -- cgit v1.2.3