From 1a070d6f6f0fe20d2b8af93c48770a556ee2d468 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 7 Aug 2017 22:04:37 -0400 Subject: let planck keymaps use KEYMAP --- keyboards/planck/planck.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/planck/planck.h b/keyboards/planck/planck.h index 8cfee5d1cc..10f17b4a46 100644 --- a/keyboards/planck/planck.h +++ b/keyboards/planck/planck.h @@ -36,4 +36,6 @@ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ } +#define KEYMAP PLANCK_GRID + #endif -- cgit v1.2.3 From 107d8031e5dc54d5fe0eb48c82a143a139896b56 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 7 Aug 2017 22:36:05 -0400 Subject: update priyadi's keymap config --- keyboards/handwired/promethium/config.h | 2 +- .../handwired/promethium/keymaps/priyadi/keymap.c | 28 +++++++++++----------- keyboards/planck/keymaps/priyadi/config.h | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/keyboards/handwired/promethium/config.h b/keyboards/handwired/promethium/config.h index efb9ebdd74..ea5f2b76e8 100644 --- a/keyboards/handwired/promethium/config.h +++ b/keyboards/handwired/promethium/config.h @@ -161,7 +161,7 @@ along with this program. If not, see . #define ___ KC_NO -#define KEYMAP( \ +#define KEYMAP_CUSTOM( \ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 763fa5a27a..e229b67e54 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -686,7 +686,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Alt | GUI | Punc | Num | Space | Fun |Greek | GUI |AltGr | Ctrl | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = KEYMAP( +[_QWERTY] = KEYMAP_CUSTOM( KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, 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, @@ -706,7 +706,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ #ifdef LAYOUT_DVORAK -[_DVORAK] = KEYMAP( +[_DVORAK] = KEYMAP_CUSTOM( _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, _______, _______, KC_SLSH, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, @@ -728,7 +728,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ #ifdef LAYOUT_COLEMAK -[_COLEMAK] = KEYMAP( +[_COLEMAK] = KEYMAP_CUSTOM( _______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, _______, _______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, @@ -750,7 +750,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ #ifdef LAYOUT_NORMAN -[_NORMAN] = KEYMAP( +[_NORMAN] = KEYMAP_CUSTOM( _______, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_QUOT, _______, _______, KC_A, KC_S, KC_E, KC_T, KC_G, KC_Y, KC_N, KC_I, KC_O, KC_H, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, @@ -772,7 +772,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ #ifdef LAYOUT_WORKMAN -[_WORKMAN] = KEYMAP( +[_WORKMAN] = KEYMAP_CUSTOM( _______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_QUOT, _______, _______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, _______, _______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______, @@ -792,7 +792,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | : | | * `-----------------------------------------------------------------------------------' */ -[_PUNC] = KEYMAP( +[_PUNC] = KEYMAP_CUSTOM( KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, X(LTEQ), X(GTEQ), _______, KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, X(NOTEQ),KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, _______, KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, X(PLMIN),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______, @@ -811,7 +811,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | x | | | | | 0 | , | . | : | | * `-----------------------------------------------------------------------------------' */ -[_NUM] = KEYMAP( +[_NUM] = KEYMAP_CUSTOM( KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_1, KC_2, KC_3, S(KC_D), _______, KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______, KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_7, KC_8, KC_9, S(KC_F), _______, @@ -830,7 +830,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_FUN] = KEYMAP( +[_FUN] = KEYMAP_CUSTOM( XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL, KC_CAPS, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, KC_F9, KC_F10, KC_F11, KC_F12, KC_PAUS, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______, @@ -849,7 +849,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_GREEKU] = KEYMAP( +[_GREEKU] = KEYMAP_CUSTOM( _______, XXXXXXX, XXXXXXX,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______, _______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), KC_QUOT, _______, _______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), KC_COMM, KC_DOT, KC_SLSH, _______, @@ -868,7 +868,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_GREEKL] = KEYMAP( +[_GREEKL] = KEYMAP_CUSTOM( _______, XXXXXXX,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______, _______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), KC_QUOT, _______, _______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), KC_COMM, KC_DOT, KC_SLSH, _______, @@ -887,7 +887,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_EMPTY] = KEYMAP( +[_EMPTY] = KEYMAP_CUSTOM( XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, @@ -906,7 +906,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_EMOJI] = KEYMAP( +[_EMOJI] = KEYMAP_CUSTOM( X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW), X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS), X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH), @@ -925,7 +925,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_GUI] = KEYMAP( +[_GUI] = KEYMAP_CUSTOM( XXXXXXX, G(KC_1), G(KC_2), G(KC_3), G(KC_4), G(KC_5), G(KC_6), G(KC_7), G(KC_8), G(KC_9), G(KC_0), XXXXXXX, KC_ESC, XXXXXXX, S(KC_TAB),KC_ESC, KC_TAB, XXXXXXX, XXXXXXX, KC_WWWB, XXXXXXX, KC_WWWF, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, KC_SPC, KC_SPC, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, @@ -944,7 +944,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_SYS] = KEYMAP( +[_SYS] = KEYMAP_CUSTOM( DEBUG, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, RGBDEMO, XXXXXXX, FC_TOG, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BT, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, diff --git a/keyboards/planck/keymaps/priyadi/config.h b/keyboards/planck/keymaps/priyadi/config.h index adc1c69aa5..448ae3b908 100644 --- a/keyboards/planck/keymaps/priyadi/config.h +++ b/keyboards/planck/keymaps/priyadi/config.h @@ -23,7 +23,7 @@ #define DOUBLESPACE_LAYER_ENABLE // #define TOLELOT_ENABLE -#define KEYMAP( \ +#define KEYMAP_CUSTOM( \ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ -- cgit v1.2.3 From 1219da753bc5475f48b1cfe420bd916aa399fc60 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Sat, 5 Aug 2017 00:58:10 -0700 Subject: Initial nyquist keymap --- keyboards/nyquist/keymaps/333fred/Makefile | 3 + keyboards/nyquist/keymaps/333fred/config.h | 34 +++++ keyboards/nyquist/keymaps/333fred/keymap.c | 218 +++++++++++++++++++++++++++++ 3 files changed, 255 insertions(+) create mode 100644 keyboards/nyquist/keymaps/333fred/Makefile create mode 100644 keyboards/nyquist/keymaps/333fred/config.h create mode 100644 keyboards/nyquist/keymaps/333fred/keymap.c diff --git a/keyboards/nyquist/keymaps/333fred/Makefile b/keyboards/nyquist/keymaps/333fred/Makefile new file mode 100644 index 0000000000..457a3d01d4 --- /dev/null +++ b/keyboards/nyquist/keymaps/333fred/Makefile @@ -0,0 +1,3 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/nyquist/keymaps/333fred/config.h b/keyboards/nyquist/keymaps/333fred/config.h new file mode 100644 index 0000000000..f2408c0e3e --- /dev/null +++ b/keyboards/nyquist/keymaps/333fred/config.h @@ -0,0 +1,34 @@ +/* +Copyright 2017 Danny Nguyen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define _MASTER_RIGHT +// #define EE_HANDS + +#endif diff --git a/keyboards/nyquist/keymaps/333fred/keymap.c b/keyboards/nyquist/keymaps/333fred/keymap.c new file mode 100644 index 0000000000..74a12c54ad --- /dev/null +++ b/keyboards/nyquist/keymaps/333fred/keymap.c @@ -0,0 +1,218 @@ +#include "nyquist.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _VIM 5 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +enum custom_macros { + DLEFT, + DRIGHT, + PSCREEN_APP +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D |LTVIMF| G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . |/ Ctrl| Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower | Bksp | Ent | Spc | Raise| + | Up | Del | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, \ + KC_ESC, KC_A, KC_S, KC_D, LT(_VIM, KC_F), KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), OSM(MOD_RSFT), \ + ADJUST, KC_LCTL, KC_LGUI, KC_LALT, OSL(_LOWER), KC_BSPC, KC_ENT, KC_SPC, RAISE, KC_PLUS, KC_UP, KC_DEL \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | ! | @ | ( | ) | | | 7 | 8 | 9 | * | ) | F12 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | # | $ | { | } | ` | 4 | 5 | 6 | + | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | APscr| % | ^ | [ | ] | ~ | 1 | 2 | 3 | \ | Vol- | Vol+ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Pscr | | | | | | 0 | . | = | Prev | Next | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = KEYMAP( \ + KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \ + _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, KC_7, KC_8, KC_9, KC_ASTR, KC_RPRN, KC_F12, \ + _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, KC_4, KC_5, KC_6, KC_PLUS, KC_RCBR, KC_PIPE, \ + M(PSCREEN_APP), KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_1, KC_2, KC_3, KC_BSLS, KC_VOLD, KC_VOLU, \ + KC_PSCR, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_EQL, KC_MPRV, KC_MNXT, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | { | } | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = KEYMAP( \ + 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_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_LCBR, KC_RBRC, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = KEYMAP( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | DLeft|DRight| LCTRL| | | Left | Down | Up | Right| | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | LShft| | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_VIM] = KEYMAP( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, M(DLEFT), M(DRIGHT), KC_LCTL, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______ \ +) + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch(id) { + case DLEFT: + if (record->event.pressed) { // Windows move desktop left + return MACRO(D(LCTL), D(LGUI), T(LEFT), U(LGUI), U(LCTL), END); + } + break; + case DRIGHT: + if (record->event.pressed) { // Windows move desktop right + return MACRO(D(LCTL), D(LGUI), T(RIGHT), U(LGUI), U(LCTL), END); + } + break; + case PSCREEN_APP: + if (record->event.pressed) { + return MACRO(D(LALT), T(PSCR), U(LALT), END); + } + break; + } + return MACRO_NONE; +} -- cgit v1.2.3 From fb91d9008b051c4af5b8ff8952a02836061b8e60 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Sat, 5 Aug 2017 14:54:16 -0700 Subject: Additional keymap updates. --- keyboards/nyquist/keymaps/333fred/config.h | 5 +++++ keyboards/nyquist/keymaps/333fred/keymap.c | 20 +++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/keyboards/nyquist/keymaps/333fred/config.h b/keyboards/nyquist/keymaps/333fred/config.h index f2408c0e3e..92096eba2e 100644 --- a/keyboards/nyquist/keymaps/333fred/config.h +++ b/keyboards/nyquist/keymaps/333fred/config.h @@ -31,4 +31,9 @@ along with this program. If not, see . // #define _MASTER_RIGHT // #define EE_HANDS +#undef TAPPING_TERM +#define TAPPING_TERM 150 + +#define PERMISSIVE_HOLD + #endif diff --git a/keyboards/nyquist/keymaps/333fred/keymap.c b/keyboards/nyquist/keymaps/333fred/keymap.c index 74a12c54ad..afa8b75b65 100644 --- a/keyboards/nyquist/keymaps/333fred/keymap.c +++ b/keyboards/nyquist/keymaps/333fred/keymap.c @@ -9,11 +9,9 @@ extern keymap_config_t keymap_config; // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. #define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _VIM 5 +#define _LOWER 1 +#define _RAISE 2 +#define _VIM 3 #define _ADJUST 16 enum custom_keycodes { @@ -45,15 +43,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Z | X | C | V | B | N | M | , | . |/ Ctrl| Shift| * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower | Bksp | Ent | Spc | Raise| + | Up | Del | + * | Ctrl | Alt | F4 | GUI |Lower | Bksp | Spc | Ent | Raise| + | Up | Del | * `-----------------------------------------------------------------------------------' */ [_QWERTY] = KEYMAP( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, \ - KC_ESC, KC_A, KC_S, KC_D, LT(_VIM, KC_F), KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), OSM(MOD_RSFT), \ - ADJUST, KC_LCTL, KC_LGUI, KC_LALT, OSL(_LOWER), KC_BSPC, KC_ENT, KC_SPC, RAISE, KC_PLUS, KC_UP, KC_DEL \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, \ + KC_ESC, KC_A, KC_S, KC_D, LT(_VIM, KC_F), KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), OSM(MOD_RSFT), \ + KC_LCTL, KC_LALT, KC_F4, KC_LGUI, OSL(_LOWER), KC_BSPC, KC_SPC, KC_ENT, RAISE, KC_PLUS, KC_UP, KC_DEL \ ), /* Lower -- cgit v1.2.3 From b66a9af3526d27764c85115dcc8375a031aa361f Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Sat, 5 Aug 2017 15:34:14 -0700 Subject: Finished initial Nyquist keymap. --- keyboards/nyquist/keymaps/333fred/keymap.c | 131 ++++++----------------------- 1 file changed, 27 insertions(+), 104 deletions(-) diff --git a/keyboards/nyquist/keymaps/333fred/keymap.c b/keyboards/nyquist/keymaps/333fred/keymap.c index afa8b75b65..d3a347803e 100644 --- a/keyboards/nyquist/keymaps/333fred/keymap.c +++ b/keyboards/nyquist/keymaps/333fred/keymap.c @@ -10,16 +10,8 @@ extern keymap_config_t keymap_config; // entirely and just use numbers. #define _QWERTY 0 #define _LOWER 1 -#define _RAISE 2 -#define _VIM 3 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, -}; +#define _VIM 2 +#define _GAME 3 enum custom_macros { DLEFT, @@ -43,7 +35,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Z | X | C | V | B | N | M | , | . |/ Ctrl| Shift| * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | F4 | GUI |Lower | Bksp | Spc | Ent | Raise| + | Up | Del | + * | Ctrl | Alt | F4 | GUI |Lower | Bksp | Spc | Ent | Alt | + | Game | Del | * `-----------------------------------------------------------------------------------' */ [_QWERTY] = KEYMAP( \ @@ -51,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, \ KC_ESC, KC_A, KC_S, KC_D, LT(_VIM, KC_F), KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), OSM(MOD_RSFT), \ - KC_LCTL, KC_LALT, KC_F4, KC_LGUI, OSL(_LOWER), KC_BSPC, KC_SPC, KC_ENT, RAISE, KC_PLUS, KC_UP, KC_DEL \ + KC_LCTL, KC_LALT, KC_F4, KC_LGUI, OSL(_LOWER), KC_BSPC, KC_SPC, KC_ENT, KC_RALT, KC_PLUS, TG(_GAME), KC_DEL \ ), /* Lower @@ -75,49 +67,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_PSCR, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_EQL, KC_MPRV, KC_MNXT, KC_MPLY \ ), -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | { | } | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = KEYMAP( \ - 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_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - KC_DEL, KC_F1, KC_F2, KC_LCBR, KC_RBRC, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = KEYMAP( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -), - -/* Adjust (Lower + Raise) +/* Vim Movement (Hold down F) * ,-----------------------------------------------------------------------------------. * | | | | | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -136,64 +86,37 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, M(DLEFT), M(DRIGHT), KC_LCTL, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* Gaming mode (Raise) + * All one-shot mods are disabled on this layer + * ,-----------------------------------------------------------------------------------. + * | ESC | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | CTRL | | | | F | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Enter| | | | Alt | Spc | Left | Up | Down | Right| | | + * `-----------------------------------------------------------------------------------' + */ +[_GAME] = KEYMAP( \ + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LCTL, _______, _______, _______, KC_F, _______, _______, _______, _______, _______, _______, _______, \ + KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_ENT, _______, _______, _______, KC_LALT, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______ \ ) }; -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_qwerty, false, 0); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { switch(id) { case DLEFT: -- cgit v1.2.3 From 8cb413b6b708ecafbccf553876cac51d5f999588 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Sat, 5 Aug 2017 15:40:19 -0700 Subject: Updated licensing --- keyboards/nyquist/keymaps/333fred/config.h | 25 ------------------------- keyboards/nyquist/keymaps/333fred/keymap.c | 4 ---- 2 files changed, 29 deletions(-) diff --git a/keyboards/nyquist/keymaps/333fred/config.h b/keyboards/nyquist/keymaps/333fred/config.h index 92096eba2e..86fe521654 100644 --- a/keyboards/nyquist/keymaps/333fred/config.h +++ b/keyboards/nyquist/keymaps/333fred/config.h @@ -1,35 +1,10 @@ -/* -Copyright 2017 Danny Nguyen - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - #ifndef CONFIG_USER_H #define CONFIG_USER_H #include "../../config.h" -/* Use I2C or Serial, not both */ - #define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - #define MASTER_LEFT -// #define _MASTER_RIGHT -// #define EE_HANDS #undef TAPPING_TERM #define TAPPING_TERM 150 diff --git a/keyboards/nyquist/keymaps/333fred/keymap.c b/keyboards/nyquist/keymaps/333fred/keymap.c index d3a347803e..a2bb74ca2d 100644 --- a/keyboards/nyquist/keymaps/333fred/keymap.c +++ b/keyboards/nyquist/keymaps/333fred/keymap.c @@ -4,10 +4,6 @@ extern keymap_config_t keymap_config; -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. #define _QWERTY 0 #define _LOWER 1 #define _VIM 2 -- cgit v1.2.3 From 7a9fb7c96b876cf0d6c44c4649d3504572e56fa3 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Sat, 5 Aug 2017 16:16:38 -0700 Subject: Added readme, fixed eql vs plus --- keyboards/nyquist/keymaps/333fred/README.md | 76 +++++++++++++++++++++++++++++ keyboards/nyquist/keymaps/333fred/keymap.c | 10 ++-- 2 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 keyboards/nyquist/keymaps/333fred/README.md diff --git a/keyboards/nyquist/keymaps/333fred/README.md b/keyboards/nyquist/keymaps/333fred/README.md new file mode 100644 index 0000000000..a25f9fcece --- /dev/null +++ b/keyboards/nyquist/keymaps/333fred/README.md @@ -0,0 +1,76 @@ +# 333fred's Nyquist Layout + +This nyquist layout is based on my Ergodox Infinity Layout, which is [here](../../../ergodox/keymaps/333fred/README.md). It doesn't have all of my VS extensions, as I have my nyquist at home, not at work. + +## Layers + +### QWERTY +The shift modifiers on this layer all use OSM to allow for quick single capitalization. Press and hold F to go to the VIM movement layer. Layer is also a one-shot layer toggle, and can be held down to type multiple characters on the Lower layer. Game is a regular toggle layer. + +``` +Qwerty +,-----------------------------------------------------------------------------------. +| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Tab | Q | W | E | R | T | Y | U | I | O | P | \ | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Esc | A | S | D |LTVIMF| G | H | J | K | L | ; | " | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Z | X | C | V | B | N | M | , | . |/ Ctrl| Shift| +|------+------+------+------+------+------+------+------+------+------+------+------| +| Ctrl | Alt | F4 | GUI |Lower | Bksp | Spc | Ent | Alt | = | Game | Del r +`-----------------------------------------------------------------------------------' +``` + +### Lower +My symbol and numpad layer. APscr is a macro that sends ALT+PRSC, to take a screenshot of the current application. + +``` +Lower +,-----------------------------------------------------------------------------------. +| Caps | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | ! | @ | ( | ) | | | 7 | 8 | 9 | * | ) | F12 | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | # | $ | { | } | ` | 4 | 5 | 6 | + | } | | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| APscr| % | ^ | [ | ] | ~ | 1 | 2 | 3 | \ | Vol- | Vol+ | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Pscr | | | | | | 0 | . | = | Prev | Next | Play | +`-----------------------------------------------------------------------------------' +``` + +### VIM Movement +Pressing and holding F moves to this layer, which turns hjkl into vim movement keys. a and d are macros which send WIN+Left and WIN+Right, respectively. Shift and CTRL have been remapped for ease of selecting text. +``` +Vim Movement (Hold down F) +,-----------------------------------------------------------------------------------. +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | DLeft|DRight| LCTRL| | | Left | Down | Up | Right| | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | LShft| | | | | | | | +`-----------------------------------------------------------------------------------' + ``` + +### Gaming +This layer is designed for playing games. All one-shot modification has been turned off, and the common game controls keys have been moved around for easier access. +``` +Gaming mode (Raise) +All one-shot mods are disabled on this layer +,-----------------------------------------------------------------------------------. +| ESC | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| CTRL | | | | F | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Shift| Z | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Enter| | | | Alt | Spc | Left | Up | Down | Right| | | +`-----------------------------------------------------------------------------------' +``` diff --git a/keyboards/nyquist/keymaps/333fred/keymap.c b/keyboards/nyquist/keymaps/333fred/keymap.c index a2bb74ca2d..07434d93fa 100644 --- a/keyboards/nyquist/keymaps/333fred/keymap.c +++ b/keyboards/nyquist/keymaps/333fred/keymap.c @@ -35,11 +35,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_QWERTY] = KEYMAP( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, \ - KC_ESC, KC_A, KC_S, KC_D, LT(_VIM, KC_F), KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), OSM(MOD_RSFT), \ - KC_LCTL, KC_LALT, KC_F4, KC_LGUI, OSL(_LOWER), KC_BSPC, KC_SPC, KC_ENT, KC_RALT, KC_PLUS, TG(_GAME), KC_DEL \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, \ + KC_ESC, KC_A, KC_S, KC_D, LT(_VIM, KC_F), KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), OSM(MOD_RSFT), \ + KC_LCTL, KC_LALT, KC_F4, KC_LGUI, OSL(_LOWER), KC_BSPC, KC_SPC, KC_ENT, KC_RALT, KC_EQL, TG(_GAME), KC_DEL \ ), /* Lower -- cgit v1.2.3 From 8e1be7c792c4c9f65ba7e990f2a773a23b40d20c Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Sun, 6 Aug 2017 01:50:20 -0700 Subject: Initial implementation of the key_lock feature. --- common_features.mk | 7 +- keyboards/nyquist/keymaps/333fred/Makefile | 2 + keyboards/nyquist/keymaps/333fred/keymap.c | 2 +- quantum/process_keycode/process_key_lock.c | 120 +++++++++++++++++++++++++++++ quantum/process_keycode/process_key_lock.h | 24 ++++++ quantum/quantum.c | 4 + quantum/quantum.h | 4 + quantum/quantum_keycodes.h | 4 + 8 files changed, 165 insertions(+), 2 deletions(-) create mode 100644 quantum/process_keycode/process_key_lock.c create mode 100644 quantum/process_keycode/process_key_lock.h diff --git a/common_features.mk b/common_features.mk index 0adf81afac..f405d5c07b 100644 --- a/common_features.mk +++ b/common_features.mk @@ -104,6 +104,11 @@ ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c endif +ifeq ($(strip $(KEY_LOCK_ENABLE)), yes) + OPT_DEFS += -DKEY_LOCK_ENABLE + SRC += $(QUANTUM_DIR)/process_keycode/process_key_lock.c +endif + ifeq ($(strip $(PRINTING_ENABLE)), yes) OPT_DEFS += -DPRINTING_ENABLE SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c @@ -156,4 +161,4 @@ QUANTUM_SRC:= \ ifndef CUSTOM_MATRIX QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c -endif \ No newline at end of file +endif diff --git a/keyboards/nyquist/keymaps/333fred/Makefile b/keyboards/nyquist/keymaps/333fred/Makefile index 457a3d01d4..471eac8b5e 100644 --- a/keyboards/nyquist/keymaps/333fred/Makefile +++ b/keyboards/nyquist/keymaps/333fred/Makefile @@ -1,3 +1,5 @@ +KEY_LOCK_ENABLE = yes + ifndef QUANTUM_DIR include ../../../../Makefile endif diff --git a/keyboards/nyquist/keymaps/333fred/keymap.c b/keyboards/nyquist/keymaps/333fred/keymap.c index 07434d93fa..20bf298876 100644 --- a/keyboards/nyquist/keymaps/333fred/keymap.c +++ b/keyboards/nyquist/keymaps/333fred/keymap.c @@ -39,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, \ KC_ESC, KC_A, KC_S, KC_D, LT(_VIM, KC_F), KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), OSM(MOD_RSFT), \ - KC_LCTL, KC_LALT, KC_F4, KC_LGUI, OSL(_LOWER), KC_BSPC, KC_SPC, KC_ENT, KC_RALT, KC_EQL, TG(_GAME), KC_DEL \ + KC_LCTL, KC_LALT, KC_F4, KC_LGUI, OSL(_LOWER), KC_BSPC, KC_SPC, KC_ENT, KC_LOCK, KC_EQL, TG(_GAME), KC_DEL \ ), /* Lower diff --git a/quantum/process_keycode/process_key_lock.c b/quantum/process_keycode/process_key_lock.c new file mode 100644 index 0000000000..60b0fcd9b1 --- /dev/null +++ b/quantum/process_keycode/process_key_lock.c @@ -0,0 +1,120 @@ +/* Copyright 2017 Fredric Silberberg + * + * 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 "inttypes.h" +#include "stdint.h" +#include "process_key_lock.h" + +#define SHIFT(shift) (((uint64_t)1) << (shift)) +#define GET_KEY_ARRAY(code) (((code) < 0x40) ? key_state[0] : \ + ((code) < 0x80) ? key_state[1] : \ + ((code) < 0xC0) ? key_state[2] : key_state[3]) +#define GET_CODE_INDEX(code) (((code) < 0x40) ? (code) : \ + ((code) < 0x80) ? (code) - 0x40 : \ + ((code) < 0xC0) ? (code) - 0x80 : (code) - 0xC0) +#define KEY_STATE(code) (GET_KEY_ARRAY(code) & SHIFT(GET_CODE_INDEX(code))) == SHIFT(GET_CODE_INDEX(code)) +#define SET_KEY_ARRAY_STATE(code, val) do { \ + switch (code) { \ + case 0x00 ... 0x3F: \ + key_state[0] = (val); \ + break; \ + case 0x40 ... 0x7F: \ + key_state[1] = (val); \ + break; \ + case 0x80 ... 0xBF: \ + key_state[2] = (val); \ + break; \ + case 0xC0 ... 0xFF: \ + key_state[3] = (val); \ + break; \ + } \ +} while(0) +#define SET_KEY_STATE(code) SET_KEY_ARRAY_STATE(code, (GET_KEY_ARRAY(code) | SHIFT(GET_CODE_INDEX(code)))) +#define UNSET_KEY_STATE(code) SET_KEY_ARRAY_STATE(code, (GET_KEY_ARRAY(code)) & ~(SHIFT(GET_CODE_INDEX(code)))) +#define IS_STANDARD_KEYCODE(code) ((code) <= 0xFF) +#define print_hex64(num) do { print_hex32((num & 0xFFFFFFFF00000000) >> 32); print_hex32(num & 0x00000000FFFFFFFF); } while (0) + +// Locked key state. This is an array of 256 bits, one for each of the standard keys supported qmk. +uint64_t key_state[4] = { 0x0, 0x0, 0x0, 0x0 }; +bool watching = false; + +bool process_key_lock(uint16_t keycode, keyrecord_t *record) { + // We start by categorizing the keypress event. In the event of a down + // event, there are several possibilities: + // 1. The key is not being locked, and we are not watching for new keys. + // In this case, we bail immediately. This is the common case for down events. + // 2. The key was locked, and we need to unlock it. In this case, we will + // reset the state in our map and return false. When the user releases the + // key, the up event will no longer be masked and the OS will observe the + // released key. + // 3. KC_LOCK was just pressed. In this case, we set up the state machine + // to watch for the next key down event, and finish processing + // 4. The keycode is below 0xFF, and we are watching for new keys. In this case, + // we will send the key down event to the os, and set the key_state for that + // key to mask the up event. + // 5. The keycode is above 0xFF, and we're wathing for new keys. In this case, + // the user pressed a key that we cannot "lock", as it's a series of keys, + // or a macro invocation, or a layer transition, or a custom-defined key, or + // or some other arbitrary code. In this case, we bail immediately, reset + // our watch state, and return true. + // + // In the event of an up event, there are these possibilities: + // 1. The key is not being locked. In this case, we return true and bail + // immediately. This is the common case. + // 2. The key is being locked. In this case, we will mask the up event + // by returning false, so the OS never sees that the key was released + // until the user pressed the key again. + if (record->event.pressed) { + // Non-standard keycode, reset and return + if (!(IS_STANDARD_KEYCODE(keycode) || keycode == KC_LOCK)) { + watching = false; + return true; + } + + // If we're already watching, turn off the watch. + if (keycode == KC_LOCK) { + watching = !watching; + return false; + } + + if (IS_STANDARD_KEYCODE(keycode)) { + // We check watching first. This is so that in the following scenario, we continue to + // hold the key: KC_LOCK, KC_F, KC_LOCK, KC_F + // If we checked in reverse order, we'd end up holding the key pressed after the second + // KC_F press is registered, when the user likely meant to hold F + if (watching) { + watching = false; + SET_KEY_STATE(keycode); + // Let the standard keymap send the keycode down event. The up event will be masked. + return true; + } + + if (KEY_STATE(keycode)) { + UNSET_KEY_STATE(keycode); + // The key is already held, stop this process. The up event will be sent when the user + // releases the key. + return false; + } + } + + // Either the key isn't a standard key, or we need to send the down event. Continue standard + // processing + return true; + } else { + // Stop processing if it's a standard key and we're masking up. + return !(IS_STANDARD_KEYCODE(keycode) && KEY_STATE(keycode)); + } +} diff --git a/quantum/process_keycode/process_key_lock.h b/quantum/process_keycode/process_key_lock.h new file mode 100644 index 0000000000..237e103bcd --- /dev/null +++ b/quantum/process_keycode/process_key_lock.h @@ -0,0 +1,24 @@ +/* Copyright 2017 Fredric Silberberg + * + * 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 . + */ + +#ifndef PROCESS_KEY_LOCK_H +#define PROCESS_KEY_LOCK_H + +#include "quantum.h" + +bool process_key_lock(uint16_t keycode, keyrecord_t *record); + +#endif // PROCESS_KEY_LOCK_H diff --git a/quantum/quantum.c b/quantum/quantum.c index 1f8ce6c46f..c71a97bf28 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -193,6 +193,10 @@ bool process_record_quantum(keyrecord_t *record) { // } if (!( + #if defined(KEY_LOCK_ENABLE) + // Must run first to be able to mask key_up events. + process_key_lock(keycode, record) && + #endif process_record_kb(keycode, record) && #if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED) process_midi(keycode, record) && diff --git a/quantum/quantum.h b/quantum/quantum.h index 453cb43f88..9a6d691a15 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -99,6 +99,10 @@ extern uint32_t default_layer_state; #include "process_combo.h" #endif +#ifdef KEY_LOCK_ENABLE + #include "process_key_lock.h" +#endif + #define SEND_STRING(str) send_string(PSTR(str)) extern const bool ascii_to_shift_lut[0x80]; extern const uint8_t ascii_to_keycode_lut[0x80]; diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index acdb9248d6..1bb6706ba4 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -419,6 +419,10 @@ enum quantum_keycodes { OUT_BT, #endif +#ifdef KEY_LOCK_ENABLE + KC_LOCK, +#endif + // always leave at the end SAFE_RANGE }; -- cgit v1.2.3 From 5fc4a664dc0be3f380aba9480b710b9047f29fad Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Sun, 6 Aug 2017 02:09:34 -0700 Subject: Added initial key lock documentation. --- docs/_summary.md | 1 + docs/key_lock.md | 11 +++++++++++ docs/make_instructions.md | 4 ++++ docs/quantum_keycodes.md | 1 + 4 files changed, 17 insertions(+) create mode 100644 docs/key_lock.md diff --git a/docs/_summary.md b/docs/_summary.md index 723377de98..0f65de0dde 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -17,6 +17,7 @@ * [Mouse keys](mouse_keys.md) * [Unicode](unicode.md) * [Stenography](stenography.md) + * [Key Lock](key_lock.md) * Reference * [Glossary](glossary.md) diff --git a/docs/key_lock.md b/docs/key_lock.md new file mode 100644 index 0000000000..03cea20890 --- /dev/null +++ b/docs/key_lock.md @@ -0,0 +1,11 @@ +## Key Lock: Holding down keys for you + +Sometimes, you need to hold down a specific key for a long period of time. Whether this is while typing in ALL CAPS, or playing a video game that hasn't implemented auto-run, Key Lock is here to help. Key Lock adds a new keycode, `KC_LOCK`, that will hold down the next key you hit for you. The key is released when you hit it again. Here's an example: let's say you need to type in all caps for a few sentences. You hit KC_LOCK, and then shift. Now, shift will be considered held until you hit it again. You can think of key lock as caps lock, but supercharged. + +Here's how to use it: + +1. Pick a key on your keyboard. This will be the key lock key. Assign it the keycode `KC_LOCK`. This will be a single-action key: you won't be able to use it for anything else. +2. Enable key lock by including `KEY_LOCK_ENABLE = yes` in your Makefile. +3. That's it! + +Important: switching layers does not cancel the key lock. Additionally, key lock is only able to hold standard action keys. This does not include any of the QMK special functions, or shifted versions of keys such as KC_LPRN. If it's in the [basic_keycodes](basic_keycodes.md) list, it can be held. If it's not, then it can't be. diff --git a/docs/make_instructions.md b/docs/make_instructions.md index 64c1cb0f00..299c5785b2 100644 --- a/docs/make_instructions.md +++ b/docs/make_instructions.md @@ -158,6 +158,10 @@ This enables using the Quantum SYSEX API to send strings (somewhere?) This consumes about 5390 bytes. +`KEY_LOCK_ENABLE` + +This enables [key lock](key_lock.md). This consumes an additional 260 bytes. + ## Customizing Makefile options on a per-keymap basis If your keymap directory has a file called `Makefile` (note the filename), any Makefile options you set in that file will take precedence over other Makefile options for your particular keyboard. diff --git a/docs/quantum_keycodes.md b/docs/quantum_keycodes.md index 36dbda7a9c..f13801ef59 100644 --- a/docs/quantum_keycodes.md +++ b/docs/quantum_keycodes.md @@ -17,6 +17,7 @@ On this page we have documented keycodes between `0x00FF` and `0xFFFF` which are |`FUNC(n)`/`F(n)`|Call `fn_action(n)`| |`M(n)`|to call macro n| |`MACROTAP(n)`|to macro-tap n idk FIXME| +|`KC_LOCK`|The [lock key](key_lock.md)| ## Bootmagic Keycodes -- cgit v1.2.3 From 7935f563e9d078e0f9530576cdccc6cef294345f Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Sun, 6 Aug 2017 13:00:46 -0700 Subject: Updated nyquist gaming layout. --- keyboards/nyquist/keymaps/333fred/README.md | 5 ++--- keyboards/nyquist/keymaps/333fred/keymap.c | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/keyboards/nyquist/keymaps/333fred/README.md b/keyboards/nyquist/keymaps/333fred/README.md index a25f9fcece..96a03ea9b3 100644 --- a/keyboards/nyquist/keymaps/333fred/README.md +++ b/keyboards/nyquist/keymaps/333fred/README.md @@ -18,7 +18,7 @@ Qwerty |------+------+------+------+------+------|------+------+------+------+------+------| | Shift| Z | X | C | V | B | N | M | , | . |/ Ctrl| Shift| |------+------+------+------+------+------+------+------+------+------+------+------| -| Ctrl | Alt | F4 | GUI |Lower | Bksp | Spc | Ent | Alt | = | Game | Del r +| Ctrl | Alt | F4 | GUI |Lower | Bksp | Spc | Ent | Lock | = | Game | Del | `-----------------------------------------------------------------------------------' ``` @@ -61,7 +61,6 @@ Vim Movement (Hold down F) This layer is designed for playing games. All one-shot modification has been turned off, and the common game controls keys have been moved around for easier access. ``` Gaming mode (Raise) -All one-shot mods are disabled on this layer ,-----------------------------------------------------------------------------------. | ESC | | | | | | | | | | | | |------+------+------+------+------+------+------+------+------+------+------+------| @@ -71,6 +70,6 @@ All one-shot mods are disabled on this layer |------+------+------+------+------+------+------+------+------+------+------+------| | Shift| Z | | | | | | | | | | | |------+------+------+------+------+------+------+------+------+------+------+------| -| Enter| | | | Alt | Spc | Left | Up | Down | Right| | | +| Enter| | Lock | | Alt | Spc | Left | Up | Down | Right| | | `-----------------------------------------------------------------------------------' ``` diff --git a/keyboards/nyquist/keymaps/333fred/keymap.c b/keyboards/nyquist/keymaps/333fred/keymap.c index 20bf298876..5d68a2de25 100644 --- a/keyboards/nyquist/keymaps/333fred/keymap.c +++ b/keyboards/nyquist/keymaps/333fred/keymap.c @@ -95,7 +95,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+------+------+------+------+------| * | Shift| Z | | | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Enter| | | | Alt |