diff --git a/layouts/community/60_ansi/brandonschlack-ansi/keymap.c b/layouts/community/60_ansi/brandonschlack-ansi/keymap.c new file mode 100644 index 000000000000..5282ff98b0c3 --- /dev/null +++ b/layouts/community/60_ansi/brandonschlack-ansi/keymap.c @@ -0,0 +1,83 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 "brandonschlack.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Base layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │Esc│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│ Bckspc│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│| \│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │HyCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│ Enter│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │Shift │ Z │ X │ C │ V │ B │ N │ M │< ,│> .│? /│ ↑ Shift│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │Ctrl│ Opt│ Cmd│ Space │CmdP│←Opt│↓ Fn│→Ctl│ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +[_BASE] = LAYOUT_60_ansi( \ + 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_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_BSLS, \ + HY_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, UP_RSFT, \ + KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, PLY_CMD, LFT_OPT, DWN_FN1, RGT_CTL \ +), + +/* Function Layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │~ `│ F1│ F2│ F3│ F4│ F5│ F6│ F7│ F8│ F9│F10│F11│F12│ Del │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │RMod │RH+│RS+│RV+│AS+│ │ │ │F13│F14│F15│PgU│LHP│ SLP │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │RTgl │RH-│RS-│RV-│AS-│ │ │VlD│VlU│Mut│Hom│End│ PlyPse │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │LYR│Thm│ │ │RST│ │MKE│Prv│Nxt│PgD│ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +[_FN1] = LAYOUT_60_ansi( \ + 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_DELT, \ + RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, KC_F13, KC_F14, KC_F15, KC_PGUP, MC_LHPD, MC_SLPD, \ + RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_HOME, KC_END, KC_MPLY, \ + _______, RGB_LYR, RGB_THM, _______, _______, RESET, _______, QM_MAKE, KC_MPRV, KC_MNXT, KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ +), +/* Layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +/* +[BLANK] = LAYOUT_60_ansi( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ +) +*/ +}; diff --git a/layouts/community/60_ansi/brandonschlack-ansi/rules.mk b/layouts/community/60_ansi/brandonschlack-ansi/rules.mk new file mode 100644 index 000000000000..7aaf727ad220 --- /dev/null +++ b/layouts/community/60_ansi/brandonschlack-ansi/rules.mk @@ -0,0 +1 @@ +USER_NAME := brandonschlack diff --git a/layouts/community/60_ansi_split_bs_rshift/brandonschlack-split/keymap.c b/layouts/community/60_ansi_split_bs_rshift/brandonschlack-split/keymap.c new file mode 100644 index 000000000000..906925ab96e4 --- /dev/null +++ b/layouts/community/60_ansi_split_bs_rshift/brandonschlack-split/keymap.c @@ -0,0 +1,83 @@ +/* Copyright 2019 Brandon Schlack + * + * 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 "brandonschlack.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Base layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│| \│~ `│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│Bspc │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │HyCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│ Enter  │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │ LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │↑ Shft│FnP│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬┴───┤ + * │Ctrl│Opt │Cmd │         Space          │ Cmd│←Opt│↓ Fn│→Ctl│ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +[_BASE] = LAYOUT_60_ansi_split_bs_rshift( \ + 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_BSLS, KC_GRV, \ + 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_BSPC, \ + HY_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, UP_RSFT, PLY_FN1, \ + KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, LFT_OPT, DWN_FN1, RGT_CTL \ +), + +/* Function Layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │MKE│ F1│ F2│ F3│ F4│ F5│ F6│ F7│ F8│ F9│F10│F11│F12│LHP│SLP│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │RMod │RH+│RS+│RV+│AS+│   │   │   │   │   │   │ ↑ │MNC│ Del │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │RTgl  │RH-│RS-│RV-│AS-│   │   │   │VlD│VlU│ ← │ → │   Play │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │        │LYR│Thm│   │   │RST│   │Mut│Prv│Nxt│ ↓ │PgUSft│   │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬┴───┤ + * │    │    │    │                        │    │HmOp│PgDF│EndC│ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +[_FN1] = LAYOUT_60_ansi_split_bs_rshift( \ + QM_MAKE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, MC_LHPD, MC_SLPD, \ + RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, KC_VOLU, KC_MPRV, KC_MNXT, KC_UP, MC_MSSN, KC_DELT, \ + RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, KC_VOLD, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_MPLY, \ + _______, RGB_LYR, RGB_THM, _______, _______, RESET, _______, KC_MUTE, KC_END, KC_PGDN, KC_DOWN, PGU_SFT, _______, \ + _______, _______, _______, _______, _______, HOM_OPT, PGD_FN1, END_CTL \ +) +/* Layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │     │   │   │   │   │   │   │   │   │   │   │   │   │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │      │   │   │   │   │   │   │   │   │   │   │   │        │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │        │   │   │   │   │   │   │   │   │   │   │      │   │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬┴───┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +/* +[BLANK] = LAYOUT_60_ansi_split_bs_rshift( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ +) +*/ +}; diff --git a/layouts/community/60_ansi_split_bs_rshift/brandonschlack-split/rules.mk b/layouts/community/60_ansi_split_bs_rshift/brandonschlack-split/rules.mk new file mode 100644 index 000000000000..7aaf727ad220 --- /dev/null +++ b/layouts/community/60_ansi_split_bs_rshift/brandonschlack-split/rules.mk @@ -0,0 +1 @@ +USER_NAME := brandonschlack diff --git a/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/keymap.c b/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/keymap.c new file mode 100644 index 000000000000..b6db28ed9d87 --- /dev/null +++ b/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/keymap.c @@ -0,0 +1,84 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 "brandonschlack.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Base layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│| \│~ `│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │Tab  │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│ Bspc│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │HyCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│   Enter│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │LShift  │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │↑ Shft│FnP│ + * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ + * │Ctrl │Opt│Cmd  │                           │ ←Cmd│↓Op│→Ctrl│ + * └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ + */ +[_BASE] = LAYOUT_60_tsangan_hhkb( \ + 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_BSLS, KC_GRV, \ + 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_BSPC, \ + HY_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, UP_RSFT, PLY_FN1, \ + KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, LFT_CMD, DWN_OPT, RGT_CTL \ +), + +/* Function Layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │MKE│ F1│ F2│ F3│ F4│ F5│ F6│ F7│ F8│ F9│F10│F11│F12│LHP│SLP│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │RMod │RH+│RS+│RV+│Bl+│   │   │   │   │   │   │ ↑ │MNC│ Del │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │RTgl  │RH-│RS-│RV-│Bl-│   │   │   │VlD│Vlu│ ← │ → │   Play │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │        │LYR│Thm│BlT│   │RST│   │Mut│Prv│Nxt│ ↓ │PgUSft│   │ + * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ + * │     │   │     │                           │HmCmd│PDO│EndCl│ + * └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ + */ +[_FN1] = LAYOUT_60_tsangan_hhkb( \ + QM_MAKE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, MC_LHPD, MC_SLPD, \ + RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, BL_INC, _______, _______, _______, _______, _______, _______, KC_UP, MC_MSSN, KC_DELT, \ + RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, BL_DEC, _______, _______, _______, KC_VOLD, KC_VOLU, KC_LEFT, KC_RGHT, KC_MPLY, \ + _______, RGB_LYR, RGB_THM, BL_TOGG, _______, RESET, _______, KC_MUTE, KC_MPRV, KC_MNXT, KC_DOWN, PGU_SFT, _______, \ + _______, _______, _______, _______, HOM_CMD, PGD_OPT, END_CTL \ +) +/* Layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │     │   │   │   │   │   │   │   │   │   │   │   │   │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │      │   │   │   │   │   │   │   │   │   │   │   │        │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │        │   │   │   │   │   │   │   │   │   │   │      │   │ + * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ + * │     │   │     │                           │     │   │     │ + * └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ + */ +/* +[BLANK] = LAYOUT_60_tsangan_hhkb( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______ \ +) +*/ + +}; diff --git a/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/readme.md b/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/readme.md new file mode 100644 index 000000000000..d79cf7f07ec5 --- /dev/null +++ b/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/readme.md @@ -0,0 +1,11 @@ +# brandonschlack's 60 Tsangan HHKB Layout + +It is used on + +* [AN-C](https://github.com/qmk/qmk_firmware/tree/master/keyboards/cannonkeys/an_c) +* [Instant60](https://github.com/qmk/qmk_firmware/tree/master/keyboards/cannonkeys/instant60) +* [Polaris](https://github.com/qmk/qmk_firmware/tree/master/keyboards/ai03/polaris) +* [Plain60](https://github.com/qmk/qmk_firmware/tree/master/keyboards/maartenwut/plain60) + +## Features +### Mod-Taps & Layer-Taps diff --git a/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/rules.mk b/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/rules.mk new file mode 100644 index 000000000000..7aaf727ad220 --- /dev/null +++ b/layouts/community/60_tsangan_hhkb/brandonschlack-tsngn/rules.mk @@ -0,0 +1 @@ +USER_NAME := brandonschlack diff --git a/layouts/community/65_ansi_blocker/brandonschlack/config.h b/layouts/community/65_ansi_blocker/brandonschlack/config.h new file mode 100644 index 000000000000..e7b09f422c73 --- /dev/null +++ b/layouts/community/65_ansi_blocker/brandonschlack/config.h @@ -0,0 +1,64 @@ +/* Copyright 2019 Brandon Schlack + * + * 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 + +#ifdef RGB_MATRIX_ENABLE +// Disable RGB Effects +#define DISABLE_RGB_MATRIX_ALPHAS_MODS +// #define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN +// #define DISABLE_RGB_MATRIX_BREATHING +#define DISABLE_RGB_MATRIX_BAND_SAT +#define DISABLE_RGB_MATRIX_BAND_VAL +#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +#define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define DISABLE_RGB_MATRIX_CYCLE_ALL +#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN +#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define DISABLE_RGB_MATRIX_DUAL_BEACON +#define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define DISABLE_RGB_MATRIX_CYCLE_SPIRAL +#define DISABLE_RGB_MATRIX_RAINBOW_BEACON +#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define DISABLE_RGB_MATRIX_RAINDROPS +#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define DISABLE_RGB_MATRIX_TYPING_HEATMAP +#define DISABLE_RGB_MATRIX_DIGITAL_RAIN +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#define DISABLE_RGB_MATRIX_SPLASH +#define DISABLE_RGB_MATRIX_MULTISPLASH +#define DISABLE_RGB_MATRIX_SOLID_SPLASH +#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH + +#define QMK_KEYS_PER_SCAN 4 + +#define USB_LED_CAPS_LOCK_SCANCODE 30 +#endif + +#ifdef KEYBOARD_massdrop_alt +#undef USB_LED_INDICATOR_ENABLE +#endif diff --git a/layouts/community/65_ansi_blocker/brandonschlack/keymap.c b/layouts/community/65_ansi_blocker/brandonschlack/keymap.c new file mode 100644 index 000000000000..6b67cfdca5b6 --- /dev/null +++ b/layouts/community/65_ansi_blocker/brandonschlack/keymap.c @@ -0,0 +1,117 @@ +/* Copyright 2019 Brandon Schlack + * + * 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 "brandonschlack.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Base Layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │Esc│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│ Bckspc│Hom│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│| \│PgU│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │HyCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│ Enter│PgD│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │Shift │ Z │ X │ C │ V │ B │ N │ M │< ,│> .│? /│ Shift│ Up│End│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │Ctrl│ Opt│ Cmd│ Space │Cmd │FnPy│ │Lef│Dow│Rig│ + * └────┴────┴────┴────────────────────────┴────┴────┴─┴───┴───┴───┘ + */ +[_BASE] = LAYOUT_65_ansi_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_HOME, \ + 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_BSLS, KC_PGUP, \ + HY_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ + KC_LSFT, 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_END, \ + KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, PLY_FN1, KC_LEFT, KC_DOWN, KC_RGHT \ +), +/* Function Layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │` ~│ F1│ F2│ F3│ F4│ F5│ F6│ F7│ F8│ F9│F10│F11│F12│ Delete│SlD│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │RMod │RH+│RS+│RV+│AS+│ │ │ │ │ │F13│F14│F15│ LHP │VlU│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │RTgl │RH-│RS-│RV-│AS-│ │ │ │ │ │ │ │ │VlD│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │LYR│Thm│ │ │RST│ │Mke│Prv│Nxt│Ply│ │PgU│Mut│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │ │ │ │ │ │ │ │Hom│PgD│End│ + * └────┴────┴────┴────────────────────────┴────┴────┴─┴───┴───┴───┘ + */ +[_FN1] = LAYOUT_65_ansi_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_DELT, MC_SLPD, \ + RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, KC_F13, KC_F14, KC_F15, MC_LHPD, KC_VOLU, \ + RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, \ + _______, RGB_LYR, RGB_THM, _______, _______, RESET, _______, QM_MAKE, KC_MPRV, KC_MNXT, KC_MPLY, _______, KC_PGUP, KC_MUTE, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ +), +/* Blank Layout + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴─┴───┴───┴───┘ +[X] = LAYOUT_65_ansi_blocker( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), +*/ +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_keymap(void) { +}; + +// Runs once after keyboard initializes +void keyboard_post_init_keymap(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_keymap(void) { +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + #ifdef KEYBOARD_massdrop + case RGB_TOG: + if (record->event.pressed) { + rgb_matrix_cycle_flag(); + } + return false; + #endif + default: + return true; //Process all other keycodes normally + } +} + +#ifdef RGB_MATRIX_ENABLE +void rgb_matrix_indicators_user(void) { + if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { + rgb_matrix_set_color(USB_LED_CAPS_LOCK_SCANCODE, RGB_GREEN); + } else if (!HAS_ANY_FLAGS(rgb_matrix_get_flags(), LED_FLAG_KEYS)){ + rgb_matrix_set_color(USB_LED_CAPS_LOCK_SCANCODE, 0, 0, 0); + } +} +#endif + diff --git a/layouts/community/65_ansi_blocker/brandonschlack/readme.md b/layouts/community/65_ansi_blocker/brandonschlack/readme.md new file mode 100644 index 000000000000..effb00846536 --- /dev/null +++ b/layouts/community/65_ansi_blocker/brandonschlack/readme.md @@ -0,0 +1,15 @@ +# brandonschlack's 65_ansi_blocker layout + +This is my preferred 65% layout. + +It is used on: + +* [Massdrop ALT](https://github.com/qmk/qmk_firmware/tree/master/keyboards/massdrop/alt) +* [KBD67 MKII](https://github.com/qmk/qmk_firmware/tree/master/keyboards/kbdfans/kbd67/mkiirgb) + +## [Base Layer](http://www.keyboard-layout-editor.com/#/gists/a820c8629394f8f4c3943e6ee518d9a8) +![Base Layer](https://i.imgur.com/gPxDZl7.jpg) + +## [Function Layer](http://www.keyboard-layout-editor.com/#/gists/8ca73a6d3bec8ce736f5db60edf31dcf) +![Function Layer](https://i.imgur.com/gNKHgWa.jpg) + diff --git a/layouts/community/65_ansi_blocker/brandonschlack/rules.mk b/layouts/community/65_ansi_blocker/brandonschlack/rules.mk new file mode 100644 index 000000000000..858496707618 --- /dev/null +++ b/layouts/community/65_ansi_blocker/brandonschlack/rules.mk @@ -0,0 +1,7 @@ +# Build Options +ifeq ($(strip $(KEYBOARD)), gray_studio/space65) + MOUSEKEY_ENABLE = no + BACKLIGHT_ENABLE = no + CONSOLE_ENABLE = yes + COMMAND_ENABLE = yes +endif diff --git a/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/config.h b/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/config.h new file mode 100644 index 000000000000..9506c7fe9103 --- /dev/null +++ b/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/config.h @@ -0,0 +1,64 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 + +#ifdef RGB_MATRIX_ENABLE +// Disable RGB Effects +#define DISABLE_RGB_MATRIX_ALPHAS_MODS +// #define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN +// #define DISABLE_RGB_MATRIX_BREATHING +#define DISABLE_RGB_MATRIX_BAND_SAT +#define DISABLE_RGB_MATRIX_BAND_VAL +#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +#define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define DISABLE_RGB_MATRIX_CYCLE_ALL +#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN +#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define DISABLE_RGB_MATRIX_DUAL_BEACON +#define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define DISABLE_RGB_MATRIX_CYCLE_SPIRAL +#define DISABLE_RGB_MATRIX_RAINBOW_BEACON +#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define DISABLE_RGB_MATRIX_RAINDROPS +#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define DISABLE_RGB_MATRIX_TYPING_HEATMAP +#define DISABLE_RGB_MATRIX_DIGITAL_RAIN +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#define DISABLE_RGB_MATRIX_SPLASH +#define DISABLE_RGB_MATRIX_MULTISPLASH +#define DISABLE_RGB_MATRIX_SOLID_SPLASH +#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH + +#define QMK_KEYS_PER_SCAN 4 + +#define USB_LED_CAPS_LOCK_SCANCODE 30 +#endif + +#ifdef KEYBOARD_massdrop_alt +#undef USB_LED_INDICATOR_ENABLE +#endif diff --git a/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/keymap.c b/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/keymap.c new file mode 100644 index 000000000000..9482b12c4486 --- /dev/null +++ b/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/keymap.c @@ -0,0 +1,104 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 "brandonschlack.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Base Layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│| \│~ `│Hom│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │Tab  │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│ Bspc│PgU│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │HyCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│   Enter│PgD│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │Shift   │ Z │ X │ C │ V │ B │ N │ M │< ,│> .│? /│ Shift│ Up│End│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬┬┬───┼───┼───┤ + * │Ctrl│ Opt│ Cmd│          Space         │Cmd │FnPy│││Lef│Dow│Rig│ + * └────┴────┴────┴────────────────────────┴────┴────┴┴┴───┴───┴───┘ + */ +[_BASE] = LAYOUT_65_ansi_blocker_split_bs( \ + 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_BSLS, KC_GRV, KC_HOME, \ + 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_BSPC, KC_PGUP, \ + HY_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ + KC_LSFT, 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_END, \ + KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, PLY_FN1, KC_LEFT, KC_DOWN, KC_RGHT \ +), +/* Function Layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Mke│ F1│ F2│ F3│ F4│ F5│ F6│ F7│ F8│ F9│F10│F11│F12│LHP│MNC│SlD│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │RMod │RH+│RS+│RV+│AS+│ │ │ │ │ │F13│F14│F15│  Del│VlU│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │RTgl │RH-│RS-│RV-│AS-│ │ │ │ │ │ │ │ │VlD│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │LYR│Thm│ │ │RST│ │   │Prv│Nxt│Ply│ │PgU│Mut│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬┬┬───┼───┼───┤ + * │ │ │ │ │ │ │││Hom│PgD│End│ + * └────┴────┴────┴────────────────────────┴────┴────┴┴┴───┴───┴───┘ + */ +[_FN1] = LAYOUT_65_ansi_blocker_split_bs( \ + QM_MAKE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, MC_LHPD, MC_MSSN, MC_SLPD, \ + RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, KC_F13, KC_F14, KC_F15, KC_DELT, KC_VOLU, \ + RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, \ + _______, RGB_LYR, RGB_THM, _______, _______, RESET, _______, _______, KC_MPRV, KC_MNXT, KC_MPLY, _______, KC_PGUP, KC_MUTE, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ +), +/* Blank Layout + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬┬┬───┼───┼───┤ + * │ │ │ │ │ │ │││ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴┴┴───┴───┴───┘ +[X] = LAYOUT_65_ansi_blocker_split_bs( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), +*/ +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + #ifdef KEYBOARD_massdrop + case RGB_TOG: + if (record->event.pressed) { + rgb_matrix_cycle_flag(); + } + return false; + #endif + default: + return true; //Process all other keycodes normally + } +} + +#ifdef RGB_MATRIX_ENABLE +void rgb_matrix_indicators_user(void) { + if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { + rgb_matrix_set_color(USB_LED_CAPS_LOCK_SCANCODE, RGB_GREEN); + } else if (!HAS_ANY_FLAGS(rgb_matrix_get_flags(), LED_FLAG_KEYS)){ + rgb_matrix_set_color(USB_LED_CAPS_LOCK_SCANCODE, 0, 0, 0); + } +} +#endif diff --git a/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/readme.md b/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/readme.md new file mode 100644 index 000000000000..51c7938eb47c --- /dev/null +++ b/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/readme.md @@ -0,0 +1,15 @@ +# brandonschlack's 65% ANSI blocker split backspace layout + +This is my preferred 65% layout. + +It is used on: + +* [Massdrop ALT](https://github.com/qmk/qmk_firmware/tree/master/keyboards/massdrop/alt) +* [KBD67 MKII](https://github.com/qmk/qmk_firmware/tree/master/keyboards/kbdfans/kbd67/mkiirgb) + +## [Base Layer](http://www.keyboard-layout-editor.com/#/gists/a820c8629394f8f4c3943e6ee518d9a8) +![Base Layer](https://i.imgur.com/gPxDZl7.jpg) + +## [Function Layer](http://www.keyboard-layout-editor.com/#/gists/8ca73a6d3bec8ce736f5db60edf31dcf) +![Function Layer](https://i.imgur.com/gNKHgWa.jpg) + diff --git a/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/rules.mk b/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/rules.mk new file mode 100644 index 000000000000..d12f9d5d3206 --- /dev/null +++ b/layouts/community/65_ansi_blocker_split_bs/brandonschlack-split/rules.mk @@ -0,0 +1,2 @@ +# Build Options +USER_NAME := brandonschlack diff --git a/layouts/community/75_ansi/brandonschlack/keymap.c b/layouts/community/75_ansi/brandonschlack/keymap.c new file mode 100644 index 000000000000..0f9d63c7c046 --- /dev/null +++ b/layouts/community/75_ansi/brandonschlack/keymap.c @@ -0,0 +1,105 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 "brandonschlack.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* LAYOUT + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┴───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ 2.0U │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │1.5U │ │ │ │ │ │ │ │ │ │ │ │ │1.5U │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │1.75U │ │ │ │ │ │ │ │ │ │ │ │2.25U │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │2.25U │ │ │ │ │ │ │ │ │ │ │1.75U │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │1.25│1.25│1.25│6.25U │1U │1U │1U │1U │1U │1U │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ + + /* Base Layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│ F1│ F2│ F3│ F4│ F5│ F6│ F7│ F8│ F9│F10│F11│F12│F13│F14│F15│ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┴───┼───┤ + * │~ `│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│ Bckspc│Hom│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│| \│PgU│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│ Enter│PgD│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │Shift │ Z │ X │ C │ V │ B │ N │ M │< ,│> .│? /│ Shift│ Up│End│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │Ctrl│ Opt│ Cmd│ Space │Cmd│Opt│Fn │Lef│Dow│Rig│ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ +[_BASE] = LAYOUT_75_ansi( \ + KC_ESC, 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_F13, KC_F14, KC_F15, \ + KC_GRV, 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_HOME, \ + 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_BSLS, KC_PGUP, \ + HY_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ + KC_LSFT, 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_END, \ + KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, RWD_CMD, FFD_OPT, PLY_FN1, KC_LEFT, KC_DOWN, KC_RGHT \ +), +/* Function Layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Mke│BrD│BrU│Msn│LHP│RV-│RV+│ │ │ │ │ │ │Prv│Nxt│Ply│ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┴───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ Del │SlD│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │RMod │RH+│RS+│RV+│AS+│ │ │ │ │ │ │ │ │ │VlU│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │RTgl │RH-│RS-│RV-│AS-│ │ │ │ │ │ │ │ │VlD│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │LYR│Thm│ │ │RST│ │ │ │ │ │ │PgU│Mte│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │ │ │ │ │ │ │ │Hom│PgD│End│ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ + */ +[_FN1] = LAYOUT_75_ansi( \ + QM_MAKE, KC_BRMD, KC_BRMU, MC_MSSN, MC_LHPD, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_MPLY, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DELT, MC_SLPD, \ + RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \ + RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, \ + _______, RGB_LYR, RGB_THM, _______, _______, RESET, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_MUTE, \ + _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ +), +/* Blank Layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┴───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┘ +[X] = LAYOUT_75_ansi( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), +*/ +}; diff --git a/layouts/community/75_ansi/brandonschlack/readme.md b/layouts/community/75_ansi/brandonschlack/readme.md new file mode 100644 index 000000000000..0dfb081ba792 --- /dev/null +++ b/layouts/community/75_ansi/brandonschlack/readme.md @@ -0,0 +1,7 @@ +# brandonschlack's 75_ansi layout + +This is my preferred 75% layout. + +It is currently used on: + +* [KBD75](https://github.com/qmk/qmk_firmware/tree/master/keyboards/kbdfans/kbd75) diff --git a/layouts/community/75_ansi/brandonschlack/rules.mk b/layouts/community/75_ansi/brandonschlack/rules.mk new file mode 100644 index 000000000000..104063ed444a --- /dev/null +++ b/layouts/community/75_ansi/brandonschlack/rules.mk @@ -0,0 +1,5 @@ +# Build Options +ifneq (, $(findstring kbd75, $(KEYBOARD))) + MOUSEKEY_ENABLE = no +endif +BACKLIGHT_ENABLE = no # No backlights installed diff --git a/layouts/community/ortho_4x12/brandonschlack/config.h b/layouts/community/ortho_4x12/brandonschlack/config.h new file mode 100644 index 000000000000..9b6789c1c9f4 --- /dev/null +++ b/layouts/community/ortho_4x12/brandonschlack/config.h @@ -0,0 +1,55 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 + +#ifdef KEYBOARD_planck_rev6 +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 +#endif diff --git a/layouts/community/ortho_4x12/brandonschlack/keymap.c b/layouts/community/ortho_4x12/brandonschlack/keymap.c new file mode 100644 index 000000000000..d4c1a4a867ea --- /dev/null +++ b/layouts/community/ortho_4x12/brandonschlack/keymap.c @@ -0,0 +1,218 @@ +/* Copyright 2019 Brandon Schlack + * + * 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 +#ifdef KEYBOARD_planck_rev6 + #include "muse.h" +#endif +#include "brandonschlack.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty */ +[_BASE] = LAYOUT_ortho_4x12( \ +// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + HY_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + MCO_LYR, KC_LCTL, KC_LOPT, KC_LCMD, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ +), + +/* Lower */ +[_LOWER] = LAYOUT_ortho_4x12( \ +// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + 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_DELT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + SF_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, KC_PGUP, KC_PGDN, KC_END, _______, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, KC_MUTE, KC_MUTE, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT \ +// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ +), + +/* Raise */ +[_RAISE] = LAYOUT_ortho_4x12( \ +// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + 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_DELT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + SF_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, KC_PGUP, KC_PGDN, KC_END, _______, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, KC_MPLY, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT \ +// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ +), + +/* Macros */ +[_MACRO] = LAYOUT_ortho_4x12( \ +// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, _______, _______, _______, _______, _______, KC_BRMD, KC_BRMU, MC_MSSN, MC_LHPD, MC_SLPD, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, MC_BACK, MC_FWRD, PRV_TAB, NXT_TAB, NXT_WIN, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, PX_AFLL, OP_AFLL, _______, _______, _______, _______, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ +), + +/* Adjust (Lower + Raise) */ +[_ADJUST] = LAYOUT_ortho_4x12( \ +// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + QM_MAKE, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, MC_SLPD, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + QM_FLSH, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, RGB_RTHM,RGB_THM, _______, _______, _______, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + EEP_RST, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ +) + +}; + +layer_state_t layer_state_set_keymap(layer_state_t state) { + state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + return state; +} + +#ifdef KEYBOARD_plaid +// Turn on Red LED when initialized +void keyboard_post_init_keymap(void) { + writePinHigh(LED_RED); +} + +// Use Green LED for Caps Lock +void led_set_user(uint8_t usb_led) { + if (IS_LED_OFF(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(LED_GREEN); + } else { + writePinHigh(LED_GREEN); + } +} +#endif + +#ifdef KEYBOARD_planck_rev6 +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update_keymap(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(MC_WH_U); + #else + tap_code(KC_VOLU); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(MC_WH_D); + #else + tap_code(KC_VOLD); + #endif + } + } +} + +void dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } +} + +void matrix_scan_keymap(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + case MCO_LYR: + return false; + default: + return true; + } +} +#endif diff --git a/layouts/community/ortho_4x12/brandonschlack/readme.md b/layouts/community/ortho_4x12/brandonschlack/readme.md new file mode 100644 index 000000000000..847851329f09 --- /dev/null +++ b/layouts/community/ortho_4x12/brandonschlack/readme.md @@ -0,0 +1,20 @@ +# brandonschlack's 4x12 Ortho Keymap + +This layout is based on the Planck layout. It is macOS-centric, with Colemak and DVORAK removed as I don't use them. + +## Keyboards Using This Layout + +* [Planck](https://github.com/qmk/qmk_firmware/tree/master/keyboards/planck) +* [Plaid](https://github.com/qmk/qmk_firmware/tree/master/keyboards/plaid) +* [JNAO](https://github.com/qmk/qmk_firmware/tree/master/keyboards/planck) (FORCE_LAYOUT=ortho_4x12) + +## Features + +* *Enter* acts as *Right Shift* when held +* On either **LOWER** or **RAISE** layers, tapping *Shift* will toggle *Caps Lock*, hold for Shift. +* Bottom left key is *Hyper* (Shift+Control+Option+Command) which I use to map global shortcuts in macOS. + * Holding *Esc* will also act as Hyper. +* **ADJUST** Layer + * Make command for compiling keyboard firmmware, a Reset key, and Debug toggle. + * Mission Control, Launchpad, and Sleep Display macOS macros + * Alt-Gui swapping diff --git a/layouts/community/ortho_4x12/brandonschlack/rules.mk b/layouts/community/ortho_4x12/brandonschlack/rules.mk new file mode 100644 index 000000000000..e36b073d22b4 --- /dev/null +++ b/layouts/community/ortho_4x12/brandonschlack/rules.mk @@ -0,0 +1,10 @@ +ifeq ($(strip $(KEYBOARD)), planck/rev6) + SRC += muse.c +endif + +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +BACKLIGHT_ENABLE = no # No backlights installed + +ifeq ($(strip $(KEYBOARD)), jnao) + BOOTMAGIC_ENABLE = lite +endif diff --git a/layouts/community/ortho_5x12/brandonschlack/config.h b/layouts/community/ortho_5x12/brandonschlack/config.h new file mode 100644 index 000000000000..9968297363d5 --- /dev/null +++ b/layouts/community/ortho_5x12/brandonschlack/config.h @@ -0,0 +1,55 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 + +#ifdef KEYBOARD_preonic_rev3 +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PREONIC_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 +#endif diff --git a/layouts/community/ortho_5x12/brandonschlack/keymap.c b/layouts/community/ortho_5x12/brandonschlack/keymap.c new file mode 100644 index 000000000000..4d7b7483adc2 --- /dev/null +++ b/layouts/community/ortho_5x12/brandonschlack/keymap.c @@ -0,0 +1,214 @@ +/* Copyright 2019 Brandon Schlack + * + * 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 +#ifdef KEYBOARD_preonic_rev3 + #include "muse.h" +#endif +#include "brandonschlack.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty */ +[_BASE] = LAYOUT_ortho_5x12( \ +// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + HY_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + MCO_LYR, KC_LCTL, KC_LOPT, KC_LCMD, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ +), + +/* Lower */ +[_LOWER] = LAYOUT_ortho_5x12( \ +// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + 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_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DELT, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + SF_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, KC_MUTE, KC_MUTE, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT \ +// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ +), + +/* Raise */ +[_RAISE] = LAYOUT_ortho_5x12( \ +// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELT, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + SF_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, KC_MPLY, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT \ +// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ +), + +/* Function */ +[_MACRO] = LAYOUT_ortho_5x12( \ +// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, _______, _______, _______, _______, _______, KC_BRMD, KC_BRMU, MC_MSSN, MC_LHPD, MC_SLPD, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, MC_BACK, MC_FWRD, PRV_TAB, NXT_TAB, NXT_WIN, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, PX_AFLL, OP_AFLL, _______, _______, _______, _______, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ +), + +/* Adjust (Lower + Raise) */ +[_ADJUST] = LAYOUT_ortho_5x12( \ +// ┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┐ + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, MC_SLPD, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + QM_MAKE, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + QM_FLSH, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, RGB_RTHM,RGB_THM, _______, _______, _______, \ +// ├────────┼────────┼────────┼────────┼────────┼────────┴────────┼────────┼────────┼────────┼────────┼────────┤ + EEP_RST, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +// └────────┴────────┴────────┴────────┴────────┴─────────────────┴────────┴────────┴────────┴────────┴────────┘ +) + + +}; + +layer_state_t layer_state_set_keymap(layer_state_t state) { + state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + return state; +} + +#ifdef KEYBOARD_preonic_rev3 +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update_keymap(uint8_t index, bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + tap_code(MC_WH_U); + #else + tap_code(KC_VOLU); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + tap_code(MC_WH_D); + #else + tap_code(KC_VOLD); + #endif + } + } +} + +void dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + case 0: { +#ifdef AUDIO_ENABLE + static bool play_sound = false; +#endif + if (active) { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_song); } +#endif + layer_on(_ADJUST); + } else { +#ifdef AUDIO_ENABLE + if (play_sound) { PLAY_SONG(plover_gb_song); } +#endif + layer_off(_ADJUST); + } +#ifdef AUDIO_ENABLE + play_sound = true; +#endif + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } +} + + +void matrix_scan_keymap(void) { +#ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +#endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + case MCO_LYR: + return false; + default: + return true; + } +} +#endif diff --git a/layouts/community/ortho_5x12/brandonschlack/readme.md b/layouts/community/ortho_5x12/brandonschlack/readme.md new file mode 100644 index 000000000000..787fbb82072e --- /dev/null +++ b/layouts/community/ortho_5x12/brandonschlack/readme.md @@ -0,0 +1,19 @@ +# brandonschlack's 5x12 Ortho Keymap + +This layout takes inspiration from the Preonic and JNAO. It is macOS-centric, with Colemak and DVORAK removed as I don't use them. + +## Keyboards Using This Layout + +* [Preonic](https://github.com/qmk/qmk_firmware/tree/master/keyboards/planck) +* [JNAO](https://github.com/qmk/qmk_firmware/tree/master/keyboards/planck) (FORCE_LAYOUT=ortho_5x12) + +## Features + +* *Enter* acts as *Right Shift* when held +* On either **LOWER** or **RAISE** layers, tapping *Shift* will toggle *Caps Lock*, hold for Shift. +* Bottom left key is *Hyper* (Shift+Control+Option+Command) which I use to map global shortcuts in macOS. + * Holding *Esc* will also act as Hyper. +* **ADJUST** Layer + * Make command for compiling keyboard firmmware, a Reset key, and Debug toggle. + * Mission Control, Launchpad, and Sleep Display macOS macros + * Alt-Gui swapping diff --git a/layouts/community/ortho_5x12/brandonschlack/rules.mk b/layouts/community/ortho_5x12/brandonschlack/rules.mk new file mode 100644 index 000000000000..dacfc28b2306 --- /dev/null +++ b/layouts/community/ortho_5x12/brandonschlack/rules.mk @@ -0,0 +1,10 @@ +ifeq ($(strip $(KEYBOARD)), preonic/rev3) + SRC += muse.c +endif + +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +BACKLIGHT_ENABLE = no # No backlights installed + +ifeq ($(strip $(KEYBOARD)), jnao) + BOOTMAGIC_ENABLE = lite +endif diff --git a/layouts/community/tkl_ansi/brandonschlack/config.h b/layouts/community/tkl_ansi/brandonschlack/config.h new file mode 100644 index 000000000000..df29654049d9 --- /dev/null +++ b/layouts/community/tkl_ansi/brandonschlack/config.h @@ -0,0 +1,20 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 + +// Explicit RGB Animation Mode Include +#undef RGBLIGHT_ANIMATIONS +#define RGBLIGHT_EFFECT_BREATHING // Only have Breathing Animation diff --git a/layouts/community/tkl_ansi/brandonschlack/keymap.c b/layouts/community/tkl_ansi/brandonschlack/keymap.c new file mode 100644 index 000000000000..6f13d33b4aea --- /dev/null +++ b/layouts/community/tkl_ansi/brandonschlack/keymap.c @@ -0,0 +1,102 @@ +/* Copyright 2019 Brandon Schlack + * + * 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 "brandonschlack.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Base Layer + * ┌───┬───┬───┬───┬───┬───┬─┬───┬───┬───┬───┬─┬───┬───┬───┬───┬─┬───┬───┬───┐ + * │Esc│ │ F1│ F2│ F3│ F4│ │ F5│ F6│ F7│ F8│ │ F9│F10│F11│F12│ │F13│F14│F15│ + * ├───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┤ + * ├───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┤ + * │~ `│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│ Bckspc│ │Ins│Hom│PgU│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ + * │Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│| \│ │Del│End│PgD│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┤ + * │HyCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│ Enter│ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ │ + * │Shift │ Z │ X │ C │ V │ B │ N │ M │< ,│> .│? /│ Shift│ │ Up│ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┤ + * │Ctrl│ Opt│ Cmd│ Space │Cmd │Opt │Fn │Ctrl│ │Lef│Dow│Rig│ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┴─┴───┴───┴───┘ + */ +[_BASE] = LAYOUT_tkl_ansi( \ + KC_ESC, 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_F13, KC_F14, KC_F15, \ + KC_GRV, 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_INS, KC_HOME, KC_PGUP, \ + 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_BSLS, KC_DEL, KC_END, KC_PGDN, \ + HY_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, 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_LCTL, KC_LOPT, KC_LCMD, KC_SPC, RWD_CMD, FFD_OPT, PLY_FN1, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ +), +/* Function Layer + * ┌───┬───┬───┬───┬───┬───┬─┬───┬───┬───┬───┬─┬───┬───┬───┬───┬─┬───┬───┬───┐ + * │Mke│ │BrD│BrU│Msn│LHP│ │RV-│RV+│ │ │ │ │ │ │ │ │ │ │Mut│ + * ├───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┤ + * ├───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ Del │ │Ply│Slp│VlU│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ + * │RMod │RH+│RS+│RV+│AS+│ │ │ │ │ │ │ │ │ │ │Prv│Nxt│VlD│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┤ + * │RTgl │RH-│RS-│RV-│AS-│ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ │ + * │ │LYR│Thm│ │ │RST│ │ │ │ │ │ │ │PgU│ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │Hom│PgD│End│ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┴─┴───┴───┴───┘ + */ +[_FN1] = LAYOUT_tkl_ansi( \ + QM_MAKE, KC_BRMD, KC_BRMU, MC_MSSN, MC_LHPD, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DELT, KC_MPLY, MC_SLPD, KC_VOLU, \ + RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ + RGB_TOG, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_LYR, RGB_THM, _______, _______, RESET, _______, _______, _______, _______, _______, _______, KC_PGUP, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ +) +/* Blank Template + * ┌───┬───┬───┬───┬───┬───┬─┬───┬───┬───┬───┬─┬───┬───┬───┬───┬─┬───┬───┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┤ + * ├───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┴─┴───┴───┴───┘ + */ +/* +[BLANK] = LAYOUT_tkl_ansi( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) +*/ +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/layouts/community/tkl_ansi/brandonschlack/readme.md b/layouts/community/tkl_ansi/brandonschlack/readme.md new file mode 100644 index 000000000000..e8885a13cace --- /dev/null +++ b/layouts/community/tkl_ansi/brandonschlack/readme.md @@ -0,0 +1,55 @@ +# brandonschlack's TKL ANSI layout + +A mostly typical Mac setup, with some personal QMK touches. + +## Base Layer + +The base layer has a standard macOS modifier layout, with **F13-F15** in the F row, in place of **Print Screen**, **Scroll Lock**, and **Pause/Break**. + +### [Mod-Taps](https://docs.qmk.fm/#/feature_advanced_keycodes?id=mod-tap) + +* Hyper Caps Lock + * Hold **Caps Lock** for '**Hyper**' (**Shift**+**Control**+**Option**+**Command**). I use it for mapping global shortcuts for apps. + * Tapping **Caps Lock** functions normally +* Media controls mapped to Right Modifiers + * **Right Command** for **Prev Track** + * **Right Option** for **Next Track** + * **Fn** for **Play/Pause** + +## Function Layer + +The Function layer is a mix of [Apple's *Fn* shortcuts](https://support.apple.com/en-us/HT201236), [WASD Keyboard's Media shortcuts](https://codekeyboards.com/#multimedia), and some QMK functionality. + +### [Apple's *Fn* shortcuts](https://support.apple.com/en-us/HT201236) + +* **Home/Page Down/Page Up/End** as **Fn+Left/Down/Up/Right** +* **Foward Delete** as **Fn+Backspace** +* **Display Brightness Down/Up** as **Fn+F1/F2** +* **Misson Control** (*KC_FIND, but use [Karabiner-Elements](https://pqrs.org/osx/karabiner/index.html) as find -> mission_control*) as **Fn+F3** +* **Launchpad** (*KC_MENU, but use [Karabiner-Elements](https://pqrs.org/osx/karabiner/index.html) as menu -> launchpad*) as **Fn+F4** +* Keyboard Illumination Down/Up used as **RGB Underglow Value Decrease/Increase** on **Fn+F5/F6** + +### [WASD Keyboard's Media shortcuts](https://codekeyboards.com/#multimedia) + +* **Play/Pause** as **Fn+Insert** +* **Prev/Next Track** as **Fn+Delete/End** +* **Volume Up/Down** as **Fn+Page Up/Page Down** +* **Volume Mute** as **Fn+F15** + +### Personal & QMK shortcuts + +* **Sleep Display** (Shift+Control+Power) as **Fn+Home**. +* **QMK Make** as **Fn+Esc**. Sends make command to command line. Holding **Shift** will also append `:flash` target and put keyboard into bootloader. +* **Reset** as **Fn+B** + +### RGB Controls + +* **RGB Toggle** as **Fn+Caps Lock** +* **RGB Hue Increase/Decrease** as **Fn+Q/A** +* **RGB Saturation Increase/Decrease** as **Fn+W/S** +* **RGB Value Increase/Decrease** as **Fn+E/D** +* **RGB Mode Next/Previous** as **Fn+Tab/Shift+Tab** +* **RGB Toggle Layer Indication** as **Fn+Z** + * Changes RGB Color with Layer change (*uses custom RGB_THEME*). +* **RGB Cycle Next Theme** as **Fn+X** + diff --git a/layouts/community/tkl_ansi/brandonschlack/rules.mk b/layouts/community/tkl_ansi/brandonschlack/rules.mk new file mode 100644 index 000000000000..5ce3c8ee4349 --- /dev/null +++ b/layouts/community/tkl_ansi/brandonschlack/rules.mk @@ -0,0 +1,4 @@ +# Build Options +CONSOLE_ENABLE = yes # Enable Console for Debugging +MOUSEKEY_ENABLE = no # Don't need Mouse Keys +BACKLIGHT_ENABLE = no # Backlights not installed diff --git a/users/brandonschlack/brandonschlack.c b/users/brandonschlack/brandonschlack.c new file mode 100644 index 000000000000..1e52bd645260 --- /dev/null +++ b/users/brandonschlack/brandonschlack.c @@ -0,0 +1,214 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 "brandonschlack.h" + +user_config_t user_config; +#ifdef STOPLIGHT_LED +static stoplight_led_t stoplight_led; +#endif + +/** + * Resets user config in EEPROM + * + * Default is use rgb for layer indication + */ +void eeconfig_init_user(void) { + user_config.raw = 0; + user_config.rgb_layer_change = true; + user_config.rgb_theme = 0; + eeconfig_update_user(user_config.raw); +} + +__attribute__((weak)) +void matrix_init_keymap(void){ } + +void matrix_init_user(void) { + matrix_init_keymap(); +} + +__attribute__((weak)) +void keyboard_post_init_keymap(void){ } + +/** + * Reads user config from EEPROM, + * calls RGB init if RGBs enabled + */ +void keyboard_post_init_user(void){ + // Read the user config from EEPROM + user_config.raw = eeconfig_read_user(); + // Do Stoplight Animation if enabled +#ifdef STOPLIGHT_LED + led_stoplight_start(); +#endif + // Do RGB things if RGBs enabled +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + keyboard_post_init_rgb(); +#endif + keyboard_post_init_keymap(); +} + +__attribute__ ((weak)) +void shutdown_keymap(void) {} + +/** + * On shutdown, + * If RGBs enabled, + * then set RGB color to Red + */ +void shutdown_user (void) { +#ifdef RGBLIGHT_ENABLE + rgblight_enable_noeeprom(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + rgblight_sethsv_noeeprom(0, 255, 127); +#endif // RGBLIGHT_ENABLE +#ifdef RGB_MATRIX_ENABLE + rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); +#endif //RGB_MATRIX_ENABLE + shutdown_keymap(); +} + +__attribute__ ((weak)) +void suspend_power_down_keymap(void) {} + +/** + * Set rgb_matrix suspend state to true if not already + */ +void suspend_power_down_user(void) { +#ifdef RGB_MATRIX_ENABLE + if (!g_suspend_state) { + rgb_matrix_set_suspend_state(true); + } +#endif //RGB_MATRIX_ENABLE + suspend_power_down_keymap(); +} + +__attribute__ ((weak)) +void suspend_wakeup_init_keymap(void) {} + +/** + * Set rgb_matrix suspend state to false if not already + */ +void suspend_wakeup_init_user(void) { +#ifdef RGB_MATRIX_ENABLE + if (g_suspend_state) { + rgb_matrix_set_suspend_state(false); + } +#endif //RGB_MATRIX_ENABLE + suspend_wakeup_init_keymap(); +} + +__attribute__ ((weak)) +void matrix_scan_keymap(void) {} + +/** + * Checks for Super CMD↯TAB + */ +void matrix_scan_user(void) { + matrix_scan_cmd_tab(); +#ifdef STOPLIGHT_LED + matrix_scan_led_stoplight(); +#endif + matrix_scan_keymap(); +} + +__attribute__ ((weak)) +layer_state_t default_layer_state_set_keymap(layer_state_t state) { + return state; +} + +/** + * For macropads, if a new default layer is set from DF() + * then automatically set that layer with layer_move() + */ +layer_state_t default_layer_state_set_user(layer_state_t state) { +#if defined(IS_MACROPAD) + layer_move(get_highest_layer(state)); +#endif + return default_layer_state_set_keymap(state); +} + +__attribute__ ((weak)) +layer_state_t layer_state_set_keymap(layer_state_t state) { + return state; +} + +/** + * Do RGB things (like layer indication) on layer change + */ +layer_state_t layer_state_set_user(layer_state_t state) { +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + state = layer_state_set_rgb(state); +#endif // RGBLIGHT_ENABLE + return layer_state_set_keymap(state); +} + +__attribute__((weak)) bool led_update_keymap(led_t led_state) { return true; } + +bool led_update_user(led_t led_state) { +#ifdef STOPLIGHT_LED + if (stoplight_led.is_active) { + return false; + } +#endif + return led_update_keymap(led_state); +} + +#ifdef STOPLIGHT_LED +void led_stoplight_start(void) { + writePin(TOP_LED, LED_ON(false)); + writePin(MIDDLE_LED, LED_ON(false)); + writePin(BOTTOM_LED, LED_ON(false)); + + stoplight_led.is_active = true; + stoplight_led.timer = timer_read(); +}; + +void led_stoplight_set(pin_t pin) { + writePin(pin, LED_ON(true)); +}; + +void led_stoplight_end(void) { + // Reset timer and status variables + stoplight_led.is_active = false; + stoplight_led.index = 0; + stoplight_led.timer = 0; + led_update_kb(host_keyboard_led_state()); +}; + +void matrix_scan_led_stoplight(void) { + if (stoplight_led.is_active) { + if (timer_elapsed(stoplight_led.timer) > (1000 * (stoplight_led.index + 1))) { + switch (stoplight_led.index){ + case 0: + led_stoplight_set(TOP_LED); + stoplight_led.index++; + break; + case 1: + led_stoplight_set(MIDDLE_LED); + stoplight_led.index++; + break; + case 2: + led_stoplight_set(BOTTOM_LED); + stoplight_led.index++; + break; + default: + led_stoplight_end(); + break; + } + } + } +}; +#endif diff --git a/users/brandonschlack/brandonschlack.h b/users/brandonschlack/brandonschlack.h new file mode 100644 index 000000000000..d7dbc0ea4b90 --- /dev/null +++ b/users/brandonschlack/brandonschlack.h @@ -0,0 +1,83 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 + +#include "quantum.h" +#include "version.h" +#include "eeprom.h" +#include "process_records.h" +#ifdef TAP_DANCE_ENABLE +# include "tap_dances.h" +#endif // TAP_DANCE_ENABLE +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) +# include "rgb_bs.h" +#endif + +/* TODO Layer Names */ +enum bs_layers { + _BASE = 0, + _M1 = 1, + _M2 = 2, + _M3 = 3, + _M4 = 4, + _FN1 = 5, + _M1_FN1 = 6, + _M2_FN1 = 7, + _M3_FN1 = 8, + _M4_FN1 = 9, + _FN2 = 10, + _M1_FN2 = 11, + _M2_FN2 = 12, + _M3_FN2 = 13, + _M4_FN2 = 14, + _ADJUST = 15 // 15: Change keyboard settings +}; + +#define _LOWER _FN1 +#define _RAISE _FN2 + +/* TODO User EECONFIG */ +typedef union { + uint32_t raw; + struct { + bool rgb_layer_change :1; + uint8_t rgb_theme :4; + }; +} user_config_t; +extern user_config_t user_config; + +void matrix_init_keymap(void); +void keyboard_post_init_keymap(void); +void shutdown_keymap(void); +void suspend_power_down_keymap(void); +void suspend_wakeup_init_keymap(void); +void matrix_scan_keymap(void); +layer_state_t default_layer_state_set_keymap(layer_state_t state); +layer_state_t layer_state_set_keymap(layer_state_t state); +bool led_update_keymap(led_t led_state); + +#ifdef STOPLIGHT_LED +typedef struct { + bool is_active :1; + uint8_t index :7; + uint16_t timer :16; +} stoplight_led_t; + +void led_stoplight_start(void); +void led_stoplight_set(pin_t pin); +void led_stoplight_end(void); +void matrix_scan_led_stoplight(void); +#endif diff --git a/users/brandonschlack/config.h b/users/brandonschlack/config.h new file mode 100644 index 000000000000..8f09adef3e34 --- /dev/null +++ b/users/brandonschlack/config.h @@ -0,0 +1,55 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 + +#define TAPPING_TOGGLE 2 +#define TAPPING_TERM 200 +#define PERMISSIVE_HOLD +#define TAP_HOLD_CAPS_DELAY 200 + +#ifdef RGBLIGHT_ENABLE +# define RGBLIGHT_SLEEP +#endif + +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) && !defined(RGBLIGHT_LAYERS) +# define RGB_THEME_ENABLE +#endif + +#ifdef RGB_THEME_ENABLE +# define DISABLE_RGB_THEME_JAMON +# define DISABLE_RGB_THEME_OBLIQUE +#endif + +#ifdef ENCODER_ENABLE +# define TAP_CODE_DELAY 10 +#else +# define TAP_CODE_DELAY 5 +#endif + +/* Disable unused and unneeded features to reduce on firmware size */ +#ifndef NO_ACTION_MACRO +# define NO_ACTION_MACRO +#endif +#ifndef NO_ACTION_FUNCTION +# define NO_ACTION_FUNCTION +#endif + +#ifdef LOCKING_SUPPORT_ENABLE +# undef LOCKING_SUPPORT_ENABLE +#endif +#ifdef LOCKING_RESYNC_ENABLE +# undef LOCKING_RESYNC_ENABLE +#endif diff --git a/users/brandonschlack/process_records.c b/users/brandonschlack/process_records.c new file mode 100644 index 000000000000..dfd427bdc1e0 --- /dev/null +++ b/users/brandonschlack/process_records.c @@ -0,0 +1,172 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 "brandonschlack.h" + +// Super CMD↯TAB +bool is_cmd_tab_active = false; +uint16_t cmd_tab_timer = 0; + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +// Consolidated Macros +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QM_MAKE: // Sends 'qmk compile' or 'qmk flash' + if (record->event.pressed) { + bool flash = false; + // If is a keyboard and auto-flash is not set in rules.mk, + // then Shift will trigger the flash command + #if !defined(FLASH_BOOTLOADER) && !defined(IS_MACROPAD) + uint8_t temp_mod = get_mods(); + uint8_t temp_osm = get_oneshot_mods(); + clear_mods(); + clear_oneshot_mods(); + if ( (temp_mod | temp_osm) & MOD_MASK_SHIFT ) + #endif + { + flash = true; + } + send_make_command(flash); + } + break; + case QM_FLSH: // Sends flash command instead of compile + if (record->event.pressed) { + clear_mods(); + clear_oneshot_mods(); + send_make_command(true); + } + break; + case QM_VRSN: // Prints firmware version + if (record->event.pressed) { + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE); + } + break; + case QM_KYBD: // Prints keyboard path + if (record->event.pressed) { + SEND_STRING("keyboards/" QMK_KEYBOARD "/"); + } + break; + case QM_KYMP: // Prints keymap path + if (record->event.pressed) { + SEND_STRING("keyboards/" QMK_KEYBOARD "/keymaps/" QMK_KEYMAP "/keymap.c"); + } + break; + case CMD_TAB: // Super CMD↯TAB + if (record->event.pressed) { + if (!is_cmd_tab_active) { + is_cmd_tab_active = true; + register_code(KC_LGUI); + } + cmd_tab_timer = timer_read(); + register_code(KC_TAB); + } else { + unregister_code(KC_TAB); + } + break; + #if defined(RGB_THEME_ENABLE) + case RGB_LYR: + if (record->event.pressed) { + user_config.rgb_layer_change ^= 1; + dprintf("rgb layer change [EEPROM]: %u\n", user_config.rgb_layer_change); + eeconfig_update_user(user_config.raw); + if (user_config.rgb_layer_change) { + layer_state_set(layer_state); + } + } + break; + case RGB_HUI ... RGB_SAD: + if (record->event.pressed) { + if (user_config.rgb_layer_change) { + user_config.rgb_layer_change = false; + dprintf("rgb layer change [EEPROM]: %u\n", user_config.rgb_layer_change); + eeconfig_update_user(user_config.raw); + } + } + break; + case RGB_THEME_FORWARD: + if (record->event.pressed) { + uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)); + if(shifted) { + rgb_theme_step_reverse(); + } else { + rgb_theme_step(); + } + layer_state_set(layer_state); + } + break; + case RGB_THEME_REVERSE: + if (record->event.pressed) { + uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)); + if(shifted) { + rgb_theme_step(); + } else { + rgb_theme_step_reverse(); + } + layer_state_set(layer_state); + } + break; + #endif + } + return process_record_keymap(keycode, record); +} + +// Super CMD↯TAB +void matrix_scan_cmd_tab(void) { + if (is_cmd_tab_active) { + if (timer_elapsed(cmd_tab_timer) > 500) { + unregister_code(KC_LGUI); + is_cmd_tab_active = false; + } + } +} + +/** + * Send Make Command + * + * Sends 'qmk compile -kb keyboard -km keymap' command to compile firmware + * Uses 'qmk flash' and resets keyboard, if flash_bootloader set to true + * Sends CTPC and/or FORCE_LAYOUT parameters if built with those options + */ +void send_make_command(bool flash_bootloader) { +#ifdef FORCE_LAYOUT // Add layout string if built with FORCE_LAYOUT + SEND_STRING("FORCE_LAYOUT=" FORCE_LAYOUT " "); +#endif +#ifdef CONVERT_TO_PROTON_C // Add CTPC if built with CONVERT_TO_PROTON_C + SEND_STRING("CTPC=yes "); +#endif + SEND_STRING("qmk "); + if (flash_bootloader) { +#ifndef KEYBOARD_massdrop // Don't run flash for Massdrop boards + SEND_STRING("flash "); + } else { +#endif + SEND_STRING("compile "); + } + SEND_STRING("-kb " QMK_KEYBOARD " "); + SEND_STRING("-km " QMK_KEYMAP); + if (flash_bootloader) { +#if defined(KEYBOARD_massdrop) // only run for Massdrop boards + SEND_STRING(" && mdlflash " QMK_KEYBOARD " " QMK_KEYMAP); +#endif + } + SEND_STRING(SS_TAP(X_ENTER)); + if (flash_bootloader) { + reset_keyboard(); + } +} diff --git a/users/brandonschlack/process_records.h b/users/brandonschlack/process_records.h new file mode 100644 index 000000000000..057233fb0e42 --- /dev/null +++ b/users/brandonschlack/process_records.h @@ -0,0 +1,152 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 +#include "brandonschlack.h" + +// Macros +enum custom_keycodes { + QM_MAKE = SAFE_RANGE, + QM_FLSH, + QM_VRSN, + QM_KYBD, + QM_KYMP, + CMD_TAB, + RGB_LYR, + RGB_THEME_FORWARD, + RGB_THEME_REVERSE, + KEYMAP_SAFE_RANGE +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); +void matrix_scan_cmd_tab(void); + +/** + * QMK Defines + * Some meta aliases for QMK features such as Mod-Taps + * and for cleaner looking Layer Toggles + */ +/* Control Mod-Tap */ +#define CTL_ESC CTL_T(KC_ESC) // Hold Escape for Control +#define CTL_TAB CTL_T(KC_TAB) // Hold Tab for Control +#define CTL_CAP CTL_T(KC_CAPS) // Hold Caps Lock for Control +/* Command Mod-Tap */ +#define CMD_ESC CMD_T(KC_ESC) // Hold Escape for Command +#define CMD_CAP CMD_T(KC_CAPS) // Hold Caps Lock for Command +#define CMD_SPC CMD_T(KC_SPC) // Hold Space for Command +/* Hyper Mod-Tap */ +#define HY_ESC ALL_T(KC_ESC) // Hold Escape for Hyper (Shift-Control-Option-Command) +#define HY_TAB ALL_T(KC_TAB) // Hold Tab for Hyper (Shift-Control-Option-Command) +#define HY_CAPS ALL_T(KC_CAPS) // Hold Caps Lock for Hyper (Shift-Control-Option-Command) +/* Shift Mod-Tap */ +#define SF_CAPS LSFT_T(KC_CAPS) // Hold Caps Lock for Left Shift +#define SFT_ENT RSFT_T(KC_ENT) // Hold Enter for Right Shift +#define SF_SLSH RSFT_T(KC_SLSH) // Tap Right Shift for Slash (/) +#define SF_BSLS RSFT_T(KC_BSLS) // Tap Right Shift for Back Slash (\) +/* Layer Aliases */ +#define FN_LYR MO(_FN1) // Hold for FN Layer +#define FN2_LYR MO(_FN2) // Hold for FN2 Layer +#define LOWER MO(_LOWER) // Hold for LOWER Layer +#define RAISE MO(_RAISE) // Hold for RAISE Layer +#define TT_FN TT(_FN1) // Hold for FN Layer, or Double-Tap to Toggle +#define TT_FN2 TT(_FN2) // Hold for FN2 Layer, or Double-Tap to Toggle +#define TT_LWR TT(_LOWER) // Hold for LOWER Layer, or Double-Tap to Toggle +#define TT_RAI TT(_RAISE) // Hold for RAISE Layer, or Double-Tap to Toggle +#define SPC_LWR LT(_LOWER, KC_SPC) // Tap for Space, Hold for LOWER Layer +#define SPC_RAI LT(_RAISE, KC_SPC) // Tap for Space, Hold for RAISE Layer +#define SLH_LWR LT(_LOWER, KC_SLSH) // Tap for /, Hold for LOWER Layer +#define BSL_LWR LT(_LOWER, KC_BSLS) // Tap for \, Hold for LOWER Layer +#define MCO_LYR MO(_MACRO) // Hold for MACRO Layer +#define TG_ADJT TG(_ADJUST) // Toggle ADJUST Layer +#define TG_LGHT TG(_LIGHT) // Toggle LIGHT Layer +/** + * Media Mod-Tap + * Use the Mod-Tap feature for easy media controls + * Used with >=65% layouts + */ +#define RWD_CMD RCMD_T(KC_MPRV) // Tap Right Command for Prev Track +#define PLY_CMD RCMD_T(KC_MPLY) // Tap Right Command for Play/Pause +#define FFD_OPT ROPT_T(KC_MNXT) // Tap Right Option for Next Track +#define PLY_FN1 LT(_FN1, KC_MPLY) // Tap Fn for Play/Pause +#define PLY_FN2 LT(_FN2, KC_MPLY) // Tap Fn2 for Play/Pause +#define MUT_SFT RSFT_T(KC_MUTE) // Tap Right Shift for Mute +/** + * Arrow Mod-Tap + * Use the Mod-Tap feature for arrow keys + * Mostly used for 40-60% layouts + */ +#define UP_RSFT RSFT_T(KC_UP) // Tap Right Shift for Up +#define LFT_OPT ROPT_T(KC_LEFT) // Tap Right Option for Left +#define LFT_CMD RCMD_T(KC_LEFT) // Tap Right Command for Left +#define DWN_FN1 LT(1, KC_DOWN) // Tap Fn for Down +#define DWN_LWR DWN_FN1 // Tap Lower for Down +#define DWN_FN2 LT(2, KC_DOWN) // Tap Fn2 for Down +#define DWN_RAI DWN_FN2 // Tap Raise for Down +#define DWN_OPT ROPT_T(KC_DOWN) // Tap Right Option for Down +#define RGT_SFT RSFT_T(KC_RGHT) // Tap Right Shift for Right +#define RGT_OPT ROPT_T(KC_RGHT) // Tap Right Option for Right +#define RGT_CTL RCTL_T(KC_RGHT) // Tap Right Ctrl for Right +/** + * Nav Mod-Tap + * Use the Mod-Tap feature for nav keys (Home/End, Page Up/Down) + * Mostly used for 40-60% layouts, on a function layer + */ +#define PGU_SFT RSFT_T(KC_PGUP) // Tap Right Shift for Page Up +#define HOM_OPT ROPT_T(KC_HOME) // Tap Right Option for Home +#define HOM_CMD RCMD_T(KC_HOME) // Tap Right Command for Home +#define PGD_OPT ROPT_T(KC_PGDN) // Tap Right Option for Page Down +#define PGD_FN1 LT(1, KC_PGDN) // Tap Fn for Page Down +#define PGD_LWR PGD_FN1 // Tap Lower for Page Down +#define PGD_FN2 LT(2, KC_PGDN) // Tap Fn2 for Page Down +#define PGD_RAI PGD_FN2 // Tap Raise for Page Down +#define END_OPT ROPT_T(KC_END) // Tap Right Option for End +#define END_CTL RCTL_T(KC_END) // Tap Right Control for End + +/** + * MacOS + * Common shortcuts used in macOS + * Reference: https://support.apple.com/en-us/HT201236 + */ +#define MC_POWR KC_POWER // Power (KC_POWER) +#define MC_SLEP LOPT(LCMD(KC_POWER)) // Sleep (Option-Command-Power) +#define MC_SLPD LCTL(LSFT(KC_POWER)) // Sleep Display (Control-Shift-Power) +#define MC_LOCK LCTL(LCMD(KC_Q)) // Lock Screen (Control-Command-Q) +#define MC_MSSN KC_FIND // Mission Control: Configure karabiner for find -> mission_control +#define MC_LHPD KC_MENU // Launchpad: Configure karabiner for menu -> launchpad +#define MC_CMTB LCMD(KC_TAB) // Command-Tab +#define MC_BACK LCMD(KC_LBRC) // Back (Command–Left Bracket) +#define MC_FWRD LCMD(KC_RBRC) // Forward (Command–Right Bracket) +#define CLS_TAB LCMD(KC_W) // Close Tab (Command–W) +#define REO_TAB LSFT(LCMD(KC_T)) // Reopen Last Tab (Shift-Command-T) +#define NXT_TAB LCTL(KC_TAB) // Next Tab (Control-Tab) +#define PRV_TAB LSFT(LCTL(KC_TAB)) // Previous Tab (Shift-Control-Tab) +#define NXT_WIN LCMD(KC_GRV) // Next Window (Control-Grave) +#define PRV_WIN LCMD(KC_TILD) // Previous Window (Shift-Control-Grave) +#define MC_PLYR LCMD(KC_F8) // Focuses current Media Player +#define MC_UNDO LCMD(KC_Z) // Undo (Command-Z) +#define MC_REDO LSFT(LCMD(KC_Z)) // Redo (Shift-Command-Z) +#define OP_AFLL HYPR(KC_BSLS) // 1Password Autofill (Shift-Control-Option-Command-\) +#define PX_AFLL LSFT(LOPT(KC_X)) // 1PasswordX Autofill (Shift-Option-X) +// Reverse scrolling for using with macOS Natural Scrolling. +#define MC_WH_U KC_WH_D // Mouse Wheel Up +#define MC_WH_D KC_WH_U // Mouse Wheel Down +#define MC_WH_L KC_WH_R // Mouse Wheel Left +#define MC_WH_R KC_WH_L // Mouse Wheel Right + +// RGB Theme +#define RGB_THM RGB_THEME_FORWARD // Cycle next RGB_THEME +#define RGB_RTHM RGB_THEME_REVERSE // Cycle previous RGB_THEME + +void send_make_command(bool flash_bootloader); diff --git a/users/brandonschlack/readme.md b/users/brandonschlack/readme.md new file mode 100644 index 000000000000..84f216f9f885 --- /dev/null +++ b/users/brandonschlack/readme.md @@ -0,0 +1,48 @@ +# Overview + +My QMK home. I feel as though I stand on the shoulders of giants, for a lot of my code here is borrowed and adapted from so many contributors here, and that I hope my code here can help or inspire others. + +## Layers, Handlers, and Macros +### Layers + +I have some predefined layer names for keyboards: +* **_BASE**: Default Layer, QWERTY layout. +* **_FN1**: Function Layer for 60% and above, and additional macros and shortcuts on 50% and below. +* **_LOWER** and **_RAISE**: Function layers for 40% + +and macropads: +* **_REEDER**: Shortcuts for [Reeder.app](https://reederapp.com/), my RSS feed reader +* **_MEDIA**: Media controls +* **_NAVI**: Navigation macros, for changing tabs and scrolling +* **_KARABINER**: Generic macro keys, meant to be customized per app with [Karabiner](https://pqrs.org/osx/karabiner/) + +#### Protected Layers +I have some named "protected" layers, meant to be at the end of the layer list for changing keyboard settings and features. + +* **KEYMAP_LAYERS**: Add additional layers in keymap. +* **_AUDIO**: Audio feature controls. +* **_LIGHT**: RGB Light/Matrix feature controls. +* **_ADJUST**: General keyboard settings and toggles. Can also contain RGB and Audio controls on larger boards that don't need and extra layer for those controls. + +### EEPROM User Config + +I have a custom userspace config implemented to save settings on the board to persist across shutdowns. I currently store: + +* rgb_layer_change - a toggle for using RGB themes for layer indication +* rgb_theme - a pointer to the currently set RGB Theme + +### Process Handlers + +### Keycode Aliases + +I am a macOS user and so a lot of my aliases are + +### Macros + + +## Tap Dances + +### Tap Dance Trigger Layer + +## RGB +### RGB Theme diff --git a/users/brandonschlack/rgb_bs.c b/users/brandonschlack/rgb_bs.c new file mode 100644 index 000000000000..1abf785b494f --- /dev/null +++ b/users/brandonschlack/rgb_bs.c @@ -0,0 +1,146 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 "brandonschlack.h" +#include "rgb_theme.h" +#include "rgb_bs.h" + +#if defined(RGBLIGHT_ENABLE) +extern rgblight_config_t rgblight_config; +#elif defined(RGB_MATRIX_ENABLE) +extern rgb_config_t rgb_matrix_config; +extern bool g_suspend_state; +extern led_config_t g_led_config; +#endif + +#if defined(RGB_THEME_ENABLE) +// Should be rgb_theme.c +#define RGB_THEME(name) const rgb_theme_t RGB_##name +#define RGB_THEME_IMPLS +#include "rgb_theme_user.inc" +#undef RGB_THEME_IMPLS +#undef RGB_THEME + +#define RGB_THEME(name) [RGB_THEME_##name] = &RGB_##name, +const rgb_theme_t *themes[] = { + #include "rgb_theme_user.inc" +}; +#undef RGB_THEME + +// Userspace loose colors +rgb_theme_color_t default_adjust = { HSV_SPRINGGREEN }; +#endif + +void keyboard_post_init_rgb(void) { + layer_state_set_user(layer_state); +} + +#if defined(RGB_THEME_ENABLE) +void set_rgb_theme(uint8_t index) { + if (!user_config.rgb_layer_change) { + user_config.rgb_layer_change = true; + } + user_config.rgb_theme = index; + dprintf("rgb theme [EEPROM]: %u\n", user_config.rgb_theme); + eeconfig_update_user(user_config.raw); +} + +rgb_theme_t get_rgb_theme(void) { + return *themes[user_config.rgb_theme]; +} + +void rgb_theme_step(void) { + uint8_t current = user_config.rgb_theme; + current = (current + 1) % RGB_THEME_MAX; + set_rgb_theme(current); +} + +void rgb_theme_step_reverse(void) { + uint8_t current = user_config.rgb_theme; + current = (current - 1) % RGB_THEME_MAX; + set_rgb_theme(current); +} + +rgb_theme_color_t get_rgb_theme_color(uint8_t index) { + rgb_theme_t theme = get_rgb_theme(); + size_t rgb_theme_color_max = sizeof theme.colors / sizeof *theme.colors; + + if (index == _ADJUST) { + return default_adjust; + } else { + return **(theme.colors + (index % rgb_theme_color_max)); + } +}; + +void rgb_theme_layer(layer_state_t state) { + uint8_t rgb_color_index = get_highest_layer(state); + HSV color = get_rgb_theme_color(rgb_color_index); +#if defined(RGBLIGHT_ENABLE) + color.v = rgblight_config.val; +#elif defined(RGB_MATRIX_ENABLE) + color.v = rgb_matrix_config.hsv.v; +#endif + rgb_layer_helper( color.h, color.s, color.v ); +} +#endif + +#ifdef RGB_MATRIX_ENABLE +void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, uint8_t led_type) { + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + if (!HAS_ANY_FLAGS(g_led_config.flags[i], led_type)) { + rgb_matrix_set_color( i, red, green, blue ); + } + } +} + +void rgb_matrix_cycle_flag (void) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: + rgb_matrix_set_flags(LED_FLAG_KEYS); + rgb_matrix_set_color_all(0, 0, 0); + break; + case LED_FLAG_KEYS: + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + break; + case LED_FLAG_UNDERGLOW: + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_set_color_all(0, 0, 0); + break; + default: + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable(); + break; + } +} +#endif + +void rgb_layer_helper(uint8_t hue, uint8_t sat, uint8_t val) { +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + rgblight_sethsv_noeeprom(hue, sat, val); +#ifdef RGB_MATRIX_ENABLE + rgb_matrix_layer_helper(0, 0, 0, rgb_matrix_get_flags()); +#endif +} +#endif + +layer_state_t layer_state_set_rgb(layer_state_t state) { +#if defined(RGB_THEME_ENABLE) + if (user_config.rgb_layer_change) { + rgb_theme_layer(state); + } +#endif // RGBLIGHT_ENABLE + return state; +} diff --git a/users/brandonschlack/rgb_bs.h b/users/brandonschlack/rgb_bs.h new file mode 100644 index 000000000000..c5cbd59697b4 --- /dev/null +++ b/users/brandonschlack/rgb_bs.h @@ -0,0 +1,35 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 +#include "quantum.h" +#ifdef RGB_THEME_ENABLE +# include "rgb_theme.h" +#endif +#ifdef RGB_MATRIX_ENABLE +# include "rgb_matrix.h" +#endif + +#ifdef RGB_MATRIX_ENABLE +#define LED_FLAG_KEYS (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER) + +void rgb_matrix_layer_helper(uint8_t red, uint8_t green, uint8_t blue, uint8_t led_type); +void rgb_matrix_cycle_flag(void); +#endif + +void keyboard_post_init_rgb(void); +void rgb_layer_helper(uint8_t hue, uint8_t sat, uint8_t val); + +layer_state_t layer_state_set_rgb(layer_state_t state); diff --git a/users/brandonschlack/rgb_theme.h b/users/brandonschlack/rgb_theme.h new file mode 100644 index 000000000000..7c8b2923fccf --- /dev/null +++ b/users/brandonschlack/rgb_theme.h @@ -0,0 +1,51 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 + +#include "brandonschlack.h" +#include "color.h" +#include "rgblight_list.h" + +/*TODO Update as RGBLIGHT Mode */ +#ifndef RGB_THEME_COLORS_MAX +#define RGB_THEME_COLORS_MAX 5 +#endif + +enum rgb_themes { +#define RGB_THEME(name) RGB_THEME_##name, + #include "rgb_theme_user.inc" +#undef RGB_THEME + RGB_THEME_MAX +}; + +// RGB Theme Color +typedef const HSV rgb_theme_color_t; +#define RGB_THEME_COLOR(tname, tcolor,...) rgb_theme_color_t tname ## _ ## tcolor = { __VA_ARGS__ } + +// RGB Theme +typedef struct { + const HSV *colors[RGB_THEME_COLORS_MAX]; +} rgb_theme_t; +extern const rgb_theme_t *themes[]; + +void set_rgb_theme(uint8_t index); +rgb_theme_t get_rgb_theme(void); + +void rgb_theme_step(void); +void rgb_theme_step_reverse(void); + +rgb_theme_color_t get_rgb_theme_color(uint8_t index); +void rgb_theme_layer(layer_state_t state); diff --git a/users/brandonschlack/rgb_theme_user.inc b/users/brandonschlack/rgb_theme_user.inc new file mode 100644 index 000000000000..a07e62b7896a --- /dev/null +++ b/users/brandonschlack/rgb_theme_user.inc @@ -0,0 +1,95 @@ +// Basic Theme +#ifndef DISABLE_RGB_THEME_BASIC +#ifndef RGB_THEME_IMPLS +RGB_THEME(BASIC) +#else +RGB_THEME_COLOR(BASIC, WHITE, HSV_WHITE); +RGB_THEME_COLOR(BASIC, BLUE, HSV_BLUE); +RGB_THEME_COLOR(BASIC, RED, HSV_RED); +RGB_THEME_COLOR(BASIC, GREEN, HSV_GREEN); +RGB_THEME_COLOR(BASIC, YELLOW, HSV_YELLOW); +RGB_THEME(BASIC) = { { &BASIC_WHITE, &BASIC_BLUE, &BASIC_RED, &BASIC_GREEN, &BASIC_YELLOW } }; +#endif // RGB_THEME_IMPLS +#endif // DISABLE_RGB_THEME_BASIC + +// Laser Theme +#ifndef DISABLE_RGB_THEME_LASER +#ifndef RGB_THEME_IMPLS +RGB_THEME(LASER) +#else +RGB_THEME_COLOR(LASER, PURPLE, 191, 255, 255); +RGB_THEME_COLOR(LASER, PINK, 237, 255, 255); +RGB_THEME_COLOR(LASER, BLUE, 165, 255, 255); +RGB_THEME_COLOR(LASER, CYAN, 133, 255, 255); +RGB_THEME_COLOR(LASER, MAGENTA, 213, 255, 255); +RGB_THEME(LASER) = { { &LASER_PURPLE, &LASER_PINK, &LASER_BLUE, &LASER_CYAN, &LASER_MAGENTA } }; +#endif // RGB_THEME_IMPLS +#endif // DISABLE_RGB_THEME_LASER + +// Metropolis Theme +#ifndef DISABLE_RGB_THEME_METROPOLIS +#ifndef RGB_THEME_IMPLS +RGB_THEME(METROPOLIS) +#else +RGB_THEME_COLOR(METROPOLIS, TEAL, 96, 207, 255); +RGB_THEME_COLOR(METROPOLIS, RED, HSV_RED); +RGB_THEME_COLOR(METROPOLIS, YELLOW, 24, 255, 255); +RGB_THEME_COLOR(METROPOLIS, BLUE, 168, 255, 255); +RGB_THEME_COLOR(METROPOLIS, WHITE, HSV_WHITE); +RGB_THEME(METROPOLIS) = { { &METROPOLIS_TEAL, &METROPOLIS_RED, &METROPOLIS_YELLOW, &METROPOLIS_BLUE, &METROPOLIS_WHITE } }; +#endif // RGB_THEME_IMPLS +#endif // DISABLE_RGB_THEME_METROPOLIS + +// Canvas Theme +#ifndef DISABLE_RGB_THEME_CANVAS +#ifndef RGB_THEME_IMPLS +RGB_THEME(CANVAS) +#else +RGB_THEME_COLOR(CANVAS, WHITE, HSV_WHITE); +RGB_THEME_COLOR(CANVAS, ORANGE, 10, 255, 255); +RGB_THEME_COLOR(CANVAS, RED, 0, 231, 255); +RGB_THEME_COLOR(CANVAS, GREEN, 74, 207, 255); +RGB_THEME_COLOR(CANVAS, BLUE, 170, 135, 255); +RGB_THEME(CANVAS) = { { &CANVAS_WHITE, &CANVAS_ORANGE, &CANVAS_RED, &CANVAS_GREEN, &CANVAS_BLUE } }; +#endif // RGB_THEME_IMPLS +#endif // DISABLE_RGB_THEME_CANVAS + +// Jamon Theme +#ifndef DISABLE_RGB_THEME_JAMON +#ifndef RGB_THEME_IMPLS +RGB_THEME(JAMON) +#else +RGB_THEME_COLOR(JAMON, RED, HSV_RED); +RGB_THEME_COLOR(JAMON, LIGHTRED, 4, 255, 255); +RGB_THEME_COLOR(JAMON, WHITE, HSV_WHITE); +RGB_THEME_COLOR(JAMON, YELLOW, HSV_GOLD); +RGB_THEME(JAMON) = { { &JAMON_RED, &JAMON_LIGHTRED, &JAMON_WHITE, &JAMON_YELLOW } }; +#endif // RGB_THEME_IMPLS +#endif // DISABLE_RGB_THEME_JAMON + +// Striker Theme +#ifndef DISABLE_RGB_THEME_STRIKER +#ifndef RGB_THEME_IMPLS +RGB_THEME(STRIKER) +#else +RGB_THEME_COLOR(STRIKER, BLUE, HSV_BLUE); +RGB_THEME_COLOR(STRIKER, AZURE, HSV_AZURE); +RGB_THEME_COLOR(STRIKER, WHITE, HSV_WHITE); +RGB_THEME_COLOR(STRIKER, RED, HSV_RED); +RGB_THEME(STRIKER) = { { &STRIKER_BLUE, &STRIKER_AZURE, &STRIKER_WHITE, &STRIKER_RED } }; +#endif // RGB_THEME_IMPLS +#endif // DISABLE_RGB_THEME_STRIKER + +// Oblique Theme +#ifndef DISABLE_RGB_THEME_OBLIQUE +#ifndef RGB_THEME_IMPLS +RGB_THEME(OBLIQUE) +#else +RGB_THEME_COLOR(OBLIQUE, WHITE, HSV_WHITE); +RGB_THEME_COLOR(OBLIQUE, PURPLE, 186, 143, 255); +RGB_THEME_COLOR(OBLIQUE, RED, 10, 200, 255); +RGB_THEME_COLOR(OBLIQUE, ORANGE, 26, 215, 255); +RGB_THEME_COLOR(OBLIQUE, GREEN, 58, 199, 255); +RGB_THEME(OBLIQUE) = { { &OBLIQUE_WHITE, &OBLIQUE_PURPLE, &OBLIQUE_RED, &OBLIQUE_ORANGE, &OBLIQUE_GREEN } }; +#endif // RGB_THEME_IMPLS +#endif // DISABLE_RGB_THEME_OBLIQUE diff --git a/users/brandonschlack/rules.mk b/users/brandonschlack/rules.mk new file mode 100644 index 000000000000..2dfc332ab951 --- /dev/null +++ b/users/brandonschlack/rules.mk @@ -0,0 +1,34 @@ +SRC += brandonschlack.c \ + process_records.c + +SPACE_CADET_ENABLE = no + +# Use LTO except for ChibiOS +ifneq ($(PLATFORM),CHIBIOS) + LTO_ENABLE = yes +endif + +ifeq ($(strip $(IS_MACROPAD)), yes) + OPT_DEFS += -DIS_MACROPAD +endif + +ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) + SRC += rgb_bs.c +endif + +RGB_MATRIX_ENABLE ?= no +ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) + SRC += rgb_bs.c +endif + +ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) + SRC += tap_dances.c +endif + +ifeq ($(strip $(FLASH_BOOTLOADER)), yes) + OPT_DEFS += -DFLASH_BOOTLOADER +endif + +ifneq ($(FORCE_LAYOUT),) + OPT_DEFS += -DFORCE_LAYOUT=\"$(FORCE_LAYOUT)\" +endif diff --git a/users/brandonschlack/tap_dances.c b/users/brandonschlack/tap_dances.c new file mode 100644 index 000000000000..861b31805b67 --- /dev/null +++ b/users/brandonschlack/tap_dances.c @@ -0,0 +1,91 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 "tap_dances.h" +#include "process_keycode/process_tap_dance.h" + +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) return SINGLE_TAP; + else return SINGLE_HOLD; + } else if (state->count == 2) { + if (state->interrupted) return DOUBLE_SINGLE_TAP; + else if (state->pressed) return DOUBLE_HOLD; + else return DOUBLE_TAP; + } + if (state->count == 3) { + if (state->interrupted || !state->pressed) return TRIPLE_TAP; + else return TRIPLE_HOLD; + } + else return 8; +} + +__attribute__ ((weak)) +void process_tap_dance_keycode (bool reset, uint8_t toggle_layer) { }; + +void td_trigger_layer_finished (qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_trigger_layer_t *data = (qk_tap_dance_trigger_layer_t *)user_data; + data->state = cur_dance(state); + + if (data->state == data->trigger) { + layer_on(data->layer); + } else { + process_tap_dance_keycode(false, data->layer); + } + +} +void td_trigger_layer_reset (qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_trigger_layer_t *data = (qk_tap_dance_trigger_layer_t *)user_data; + if (data->state == data->trigger) { + switch (data->trigger) { + case SINGLE_HOLD: + case DOUBLE_HOLD: + case TRIPLE_HOLD: + layer_off(data->layer); + break; + } + } else { + process_tap_dance_keycode(true, data->layer); + } + data->state = 0; +} + +/* Tap Dance: Layer Mod. Toggles Layer when tapped, Mod when held. */ +void td_layer_mod_each(qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; + + // Single tap → toggle layer, Single hold → mod + if (state->pressed) { + register_code(data->kc); + } else if (state->count == 1) { + state->finished = true; + } +} + +void td_layer_mod_finished(qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; + + if (state->count == 1 && !state->pressed) { + layer_invert(data->layer); + } +} + +void td_layer_mod_reset(qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; + + if (state->count == 1) { + unregister_code(data->kc); + } +} diff --git a/users/brandonschlack/tap_dances.h b/users/brandonschlack/tap_dances.h new file mode 100644 index 000000000000..3747619a5ef4 --- /dev/null +++ b/users/brandonschlack/tap_dances.h @@ -0,0 +1,52 @@ +/* Copyright 2020 Brandon Schlack + * + * 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 +#include "brandonschlack.h" +#ifdef TAP_DANCE_ENABLE +# include "process_keycode/process_tap_dance.h" +#endif + +enum tap_dance_states { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + DOUBLE_SINGLE_TAP = 5, + TRIPLE_TAP = 6, + TRIPLE_HOLD = 7 +}; + +int cur_dance (qk_tap_dance_state_t *state); +void process_tap_dance_keycode (bool reset, uint8_t toggle_layer); + +/* Tap Dance: Trigger Layer + * + * Toggles Layer based on given trigger (Single Hold, Double Tap, Double Hold, etc). + * Uses process_tap_dance_keycode() to allow keycode defines based on layer + */ +typedef struct { + uint8_t trigger; + uint8_t layer; + uint8_t state; +} qk_tap_dance_trigger_layer_t; + +#define ACTION_TAP_DANCE_TRIGGER_LAYER(trigger, layer) { \ + .fn = { NULL, td_trigger_layer_finished, td_trigger_layer_reset }, \ + .user_data = (void *)&((qk_tap_dance_trigger_layer_t) { trigger, layer, 0 }), \ +} + +void td_trigger_layer_finished (qk_tap_dance_state_t *state, void *user_data); +void td_trigger_layer_reset (qk_tap_dance_state_t *state, void *user_data);