From 8c1b8cf3a39773e9b89158f4ff49effcabe729d8 Mon Sep 17 00:00:00 2001 From: Jordan Egstad Date: Mon, 30 Sep 2019 10:55:02 -0700 Subject: [PATCH] [Keymap] Adds Egstad Preonic Profile (#6837) * setup local build config, created npm build script to speed things up * removed some profiles and gutted readme * began configuring default and lower layout * lower: fixed right arrow and added music toggle * began configuring default and lower layout * changed startup song * updated comment typos * I did that thing where i basically refactored everything :) * Converted 2U key to 1U's * Reorganized and tidied up * Reorganized and tidied up * space now changes layers * updated numbpad * updated readme * removed unwanted files * addressed change requests --- keyboards/preonic/keymaps/egstad/config.h | 91 ++++++++ keyboards/preonic/keymaps/egstad/keymap.c | 229 +++++++++++++++++++++ keyboards/preonic/keymaps/egstad/readme.md | 11 + keyboards/preonic/keymaps/egstad/rules.mk | 3 + 4 files changed, 334 insertions(+) create mode 100644 keyboards/preonic/keymaps/egstad/config.h create mode 100644 keyboards/preonic/keymaps/egstad/keymap.c create mode 100644 keyboards/preonic/keymaps/egstad/readme.md create mode 100644 keyboards/preonic/keymaps/egstad/rules.mk diff --git a/keyboards/preonic/keymaps/egstad/config.h b/keyboards/preonic/keymaps/egstad/config.h new file mode 100644 index 000000000..e66743f45 --- /dev/null +++ b/keyboards/preonic/keymaps/egstad/config.h @@ -0,0 +1,91 @@ +#pragma once +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT + + + + + +/* Leader Key + ========================================================================== */ + +// Activates the leader key +// #define LEADER_PER_KEY_TIMING +// resets the timeout after each key is tapped +// #define LEADER_TIMEOUT 240 + + + + + + +/* Autoshifting + ========================================================================== */ + +// This controls how long you have to hold a key before you get the shifted state. +#define AUTO_SHIFT_TIMEOUT 150 + +// Do not Auto Shift special keys -_, =+, [{, ]}, ;:, '", ,<, .>, and /? +// #define NO_AUTO_SHIFT_SPECIAL + +// Do not Auto Shift numeric keys, zero through nine. +#define NO_AUTO_SHIFT_NUMERIC + +// Do not Auto Shift alpha characters, which include A through Z. +// #define NO_AUTO_SHIFT_ALPHA + +// Lower the Auto Shift timeout variable (down) +// KC_ASDN + +// Raise the Auto Shift timeout variable (up) +// KC_ASUP + +// Report your current Auto Shift timeout value +// KC_ASRP + +// Turns on the Auto Shift Function +// KC_ASON + +// Turns off the Auto Shift Function +// KC_ASOFF + +// Toggles the state of the Auto Shift feature +// KC_ASTG + + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(COIN_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_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 + diff --git a/keyboards/preonic/keymaps/egstad/keymap.c b/keyboards/preonic/keymaps/egstad/keymap.c new file mode 100644 index 000000000..07eda6614 --- /dev/null +++ b/keyboards/preonic/keymaps/egstad/keymap.c @@ -0,0 +1,229 @@ +#include QMK_KEYBOARD_H + + + + + + +/* LAYER NAMES + ========================================================================== + 1. To create a layer, define a (readable) name and set layer value + 2. Under "Layer definitions" section, define keymaps + ========================================================================== */ + +enum layer_names { + L_QWERTY, + L_LOWER, + L_RAISE, + L_ADJUST, +}; + + + + +/* TAP DANCE + ========================================================================== + 1. Define TD names here + 2. Register action in tap_dance_actions[] + ========================================================================== */ + +enum { + TD_BRC = 0, + TD_MIN, + TD_GV_ESC, + TD_BS +}; + + + + +/* CUSTOM KEYMAPS + ========================================================================== */ + +// Tap dances +#define TD_ESCP TD(TD_GV_ESC) // Tap for grave, twice for escape +#define TD_MINS TD(TD_MIN) // Tap for minus, twice for equal +#define TD_BRAC TD(TD_BRC) // Tap for open brace, twice for close + +// Layers +#define LT2_TAB LT(L_RAISE, KC_TAB) // Tap for tab, hold for RAISE +#define LT2_ENT LT(L_RAISE, KC_ENT) // Tap for enter, hold for RAISE +#define LT1_BSP LT(L_LOWER, KC_BSPACE) // Tap for backspace, hold for LOWER +#define LT1_SPC LT(L_LOWER, KC_SPC) // Tap for space, hold for LOWER + +// Modifiers +#define LG_ZMIN LGUI(KC_EQUAL) // Command + plus (zoom in) +#define LG_ZMOT LGUI(KC_MINUS) // Command + minus (zoom out) +#define MT_SHFT MT(MOD_RSFT, KC_ENT) // Tap for enter, hold for shift +#define MT_HILF S(A(KC_LEFT)) // Press for shift + alt + left +#define MT_HIRT S(A(KC_RGHT)) // Press for shift + alt + right +#define MT_UNTB S(KC_TAB) // Press for shift + tab + + + + + + +/* Layer definitions + ========================================================================== */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * ,-----------------------------------------------------------------------------------------------. + * | ` ESC | 1 ! | 2 @ | 3 # | 4 $ | 5 % | 6 ^ | 7 & | 8 * | 9 ( | 0 ) | -_ =+ | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | TB/RS | Q | W | E | R | T | Y | U | I | O | P | [{ }] | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | BS/LW | A | S | D | F | G | H | J | K | L | ; | ' | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | SFT | Z | X | C | V | B | N | M | , | . | / | SF/RN | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | LEADR | | CTL | ALT | CMD | BSP | SP/LW | RN/RS | ← | ↑ | ↓ | → | + * `----------------------------------------------------------------------------------------------- + */ + +[L_QWERTY] = LAYOUT_preonic_grid( +/*01 02 03 04 05 06 07 08 09 10 11 12 */ + TD_ESCP, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, TD_MINS, \ + LT2_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, TD_BRAC, \ + LT1_BSP, 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, MT_SHFT, \ + LG_ZMOT, LG_ZMIN, KC_LCTL, KC_LALT, KC_LGUI, KC_BSPACE, LT1_SPC, LT2_ENT, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT \ +), + + + + + + + /* LOWER + * ,-----------------------------------------------------------------------------------------------. + * | ASHFT | | | | | | | | | | | BSP | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | UNTAB | | | | | | | - | + | * | / | | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | | S+A+← | S+A+→ | | | | | ← | ↑ | ↓ | → | RTN | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | | | | | | | | [ { | ] } | ( | ) | \ | | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | | | | | | | >|| | | << | Vol-U | Vol-D | >> | + * `-----------------------------------------------------------------------------------------------' + */ + +[L_LOWER] = LAYOUT_preonic_grid( +/*01 02 03 04 05 06 07 08 09 10 11 12 */ + KC_ASTG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPACE, \ + MT_UNTB, _______, _______, _______, _______, _______, _______, KC_MINUS, KC_PLUS, KC_PAST, KC_PSLS, _______, \ + _______, MT_HILF, MT_HIRT, _______, _______, _______, _______, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, KC_ENTER, \ + _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_BSLASH, \ + _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MRWD, KC_VOLU, KC_VOLD, KC_MFFD \ +), + + + + + + +/* RAISE + * ,-----------------------------------------------------------------------------------------------. + * | ASHFT | BTSDN | BTSUP | VUP | VDN | | | / | * | ( | ) | | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | | | | | | | | 7 | 8 | 9 | + | | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | | | | | | | | 4 | 5 | 6 | - | | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | CAP | | | | | | | 1 | 2 | 3 | / | | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | | | | | | | | | 0 | . | , | | + * `-----------------------------------------------------------------------------------------------' + */ +[L_RAISE] = LAYOUT_preonic_grid( +/*01 02 03 04 05 06 07 08 09 10 11 12 */ + KC_ASTG, KC_F1, KC_F2, KC_VOLU, KC_VOLD, _______, _______, KC_PSLS, KC_PAST, KC_LPRN, KC_RPRN, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PLUS, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_MINUS, _______, \ + KC_CAPS, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PSLS, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_COMM, _______ \ +), + + + + + + + +/* Adjust (Raise + Lower together) + * ,-----------------------------------------------------------------------------------------------. + * | F12 | FN2 | FN3 | FN4 | FN5 | FN6 | FN7 | FN8 | FN9 | F10 | F11 | FN1 | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | | | | | | | | | | | | | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | | | | | | | | | | | | | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | TOG SF| | | | | | | | | | | | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | DESGN | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------------------' + */ + +[L_ADJUST] = LAYOUT_preonic_grid( +/*01 02 03 04 05 06 07 08 09 10 11 12 */ + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_ASTG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + +}; + +// this function +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, L_LOWER, L_RAISE, L_ADJUST); +} + + + + + + +/* BLANK + * ,-----------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | | | | | | | | | | | | | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | | | | | | | | | | | | | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | | | | | | | | | | | | | + * |-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------------------' + */ +/* +[L_BLANK] = LAYOUT_preonic_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), +*/ + + + + + + +/* Tap Dance Definitions + ========================================================================== */ + +qk_tap_dance_action_t tap_dance_actions[] = { + // Tap once for Left Brace, twice for Right Brace + [TD_BRC] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_RBRC), + //Tap once for Minus, twice for Equal + [TD_MIN] = ACTION_TAP_DANCE_DOUBLE(KC_MINUS, KC_EQUAL), + // Tap once for Grave, tap twice for Escape + [TD_GV_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_GRAVE, KC_ESCAPE) +}; diff --git a/keyboards/preonic/keymaps/egstad/readme.md b/keyboards/preonic/keymaps/egstad/readme.md new file mode 100644 index 000000000..2c8e095a4 --- /dev/null +++ b/keyboards/preonic/keymaps/egstad/readme.md @@ -0,0 +1,11 @@ +# Egstad's Layout + +## Build + +- Cd into this directory, run `npm start` +- Cd into root with `npm run qmk`, locate bin file "preonic_rev3_egstad.bin" +- Drop that bin into QMK Toolbox and flash Keeb + +## Learnings + + 1. Combos — Don't fuck with 'em. They made my keys feel sticky and increased typos. Would be great on macropad or something tho! diff --git a/keyboards/preonic/keymaps/egstad/rules.mk b/keyboards/preonic/keymaps/egstad/rules.mk new file mode 100644 index 000000000..5348bfdf9 --- /dev/null +++ b/keyboards/preonic/keymaps/egstad/rules.mk @@ -0,0 +1,3 @@ +SRC += muse.c +TAP_DANCE_ENABLE = yes +AUTO_SHIFT_ENABLE = yes