From 5ec0c054beab3ef802621bb6ddf038c25b8c1ebf Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Tue, 7 Nov 2017 11:58:17 -0800 Subject: [PATCH 1/4] Cleanup of keymaps --- .gitignore | 1 + docs/feature_advanced_keycodes.md | 4 + docs/feature_auto_shift.md | 2 +- .../atreus/keymaps/dvorak_42_key/keymap.c | 24 +- keyboards/ergodox_ez/keymaps/default/keymap.c | 4 +- .../keymaps/drashna-custom/config.h | 16 - .../keymaps/drashna-custom/keymap.c | 832 ------------------ .../keymaps/drashna-custom/rules.mk | 13 - keyboards/ergodox_ez/keymaps/drashna/config.h | 18 +- keyboards/ergodox_ez/keymaps/drashna/keymap.c | 676 ++++++++++---- .../ergodox_ez/keymaps/drashna/readme.md | 9 - keyboards/ergodox_ez/keymaps/drashna/rules.mk | 10 +- .../ergodox_ez/keymaps/dvorak_42_key/keymap.c | 219 ++++- .../woodpad/keymaps/drashna/keymap.c | 351 ++------ keyboards/nyquist/keymaps/333fred/README.md | 8 +- keyboards/nyquist/keymaps/333fred/keymap.c | 57 +- keyboards/nyquist/keymaps/333fred/rules.mk | 3 +- keyboards/orthodox/keymaps/drashna/keymap.c | 254 +----- keyboards/viterbi/keymaps/drashna/keymap.c | 338 ++----- keyboards/xd60/keymaps/petesmom/README.md | 26 + keyboards/xd60/keymaps/petesmom/keymap.c | 28 + layouts/community/ergodox/333fred/README.md | 23 +- layouts/community/ergodox/333fred/config.h | 2 +- layouts/community/ergodox/333fred/keymap.c | 54 +- layouts/community/ergodox/333fred/rules.mk | 3 +- .../ergodox/qwerty_code_friendly/keymap.c | 52 +- .../ergodox/qwerty_code_friendly/readme.md | 40 +- quantum/visualizer/resources/lcd_logo.c | 1 + tmk_core/common/progmem.h | 1 + users/333fred/333fred.c | 63 ++ users/333fred/333fred.h | 22 + users/333fred/rules.mk | 2 + users/drashna/drashna.c | 379 ++++++++ users/drashna/drashna.h | 73 ++ users/drashna/readme.md | 14 + users/drashna/rules.mk | 2 + 36 files changed, 1673 insertions(+), 1951 deletions(-) delete mode 100644 keyboards/ergodox_ez/keymaps/drashna-custom/config.h delete mode 100644 keyboards/ergodox_ez/keymaps/drashna-custom/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/drashna-custom/rules.mk delete mode 100644 keyboards/ergodox_ez/keymaps/drashna/readme.md create mode 100644 keyboards/xd60/keymaps/petesmom/README.md create mode 100644 keyboards/xd60/keymaps/petesmom/keymap.c create mode 100644 users/333fred/333fred.c create mode 100644 users/333fred/333fred.h create mode 100644 users/333fred/rules.mk create mode 100644 users/drashna/drashna.c create mode 100644 users/drashna/drashna.h create mode 100644 users/drashna/readme.md create mode 100644 users/drashna/rules.mk diff --git a/.gitignore b/.gitignore index a91b62a5ae3c..90f29a2970db 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ cmake-build-debug *.stackdump util/Win_Check_Output.txt # Let these ones be user specific, since we have so many different configurations +.vscode/c_cpp_properties.json .vscode/launch.json .vscode/tasks.json .vscode/last.sql diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index 95a20340e464..d49efdc1a121 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -49,6 +49,8 @@ Once you have a good feel for how layers work and what you can do, you can get m Layers stack on top of each other in numerical order. When determining what a keypress does, QMK scans the layers from the top down, stopping when it reaches the first active layer that is not set to `KC_TRNS`. As a result if you activate a layer that is numerically lower than your current layer, and your current layer (or another layer that is active and higher than your target layer) has something other than `KC_TRNS`, that is the key that will be sent, not the key on the layer you just activated. This is the cause of most people's "why doesn't my layer get switched" problem. +Sometimes, you might want to switch between layers in a macro or as part of a tap dance routine. `layer_on` activates a layer, and `layer_off` deactivates it. More layer-related functions can be found in [action_layer.h](../tmk_core/common/action_layer.h). + # Modifier keys These functions allow you to combine a mod with a keycode. When pressed the keydown for the mod will be sent first, and then *kc* will be sent. When released the keyup for *kc* will be sent and then the mod will be sent. @@ -145,6 +147,8 @@ You can control the behavior of one shot keys by defining these in `config.h`: * `OSM(mod)` - Momentarily hold down *mod*. You must use the `MOD_*` keycodes as shown in [Mod Tap](#mod-tap), not the `KC_*` codes. * `OSL(layer)` - momentary switch to *layer*. +Sometimes, you want to activate a one-shot layer as part of a macro or tap dance routine. To do this, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` on key down, and `set_oneshot_layer(ONESHOT_PRESSED)` on key up. If you want to cancel the oneshot, call `reset_oneshot_layer()`. For more complicated actions, take a look at the oneshot implementation in [`process_record`](../tmk_core/common/action.c#L429). + ## Permissive Hold As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new `config.h` option: diff --git a/docs/feature_auto_shift.md b/docs/feature_auto_shift.md index 0f482ccaae26..fdd10ada9c6f 100644 --- a/docs/feature_auto_shift.md +++ b/docs/feature_auto_shift.md @@ -42,7 +42,7 @@ Yes, unfortunately. Add to your `rules.mk` in the keymap folder: - AUTO_SHIFT_ENABLE = YES + AUTO_SHIFT_ENABLE = yes If no `rules.mk` exists, you can create one. diff --git a/keyboards/atreus/keymaps/dvorak_42_key/keymap.c b/keyboards/atreus/keymaps/dvorak_42_key/keymap.c index 02980378d47d..b2ea29043bac 100644 --- a/keyboards/atreus/keymaps/dvorak_42_key/keymap.c +++ b/keyboards/atreus/keymaps/dvorak_42_key/keymap.c @@ -30,24 +30,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, [KEYNAV] = { - {KC_ESC, MEH(KC_A), RCTL(KC_Z), RCTL(KC_S), MEH(KC_B), KC_TRNS, KC_TRNS, KC_HOME, KC_UP, KC_END, KC_PGUP, }, - {MEH(KC_C), MEH(KC_D), RSFT(KC_TAB), KC_TAB, MEH(KC_E), KC_TRNS, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), }, - {MEH(KC_F), MEH(KC_G), MEH(KC_H), MEH(KC_I), MEH(KC_J), KC_TRNS, KC_TRNS, RCTL(KC_C), RCTL(KC_X), RCTL(KC_V), KC_PGDOWN, }, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENTER, KC_SPACE, KC_BSPC, RCTL(KC_BSPC), KC_DELETE, LCTL(KC_DELETE), } + {KC_ESC, MEH(KC_F9), RCTL(KC_Z), RCTL(KC_S), MEH(KC_F10), KC_TRNS, KC_TRNS, KC_HOME, KC_UP, KC_END, KC_PGUP, }, + {MEH(KC_F11), MEH(KC_F12), RSFT(KC_TAB), KC_TAB, MEH(KC_A), KC_TRNS, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), }, + {MEH(KC_B), MEH(KC_C), MEH(KC_D), MEH(KC_E), MEH(KC_F), KC_TRNS, KC_TRNS, RCTL(KC_C), RCTL(KC_X), RCTL(KC_V), KC_PGDOWN, }, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENTER, KC_SPACE, KC_BSPC, RCTL(KC_BSPC), KC_DELETE, LCTL(KC_DELETE), } }, [KEYSEL] = { - {KC_TRNS, KC_TRNS, RCTL(KC_Z), RCTL(KC_S), KC_TRNS, KC_TRNS, KC_TRNS, RSFT(KC_HOME), RSFT(KC_UP), RSFT(KC_END), RSFT(KC_PGUP), }, - {KC_TRNS, KC_TRNS, RSFT(KC_TAB), KC_TAB, KC_TRNS, KC_TRNS, RSFT(RCTL(KC_LEFT)), RSFT(KC_LEFT), RSFT(KC_DOWN), RSFT(KC_RIGHT), RSFT(RCTL(KC_RIGHT)), }, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RCTL(KC_C),RCTL(KC_X), RCTL(KC_V), RSFT(KC_PGDN), }, - {RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENTER, KC_SPACE, KC_BSPC, RCTL(KC_BSPC), KC_DELETE, LCTL(KC_DELETE), } + {MEH(KC_G), MEH(KC_H),MEH(KC_I), MEH(KC_J), MEH(KC_K), KC_TRNS, KC_TRNS, RSFT(KC_HOME), RSFT(KC_UP), RSFT(KC_END), RSFT(KC_PGUP), }, + {MEH(KC_L), MEH(KC_M),MEH(KC_N), MEH(KC_O), MEH(KC_P), KC_TRNS, RSFT(RCTL(KC_LEFT)), RSFT(KC_LEFT), RSFT(KC_DOWN), RSFT(KC_RIGHT), RSFT(RCTL(KC_RIGHT)), }, + {MEH(KC_Q), MEH(KC_R),MEH(KC_S), MEH(KC_T), MEH(KC_U), KC_TRNS, KC_TRNS, RCTL(KC_C),RCTL(KC_X), RCTL(KC_V), RSFT(KC_PGDN), }, + {RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENTER, KC_SPACE, KC_BSPC, RCTL(KC_BSPC), KC_DELETE, LCTL(KC_DELETE), } }, [COMBINED] = { - {KC_ESC, KC_LABK, KC_RABK, KC_DQUO, KC_GRAVE, KC_TRNS, KC_PLUS, KC_7, KC_8, KC_9, KC_ASTR, }, - {KC_LPRN, KC_RPRN, KC_LBRACKET, KC_RBRACKET, KC_UNDS, KC_TRNS, KC_MINS, KC_4, KC_5, KC_6, KC_SLSH, }, - {KC_LCBR, KC_RCBR, KC_BSLS, KC_PIPE, KC_TILD, KC_TRNS, KC_EQUAL, KC_1, KC_2, KC_3, KC_QUES, }, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_DOT, KC_TRNS, KC_TRNS, } + {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TRNS, KC_PLUS, KC_7, KC_8, KC_9, KC_ASTR, }, + {KC_LPRN, KC_RPRN, KC_LBRACKET, KC_RBRACKET, KC_UNDS, KC_TRNS, KC_MINS, KC_4, KC_5, KC_6, KC_SLSH, }, + {KC_COLN, KC_DQUO, KC_LCBR, KC_RCBR, KC_TRNS, KC_TRNS, KC_EQUAL, KC_1, KC_2, KC_3, KC_QUES, }, + {KC_PIPE, KC_BSLS, KC_CIRC, KC_AMPR, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_DOT, KC_TILD, KC_GRAVE, } }, [MOUSE] = { diff --git a/keyboards/ergodox_ez/keymaps/default/keymap.c b/keyboards/ergodox_ez/keymaps/default/keymap.c index d2976812f5ac..3c15b8a44cb8 100644 --- a/keyboards/ergodox_ez/keymaps/default/keymap.c +++ b/keyboards/ergodox_ez/keymaps/default/keymap.c @@ -194,7 +194,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // Runs just one time when the keyboard initializes. void matrix_init_user(void) { - +#ifdef RGBLIGHT_COLOR_LAYER_0 + rgblight_setrgb(RGBLIGHT_COLOR_LAYER_0); +#endif }; // Runs constantly in the background, in a loop. diff --git a/keyboards/ergodox_ez/keymaps/drashna-custom/config.h b/keyboards/ergodox_ez/keymaps/drashna-custom/config.h deleted file mode 100644 index c1ebf174a3cf..000000000000 --- a/keyboards/ergodox_ez/keymaps/drashna-custom/config.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H -#include "../../config.h" - - -#define TAPPING_TERM 200 - -#ifdef RGBLIGHT_ENABLE -#undef RGBLIGHT_SAT_STEP -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 7 -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 7 -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 -#endif // RGBLIGHT_ENABLE - -#endif \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/drashna-custom/keymap.c b/keyboards/ergodox_ez/keymaps/drashna-custom/keymap.c deleted file mode 100644 index bdc4eed486c7..000000000000 --- a/keyboards/ergodox_ez/keymaps/drashna-custom/keymap.c +++ /dev/null @@ -1,832 +0,0 @@ -/* -This is the keymap for the keyboard -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert -Copyright 2017 Art Ortenburger -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 "debug.h" -#include "action_layer.h" -#include "version.h" - - -#include "keymap_german.h" - -#include "keymap_nordic.h" - -// Define layer names -#define QWERTY 0 -#define COLEMAK 1 -#define DVORAK 2 -#define WORKMAN 3 -#define SYMB 8 -#define OVERWATCH 9 -#define DIABLO 10 -#define MOUS 12 - -//Leader Key stuff -#ifdef LEADER_TIMEOUT -#undef LEADER_TIMEOUT -#endif -#define LEADER_TIMEOUT 1500 - -//define modifiers -#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) -#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) - -//define layer change stuff for underglow indicator -bool skip_leds = false; - -#ifdef RGBLIGHT_ENABLE -#define rgblight_set_blue rgblight_sethsv (0xFF, 0xFF, 0xFF); -#define rgblight_set_red rgblight_sethsv (0x00, 0xFF, 0xFF); -#define rgblight_set_green rgblight_sethsv (0x78, 0xFF, 0xFF); -#define rgblight_set_orange rgblight_sethsv (0x1E, 0xFF, 0xFF); -#define rgblight_set_teal rgblight_sethsv (0xC3, 0xFF, 0xFF); -#define rgblight_set_magenta rgblight_sethsv (0x12C, 0xFF, 0xFF); -#define rgblight_set_yellow rgblight_sethsv (0x3C, 0xFF, 0xFF); -#define rgblight_set_purple rgblight_sethsv (0x10E, 0xFF, 0xFF); -#endif - -//define diablo macro timer variables -static uint16_t diablo_timer[4]; -static uint8_t diablo_times[] = {0, 1, 3, 5, 10, 30}; -static uint8_t diablo_key_time[4]; - -bool check_dtimer(uint8_t dtimer) { - // has the correct number of seconds elapsed (as defined by diablo_times) - return (timer_elapsed(diablo_timer[dtimer]) < ( diablo_key_time[dtimer] * 1000 ) ) ? false : true; -}; - - -enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - EPRM, - VRSN, - RGB_SLD, - RGB_0000FF, - RGB_008000, - RGB_FF0000, - RGB_800080, - RGB_00FF90, - KC_DIABLO_CLEAR, - KC_QWERTY, - KC_COLEMAK, - KC_DVORAK, - KC_WORKMAN, - KC_MAKEQMK -}; - -#ifdef TAP_DANCE_ENABLE -enum { - TD_FLSH = 0, - TD_DIABLO_1, - TD_DIABLO_2, - TD_DIABLO_3, - TD_DIABLO_4 -}; - - - - -// on each tap, light up one led, from right to left -// on the forth tap, turn them off from right to left - -void dance_flsh_each(qk_tap_dance_state_t *state, void *user_data) { - if (!skip_leds) { - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - skip_leds = true; - } - switch (state->count) { - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_3_on(); - break; - case 4: - ergodox_right_led_1_off(); - _delay_ms(50); - ergodox_right_led_2_off(); - _delay_ms(50); - ergodox_right_led_3_off(); - - } -} - -// on the fourth tap, set the keyboard on flash state -// and set the underglow to red, because red == bad -void dance_flsh_finished(qk_tap_dance_state_t *state, void *user_data) { - if (state->count >= 4) { -#ifdef RGBLIGHT_ENABLE - rgblight_enable(); - rgblight_mode(1); - rgblight_setrgb(0xff,0x00,0x00); -#endif - reset_tap_dance(state); - reset_keyboard(); - } -} - -// Cycle through the times for the macro, starting at 0, for disabled. -// Max of six values, so don't exceed -void diablo_tapdance_master (qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) { - if (state->count >= 7) { - diablo_key_time[diablo_key] = diablo_times[0]; - reset_tap_dance(state); - } else { - diablo_key_time[diablo_key] = diablo_times[state->count - 1]; - } -} - - -// Would rather have one function for all of this, but no idea how to do that... -void diablo_tapdance1 (qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master (state, user_data, 0); -} - -void diablo_tapdance2 (qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master (state, user_data, 1); -} - -void diablo_tapdance3 (qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master (state, user_data, 2); -} - -void diablo_tapdance4 (qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master (state, user_data, 3); -} - - -// if the flash state didnt happen, then turn off leds, left to right -void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) { - _delay_ms(200); - ergodox_right_led_3_off(); - _delay_ms(200); - ergodox_right_led_2_off(); - _delay_ms(200); - ergodox_right_led_1_off(); - _delay_ms(500); - skip_leds = false; -} - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - //Once for Blue, Twice for Green, Thrice for Red, and four to flash - [TD_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED (dance_flsh_each, dance_flsh_finished, dance_flsh_reset), - // tap once to disable, and more to enable timed micros - [TD_DIABLO_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), - [TD_DIABLO_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), - [TD_DIABLO_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), - [TD_DIABLO_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), - -}; -#endif - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = + | 1 ! | 2 @ | 3 # | 4 $ | 5 % | TG(4)| | TG(4)| 6 ^ | 7 & | 8 * | 9 ( | 0 ) | - _ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | Q | W | E | R | T | TG(3)| |TG(3) | Y | U | I | O | P | \ | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Bksp | A | S | D | F | G |------| |------| H | J | K | L | ; | ' " | - * |--------+------+------+------+------+------| TG(2)| | TG(2)|------+------+------+------+------+--------| - * | Shift | Z | X | C | V | B | | | | N | M | , < | . > | ? / | Shift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | `/SYM| ' " | LGUI | [ { | ] } | | LEFT | DOWN | UP |RIGHT | SYMB | - * `----------------------------------' `----------------------------------' - * ,--------------. ,--------------. - * |Alt/Ap| Win | | Alt |Ctl/Esc| - * ,------|------|-------| |------+-------+------. - * | | | Home | | PgUp | | | - * | Space| Bksp |-------| |------| DEL |Enter | - * | | | End | | PgDn | | | - * `---------------------' `---------------------' - */ - [QWERTY] = KEYMAP( - KC_EQUAL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(MOUS), - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(DIABLO), - KC_BSPACE, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSHIFT, LCTL_T(KC_Z),KC_X, KC_C, KC_V, KC_B, TG(OVERWATCH), - LT(SYMB,KC_GRAVE),KC_QUOTE, KC_LGUI, KC_LBRACKET,KC_RBRACKET, - - ALT_T(KC_APPLICATION), KC_LGUI, - KC_HOME, - KC_SPACE, KC_BSPACE, KC_END, - - TG(MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, - TG(DIABLO), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, - KC_H, KC_J, KC_K, KC_L, KC_SCOLON, GUI_T(KC_QUOTE), - TG(OVERWATCH), KC_N, KC_M, KC_COMMA, KC_DOT, RCTL_T(KC_SLASH),KC_RSHIFT, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TT(SYMB), - KC_LEAD, CTL_T(KC_ESCAPE), - KC_PGUP, - KC_PGDOWN, KC_DELETE, KC_ENTER - ), -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | R | S | T | D |------| |------| H | N | E | I |O / L2| ' | - * |--------+------+------+------+------+------| OVER | | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[COLEMAK] = KEYMAP( - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(MOUS), - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(DIABLO), - KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_LSFT, LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(OVERWATCH), - LT(SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET, - ALT_T(KC_APP), KC_LEAD, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - TG(MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(DIABLO), KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, - KC_H, KC_N, KC_E, KC_I, KC_O, GUI_T(KC_QUOTE), - TG(OVERWATCH),KC_K, KC_M, KC_COMM,KC_DOT, RCTL_T(KC_SLASH), KC_RSHIFT, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TT(SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_DELETE, KC_ENT - ), -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | \ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | ' | , | . | P | Y | L1 | | L1 | F | G | C | R | L | / | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | O | E | U | I |------| |------| D | H | T | N |S / L2| - | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |:/Ctrl| Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[DVORAK] = KEYMAP( - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(MOUS), - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(DIABLO), - KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, LCTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, TG(OVERWATCH), - LT(SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET, KC_RBRACKET, - ALT_T(KC_APP), KC_LEAD, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - TG(MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, - TG(DIABLO), KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, - KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, - TG(OVERWATCH),KC_B, KC_M, KC_W, KC_V, RCTL_T(KC_Z), KC_RSHIFT, - KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, TT(SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_DELETE, KC_ENT - ), -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | R | S | T | D |------| |------| H | N | E | I |O / L2| ' | - * |--------+------+------+------+------+------| OVER | | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[WORKMAN] = KEYMAP( - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(MOUS), - KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, TG(DIABLO), - KC_BSPC, KC_A, KC_S, KC_H, KC_T, KC_G, - KC_LSFT, LCTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V, TG(OVERWATCH), - LT(SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET, - ALT_T(KC_APP), KC_LEAD, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - TG(MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(DIABLO), KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSLS, - KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOTE, - TG(OVERWATCH),KC_K, KC_L, KC_COMM,KC_DOT, RCTL_T(KC_SLASH), KC_RSHIFT, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TT(SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_DELETE, KC_ENT - ), - - /* Keymap 3: Symbol Layer -* -* ,--------------------------------------------------. ,--------------------------------------------------. -* | ESC | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | -* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -* | VERSION| ! | @ | { | } | | | | | | + | 7 | 8 | 9 | * | F12 | -* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -* | MAKE | # | $ | ( | ) | ` |------| |------| - | 4 | 5 | 6 | / | PrtSc | -* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -* | RESET | % | ^ | [ | ] | ~ | | | | NUM | 1 | 2 | 3 | = | PAUSE | -* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' -* | LT0 | & | * | : | ; | | | 0 | NUM. | ENT | ENT | -* `----------------------------------' `----------------------------------' -* ,-------------. ,-------------. -* | RGBM | RED | | OFF | SOLID| -* ,------|------|------| |------+------+------. -* | | | GREEN| | | | | -* | RGB | RGB |------| |------| NUM0 | NUME | -* | DARK |BRITE | BLUE | | | | | -* `--------------------' `--------------------' -*/ - [SYMB] = KEYMAP( - KC_ESCAPE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_WORKMAN, - VRSN, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_DVORAK, - KC_MAKEQMK, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRAVE, - TD(TD_FLSH), KC_PERC, KC_CIRC, KC_LBRACKET,KC_RBRACKET,KC_TILD, KC_COLEMAK, - KC_TRNS, KC_AMPR, KC_ASTR, KC_COLN, KC_SCOLON, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - KC_QWERTY, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_DVORAK, KC_KP_PLUS, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_ASTERISK, KC_F12, - KC_KP_MINUS,KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_SLASH, KC_PSCREEN, - KC_COLEMAK, KC_NUMLOCK, KC_KP_1, KC_KP_2, KC_KP_3, KC_EQUAL, KC_PAUSE, - KC_KP_0, KC_KP_0, KC_KP_DOT, KC_KP_ENTER, KC_TRNS, - RGB_TOG, RGB_SLD, - KC_NO, - KC_KP_DOT, KC_KP_0, KC_KP_ENTER - ), - -/* Keymap 4: Customized Overwatch Layout - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | | | | | | | | | F9 | F10 | F11 | F12 | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | F1 | K | Q | W | E | R | T | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | TAB | G | A | S | D | F |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LCTR | LSHFT| Z | X | C | V | | | | N | M | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | J | U | I | Y | T | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | O | P | | | | - * ,------|------|------| |------+------+------. - * | | | LGUI | | | | | - * | V | SPACE|------ |------| | Enter| - * | | | H | | | | | - * `--------------------' `--------------------' - */ - [OVERWATCH] = KEYMAP( - KC_ESCAPE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, - KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, - KC_LCTL, KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_TRNS, - KC_G, KC_U, KC_I, KC_Y, KC_T, - KC_O, KC_P, - KC_LGUI, - KC_V, KC_SPACE, KC_H, - - KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - TG(OVERWATCH), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_PGDOWN, KC_DELETE, KC_ENTER - ), - -/* Keymap 3: - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | V | D | ALT | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | S | I | F | M | T | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Q | 1 | 2 | 3 | 4 | G |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | NUMLOCK| NUM1 | NUM2 | NUM3 | NUM4 | Z | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LCTL | MAC1 | MAC2 | MAC3 | MAC4 | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | L | J | | | | - * ,------|------|------| |------+------+------. - * | | | G | | | | | - * | SPACE| Q |------ |------| | | - * | SHIFT| ALT | 0MAC | | | | | - * `--------------------' `--------------------' - */ - [DIABLO] = KEYMAP( - KC_ESCAPE, KC_V, KC_D, KC_LALT, KC_NO, KC_NO, KC_NO, - KC_TAB, KC_S, KC_F, KC_I, KC_M, KC_T, KC_TRNS, - KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G, - KC_LCTL, TD(TD_DIABLO_1), TD(TD_DIABLO_2), TD(TD_DIABLO_3), TD(TD_DIABLO_4), KC_Z, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_L, KC_J, - KC_F, - SFT_T(KC_SPACE), ALT_T(KC_Q), KC_DIABLO_CLEAR, - - - - KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_PGDOWN, KC_DELETE, KC_ENTER - ), - -/* Keymap 4: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | MsUp | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |MsLeft|MsDown|MsRght| | |------| |------| | | Acc0 | Acc1 | Acc2 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Acc0 | Acc1 | Acc2 | | | | | | | Mute |VolDn |VolUp | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | Play | Stop | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | MWUp | | | | | - * | Lclk | Rclk |------| |------| MBn4 | MBn5 | - * | | | MWDn | | Mclk | | | - * `--------------------' `--------------------' - */ - [MOUS] = KEYMAP( - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_NO, KC_NO, KC_MS_U, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO, - KC_NO, KC_ACL0, KC_ACL1, KC_ACL2, KC_NO, KC_NO, KC_TRNS, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_WH_U, - KC_BTN1, KC_BTN2, KC_WH_D, - - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_ACL0, KC_ACL1, KC_ACL2, KC_NO, KC_NO, - KC_TRNS, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO,KC_NO, - KC_NO, - KC_MS_BTN3,KC_MS_BTN4,KC_MS_BTN5 - ), - -}; - - -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) { -#ifdef CONSOLE_ENABLE - xprintf("KL: row: %u, column: %u, pressed: %u\n", record->event.key.col, record->event.key.row, record->event.pressed); -#endif - switch (keycode) { - // dynamically generate these. - case EPRM: - if (record->event.pressed) { - eeconfig_init(); - } - return false; - break; - case VRSN: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - return false; - break; - case RGB_SLD: - if (record->event.pressed) { -#ifdef RGBLIGHT_ENABLE - rgblight_mode(1); -#endif - } - return false; - break; - - case RGB_0000FF: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - rgblight_enable(); - rgblight_mode(1); - rgblight_setrgb(0x00,0x00,0xff); - #endif - } - return false; - break; - - case RGB_008000: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - rgblight_enable(); - rgblight_mode(1); - rgblight_setrgb(0x00,0x80,0x00); - #endif - } - return false; - break; - - case RGB_FF0000: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - rgblight_enable(); - rgblight_mode(1); - rgblight_setrgb(0xff,0x00,0x00); - #endif - } - return false; - break; - - case RGB_800080: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - rgblight_enable(); - rgblight_mode(1); - rgblight_setrgb(0x80,0x00,0x80); - #endif - } - return false; - break; - - case RGB_00FF90: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - rgblight_enable(); - rgblight_mode(1); - rgblight_setrgb(0x00,0xff,0x90); - #endif - } - return false; - break; - case KC_DIABLO_CLEAR: // reset all Diable timers, disabling them - if (record->event.pressed) { - uint8_t dtime; - - for (dtime = 0; dtime < 4; dtime++) { - diablo_key_time[dtime] = diablo_times[0]; - } - } - return false; - break; - case KC_QWERTY: - if (record->event.pressed) { - persistent_default_layer_set(1UL << QWERTY); - } - return false; - break; - case KC_COLEMAK: - if (record->event.pressed) { - persistent_default_layer_set(1UL << COLEMAK); - } - return false; - break; - case KC_DVORAK: - if (record->event.pressed) { - persistent_default_layer_set(1UL << DVORAK); - } - return false; - break; - case KC_WORKMAN: - if (record->event.pressed) { - persistent_default_layer_set(1UL << WORKMAN); - } - return false; - break; - case KC_MAKEQMK: - if (!record->event.pressed) { - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP ":teensy"SS_TAP(X_ENTER)); - } - return false; - break; - - } - return true; -} - -#ifdef TAP_DANCE_ENABLE - -// Sends the key press to system, but only if on the Diablo layer -void send_diablo_keystroke (uint8_t diablo_key) { - if (biton32(layer_state) == DIABLO) { - switch (diablo_key) { - case 0: - SEND_STRING("1"); - break; - case 1: - SEND_STRING("2"); - break; - case 2: - SEND_STRING("3"); - break; - case 3: - SEND_STRING("4"); - break; - } - } -} - -// Checks each of the 4 timers/keys to see if enough time has elapsed -// Runs the "send string" command if enough time has passed, and resets the timer. -void run_diablo_macro_check(void) { - uint8_t dtime; - - for (dtime = 0; dtime < 4; dtime++) { - if (check_dtimer(dtime) && diablo_key_time[dtime]) { - diablo_timer[dtime] = timer_read(); - send_diablo_keystroke(dtime); - } - } - -} - -#endif - - -void matrix_init_user(void) { // Runs boot tasks for keyboard -#ifdef RGBLIGHT_ENABLE - uint8_t default_layer = eeconfig_read_default_layer(); - - rgblight_enable(); - if (default_layer & (1UL << COLEMAK)) { - rgblight_set_magenta; - } - else if (default_layer & (1UL << DVORAK)) { - rgblight_set_green; - } - else if (default_layer & (1UL << WORKMAN)) { - rgblight_set_purple; - } - else { - rgblight_set_teal; - } -#endif -}; - -LEADER_EXTERNS(); - -void matrix_scan_user(void) { // runs frequently to update info - uint8_t modifiders = get_mods(); - - if (!skip_leds) { - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - - // Since we're not using the LEDs here for layer indication anymore, - // then lets use them for modifier indicators. Shame we don't have 4... - // Also, no "else", since we want to know each, independantly. - if ( modifiders & MODS_SHIFT_MASK) { - ergodox_right_led_2_on(); - } - if ( modifiders & MODS_CTRL_MASK) { - ergodox_right_led_1_on(); - } - if ( modifiders & MODS_ALT_MASK) { - ergodox_right_led_3_on(); - } - - } - - // Run Diablo 3 macro checking code. -#ifdef TAP_DANCE_ENABLE - run_diablo_macro_check(); -#endif - LEADER_DICTIONARY() { - leading = false; - leader_end(); - SEQ_ONE_KEY(KC_C) { - SEND_STRING("Covecube"); - } - SEQ_ONE_KEY(KC_D) { - SEND_STRING("StableBit CloudDrive"); - } - SEQ_ONE_KEY(KC_L) { - register_code(KC_LGUI); - register_code(KC_L); - unregister_code(KC_L); - unregister_code(KC_LGUI); - } - SEQ_TWO_KEYS(KC_S, KC_D) { - SEND_STRING("StableBit DrivePool"); - } - SEQ_TWO_KEYS(KC_S, KC_C) { - SEND_STRING("StableBit Scanner"); - } - SEQ_TWO_KEYS(KC_S, KC_T) { - SEND_STRING("StableBit Troubleshooter"); - } - } -}; - -uint32_t layer_state_set_kb(uint32_t state) { -#ifdef RGBLIGHT_ENABLE - uint8_t default_layer = eeconfig_read_default_layer(); - - switch (biton32(state)) { - case SYMB: - rgblight_set_blue; - rgblight_mode(2); - break; - case OVERWATCH: - rgblight_set_orange; - rgblight_mode(17); - break; - case DIABLO: - rgblight_set_red; - rgblight_mode(5); - break; - case MOUS: - rgblight_set_yellow; - rgblight_mode(1); - break; - default: - if (default_layer & (1UL << COLEMAK)) { - rgblight_set_green; - } - else if (default_layer & (1UL << DVORAK)) { - rgblight_set_magenta; - } - else if (default_layer & (1UL << WORKMAN)) { - rgblight_set_purple; - } - else { - rgblight_set_teal; - } - rgblight_mode(1); - break; - } -#endif - return state; -} diff --git a/keyboards/ergodox_ez/keymaps/drashna-custom/rules.mk b/keyboards/ergodox_ez/keymaps/drashna-custom/rules.mk deleted file mode 100644 index 0fa7cd2277e3..000000000000 --- a/keyboards/ergodox_ez/keymaps/drashna-custom/rules.mk +++ /dev/null @@ -1,13 +0,0 @@ -TAP_DANCE_ENABLE = yes -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -COMMAND_ENABLE = yes # Commands for debug and configuration -RGBLIGHT_ENABLE = yes -MIDI_ENABLE = no -CONSOLE_ENABLE = no -LEADER_KEYS = no - -EXTRAFLAGS = -flto - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/ergodox_ez/keymaps/drashna/config.h b/keyboards/ergodox_ez/keymaps/drashna/config.h index 258dc391fe44..62becc76888c 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/config.h +++ b/keyboards/ergodox_ez/keymaps/drashna/config.h @@ -1,11 +1,17 @@ - +#ifndef CONFIG_USER_H +#define CONFIG_USER_H #include "../../config.h" +#define TAPPING_TERM 200 + +#ifdef RGBLIGHT_ENABLE +#undef RGBLIGHT_SAT_STEP +#define RGBLIGHT_SAT_STEP 12 +#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 7 +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 7 +#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 +#endif // RGBLIGHT_ENABLE -// make this easy to toggle behavior, so that it can be more easily toggled -#define LAYER_UNDERGLOW_LIGHTING -#ifdef LAYER_UNDERGLOW_LIGHTING -#undef RGBLIGHT_ANIMATIONS -#endif \ No newline at end of file +#endif diff --git a/keyboards/ergodox_ez/keymaps/drashna/keymap.c b/keyboards/ergodox_ez/keymaps/drashna/keymap.c index 97ede9431880..651703c1e0bb 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/keymap.c +++ b/keyboards/ergodox_ez/keymaps/drashna/keymap.c @@ -1,194 +1,574 @@ +/* +This is the keymap for the keyboard +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2017 Art Ortenburger +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 "debug.h" #include "action_layer.h" #include "version.h" - +#include "drashna.h" #include "keymap_german.h" #include "keymap_nordic.h" -#define VERSION M(0) -// Define layer names -#define BASE 0 -#define SYMB 1 -#define MOUS 2 -#ifdef LAYER_UNDERGLOW_LIGHTING -#define rgblight_set_teal rgblight_setrgb(0x00, 0xFF, 0xFF) -#define rgblight_set_red rgblight_setrgb(0xFF, 0x00, 0x00) -#define rgblight_set_blue rgblight_setrgb(0x00, 0xFF, 0x00); -#define rgblight_set_green rgblight_setrgb(0x00, 0x00, 0xFF); -#define rgblight_set_yellow rgblight_setrgb(0xFF, 0xFF, 0x00); +//define layer change stuff for underglow indicator +bool skip_leds = false; -#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) -#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) -#endif +#ifdef TAP_DANCE_ENABLE +//define diablo macro timer variables +static uint16_t diablo_timer[4]; +static uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 }; +static uint8_t diablo_key_time[4]; -enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - EPRM, - VRSN, -#ifndef LAYER_UNDERGLOW_LIGHTING - RGB_SLD, -#endif +bool check_dtimer(uint8_t dtimer) { + // has the correct number of seconds elapsed (as defined by diablo_times) + return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; }; -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +enum { + TD_FLSH = 0, + TD_DIABLO_1, + TD_DIABLO_2, + TD_DIABLO_3, + TD_DIABLO_4 +}; - [0] = KEYMAP(KC_EQUAL,KC_1,KC_2,KC_3,KC_4,KC_5,KC_LEFT,KC_DELETE,KC_Q,KC_W,KC_E,KC_R,KC_T,TG(1),KC_BSPACE,KC_A,KC_S,KC_D,KC_F,KC_G,KC_LSHIFT,CTL_T(KC_Z),KC_X,KC_C,KC_V,KC_B,ALL_T(KC_NO),LT(1,KC_GRAVE),KC_QUOTE,LALT(KC_LSHIFT),KC_LEFT,KC_RIGHT,ALT_T(KC_APPLICATION),KC_LGUI,KC_HOME,KC_SPACE,KC_BSPACE,KC_END,KC_RIGHT,KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINUS,TG(1),KC_Y,KC_U,KC_I,KC_O,KC_P,KC_BSLASH,KC_H,KC_J,KC_K,KC_L,LT(2,KC_SCOLON),GUI_T(KC_QUOTE),MEH_T(KC_NO),KC_N,KC_M,KC_COMMA,KC_DOT,CTL_T(KC_SLASH),KC_RSHIFT,KC_UP,KC_DOWN,KC_LBRACKET,KC_RBRACKET,MO(1),KC_LALT,CTL_T(KC_ESCAPE),KC_PGUP,KC_PGDOWN,KC_TAB,KC_ENTER), +// on each tap, light up one led, from right to left +// on the forth tap, turn them off from right to left -#ifdef LAYER_UNDERGLOW_LIGHTING - [1] = KEYMAP(KC_ESCAPE,KC_F1,KC_F2,KC_F3,KC_F4,KC_F5,KC_TRANSPARENT,VERSION,KC_EXLM,KC_AT,KC_LCBR,KC_RCBR,KC_PIPE,KC_TRANSPARENT,VRSN,KC_HASH,KC_DLR,KC_LPRN,KC_RPRN,KC_GRAVE,RESET,KC_PERC,KC_CIRC,KC_LBRACKET,KC_RBRACKET,KC_TILD,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,RGB_VAD,RGB_VAI,KC_TRANSPARENT,KC_TRANSPARENT,KC_F6,KC_F7,KC_F8,KC_F9,KC_F10,KC_F11,KC_TRANSPARENT,KC_UP,KC_7,KC_8,KC_9,KC_ASTR,KC_F12,KC_DOWN,KC_4,KC_5,KC_6,KC_PLUS,KC_TRANSPARENT,KC_TRANSPARENT,KC_AMPR,KC_1,KC_2,KC_3,KC_BSLASH,KC_TRANSPARENT,KC_TRANSPARENT,KC_DOT,KC_0,KC_EQUAL,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT), -#else - [1] = KEYMAP(KC_ESCAPE,KC_F1,KC_F2,KC_F3,KC_F4,KC_F5,KC_TRANSPARENT,VERSION,KC_EXLM,KC_AT,KC_LCBR,KC_RCBR,KC_PIPE,KC_TRANSPARENT,VRSN,KC_HASH,KC_DLR,KC_LPRN,KC_RPRN,KC_GRAVE,RESET,KC_PERC,KC_CIRC,KC_LBRACKET,KC_RBRACKET,KC_TILD,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,RGB_MOD,KC_TRANSPARENT,KC_TRANSPARENT,RGB_VAD,RGB_VAI,KC_TRANSPARENT,KC_TRANSPARENT,KC_F6,KC_F7,KC_F8,KC_F9,KC_F10,KC_F11,KC_TRANSPARENT,KC_UP,KC_7,KC_8,KC_9,KC_ASTR,KC_F12,KC_DOWN,KC_4,KC_5,KC_6,KC_PLUS,KC_TRANSPARENT,KC_TRANSPARENT,KC_AMPR,KC_1,KC_2,KC_3,KC_BSLASH,KC_TRANSPARENT,KC_TRANSPARENT,KC_DOT,KC_0,KC_EQUAL,KC_TRANSPARENT,RGB_TOG,RGB_SLD,KC_TRANSPARENT,KC_TRANSPARENT,RGB_HUD,RGB_HUI), +void dance_flsh_each(qk_tap_dance_state_t *state, void *user_data) { + if (!skip_leds) { + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + skip_leds = true; + } + switch (state->count) { + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + case 3: + ergodox_right_led_3_on(); + break; + case 4: + ergodox_right_led_1_off(); + _delay_ms(50); + ergodox_right_led_2_off(); + _delay_ms(50); + ergodox_right_led_3_off(); + + } +} + +// on the fourth tap, set the keyboard on flash state +// and set the underglow to red, because red == bad +void dance_flsh_finished(qk_tap_dance_state_t *state, void *user_data) { + if (state->count >= 4) { +#ifdef RGBLIGHT_ENABLE + rgblight_enable(); + rgblight_mode(1); + rgblight_setrgb(0xff, 0x00, 0x00); #endif + reset_tap_dance(state); + reset_keyboard(); + } +} - [2] = KEYMAP(KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MS_UP,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MS_LEFT,KC_MS_DOWN,KC_MS_RIGHT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MS_BTN1,KC_MS_BTN2,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MEDIA_PLAY_PAUSE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MEDIA_PREV_TRACK,KC_MEDIA_NEXT_TRACK,KC_TRANSPARENT,KC_TRANSPARENT,KC_AUDIO_VOL_UP,KC_AUDIO_VOL_DOWN,KC_AUDIO_MUTE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_WWW_BACK), +// Cycle through the times for the macro, starting at 0, for disabled. +// Max of six values, so don't exceed +void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) { + if (state->count >= 7) { + diablo_key_time[diablo_key] = diablo_times[0]; + reset_tap_dance(state); + } + else { + diablo_key_time[diablo_key] = diablo_times[state->count - 1]; + } +} -}; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(1) +// Would rather have one function for all of this, but no idea how to do that... +void diablo_tapdance1(qk_tap_dance_state_t *state, void *user_data) { + diablo_tapdance_master(state, user_data, 0); +} + +void diablo_tapdance2(qk_tap_dance_state_t *state, void *user_data) { + diablo_tapdance_master(state, user_data, 1); +} + +void diablo_tapdance3(qk_tap_dance_state_t *state, void *user_data) { + diablo_tapdance_master(state, user_data, 2); +} + +void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { + diablo_tapdance_master(state, user_data, 3); +} + + +// if the flash state didnt happen, then turn off leds, left to right +void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) { + _delay_ms(200); + ergodox_right_led_3_off(); + _delay_ms(200); + ergodox_right_led_2_off(); + _delay_ms(200); + ergodox_right_led_1_off(); + _delay_ms(500); + skip_leds = false; +} + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + //Once for Blue, Twice for Green, Thrice for Red, and four to flash + [TD_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED(dance_flsh_each, dance_flsh_finished, dance_flsh_reset), + // tap once to disable, and more to enable timed micros + [TD_DIABLO_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), + [TD_DIABLO_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), + [TD_DIABLO_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), + [TD_DIABLO_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), + }; +#endif + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = + | 1 ! | 2 @ | 3 # | 4 $ | 5 % | TG(4)| | TG(4)| 6 ^ | 7 & | 8 * | 9 ( | 0 ) | - _ | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | TAB | Q | W | E | R | T | TG(3)| |TG(3) | Y | U | I | O | P | \ | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Bksp | A | S | D | F | G |------| |------| H | J | K | L | ; | ' " | + * |--------+------+------+------+------+------| TG(2)| | TG(2)|------+------+------+------+------+--------| + * | Shift | Z | X | C | V | B | | | | N | M | , < | . > | ? / | Shift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | `/SYM| ' " | LGUI | [ { | ] } | | LEFT | DOWN | UP |RIGHT | SYMB | + * `----------------------------------' `----------------------------------' + * ,--------------. ,--------------. + * |Alt/Ap| Win | | Alt |Ctl/Esc| + * ,------|------|-------| |------+-------+------. + * | | | Home | | PgUp | | | + * | Space| Bksp |-------| |------| DEL |Enter | + * | | | End | | PgDn | | | + * `---------------------' `---------------------' + */ + [_QWERTY] = LAYOUT_ergodox( + KC_EQUAL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(_DIABLO), + KC_BSPACE, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSHIFT, LCTL_T(KC_Z),KC_X, KC_C, KC_V, KC_B, TG(_OVERWATCH), + LT(_SYMB,KC_GRAVE),KC_QUOTE, KC_LGUI, KC_LBRACKET,KC_RBRACKET, + + ALT_T(KC_APPLICATION), KC_LGUI, + KC_HOME, + KC_SPACE, KC_BSPACE, KC_END, + + TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, + TG(_DIABLO), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, + KC_H, KC_J, KC_K, KC_L, KC_SCOLON, GUI_T(KC_QUOTE), + TG(_OVERWATCH), KC_N, KC_M, KC_COMMA, KC_DOT, RCTL_T(KC_SLASH),KC_RSHIFT, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TT(_SYMB), + KC_RGUI, CTL_T(KC_ESCAPE), + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER + ), +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | R | S | T | D |------| |------| H | N | E | I |O / L2| ' | + * |--------+------+------+------+------+------| OVER | | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[_COLEMAK] = LAYOUT_ergodox( + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(_DIABLO), + KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, + KC_LSFT, LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(_OVERWATCH), + LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET, + ALT_T(KC_APP), KC_LEAD, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(_DIABLO), KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, + KC_H, KC_N, KC_E, KC_I, KC_O, GUI_T(KC_QUOTE), + TG(_OVERWATCH),KC_K, KC_M, KC_COMM,KC_DOT, RCTL_T(KC_SLASH), KC_RSHIFT, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TT(_SYMB), + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_DELETE, KC_ENT + ), +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | \ | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | ' | , | . | P | Y | L1 | | L1 | F | G | C | R | L | / | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | O | E | U | I |------| |------| D | H | T | N |S / L2| - | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |:/Ctrl| Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[_DVORAK] = LAYOUT_ergodox( + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(_DIABLO), + KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSFT, LCTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, TG(_OVERWATCH), + LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET, KC_RBRACKET, + ALT_T(KC_APP), KC_LEAD, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + TG(_DIABLO), KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, + KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, + TG(_OVERWATCH),KC_B, KC_M, KC_W, KC_V, RCTL_T(KC_Z), KC_RSHIFT, + KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, TT(_SYMB), + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_DELETE, KC_ENT + ), +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | R | S | T | D |------| |------| H | N | E | I |O / L2| ' | + * |--------+------+------+------+------+------| OVER | | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[_WORKMAN] = LAYOUT_ergodox( + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), + KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, TG(_DIABLO), + KC_BSPC, KC_A, KC_S, KC_H, KC_T, KC_G, + KC_LSFT, LCTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V, TG(_OVERWATCH), + LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET, + ALT_T(KC_APP), KC_LEAD, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(_DIABLO), KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSLS, + KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOTE, + TG(_OVERWATCH),KC_K, KC_L, KC_COMM,KC_DOT, RCTL_T(KC_SLASH), KC_RSHIFT, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TT(_SYMB), + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_DELETE, KC_ENT + ), + + /* Keymap 3: Symbol Layer +* +* ,--------------------------------------------------. ,--------------------------------------------------. +* | ESC | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | +* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +* | VERSION| ! | @ | { | } | | | | | | + | 7 | 8 | 9 | * | F12 | +* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +* | MAKE | # | $ | ( | ) | ` |------| |------| - | 4 | 5 | 6 | / | PrtSc | +* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +* | RESET | % | ^ | [ | ] | ~ | | | | NUM | 1 | 2 | 3 | = | PAUSE | +* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' +* | LT0 | & | * | : | ; | | | 0 | NUM. | ENT | ENT | +* `----------------------------------' `----------------------------------' +* ,-------------. ,-------------. +* | RGBM | RED | | OFF | SOLID| +* ,------|------|------| |------+------+------. +* | | | GREEN| | | | | +* | RGB | RGB |------| |------| NUM0 | NUME | +* | DARK |BRITE | BLUE | | | | | +* `--------------------' `--------------------' +*/ + [_SYMB] = LAYOUT_ergodox( + KC_ESCAPE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_WORKMAN, + VRSN, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_DVORAK, + KC_MAKE, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRAVE, + KC_RESET, KC_PERC, KC_CIRC, KC_LBRACKET,KC_RBRACKET,KC_TILD, KC_COLEMAK, + KC_TRNS, KC_AMPR, KC_ASTR, KC_COLN, KC_SCOLON, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + + KC_QWERTY, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_DVORAK, KC_KP_PLUS, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_ASTERISK, KC_F12, + KC_KP_MINUS,KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_SLASH, KC_PSCREEN, + KC_COLEMAK, KC_NUMLOCK, KC_KP_1, KC_KP_2, KC_KP_3, KC_EQUAL, KC_PAUSE, + KC_KP_0, KC_KP_0, KC_KP_DOT, KC_KP_ENTER, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_KP_DOT, KC_KP_0, KC_KP_ENTER + ), + +/* Keymap 4: Customized Overwatch Layout + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ESC | | | | | | | | | F9 | F10 | F11 | F12 | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | F1 | K | Q | W | E | R | T | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | TAB | G | A | S | D | F |------| |------| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | LCTR | LSHFT| Z | X | C | V | | | | N | M | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | J | U | I | Y | T | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | O | P | | | | + * ,------|------|------| |------+------+------. + * | | | LGUI | | | | | + * | V | SPACE|------ |------| | Enter| + * | | | H | | | | | + * `--------------------' `--------------------' + */ + [_OVERWATCH] = LAYOUT_ergodox( + KC_ESCAPE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, + KC_LCTL, KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_TRNS, + KC_G, KC_U, KC_I, KC_Y, KC_T, + KC_O, KC_P, + KC_LGUI, + KC_V, KC_SPACE, KC_H, + + KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + TG(_OVERWATCH), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + KC_PGDOWN, KC_DELETE, KC_ENTER + ), + +/* Keymap 3: + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ESC | V | D | ALT | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | TAB | S | I | F | M | T | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Q | 1 | 2 | 3 | 4 | G |------| |------| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | NUMLOCK| NUM1 | NUM2 | NUM3 | NUM4 | Z | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LCTL | MAC1 | MAC2 | MAC3 | MAC4 | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | L | J | | | | + * ,------|------|------| |------+------+------. + * | | | G | | | | | + * | SPACE| Q |------ |------| | | + * | SHIFT| ALT | 0MAC | | | | | + * `--------------------' `--------------------' + */ + [_DIABLO] = LAYOUT_ergodox( + KC_ESCAPE, KC_V, KC_D, KC_LALT, KC_NO, KC_NO, KC_NO, + KC_TAB, KC_S, KC_F, KC_I, KC_M, KC_T, KC_TRNS, + KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G, + KC_LCTL, TD(TD_DIABLO_1), TD(TD_DIABLO_2), TD(TD_DIABLO_3), TD(TD_DIABLO_4), KC_Z, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_L, KC_J, + KC_F, + SFT_T(KC_SPACE), ALT_T(KC_Q), KC_DIABLO_CLEAR, + + + + KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + KC_PGDOWN, KC_DELETE, KC_ENTER + ), + +/* Keymap 4: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | MsUp | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | |MsLeft|MsDown|MsRght| | |------| |------| | | Acc0 | Acc1 | Acc2 | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | Acc0 | Acc1 | Acc2 | | | | | | | Mute |VolDn |VolUp | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | Play | Stop | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | MWUp | | | | | + * | Lclk | Rclk |------| |------| MBn4 | MBn5 | + * | | | MWDn | | Mclk | | | + * `--------------------' `--------------------' + */ + [_MOUS] = LAYOUT_ergodox( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_NO, KC_NO, KC_MS_U, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO, + KC_NO, KC_ACL0, KC_ACL1, KC_ACL2, KC_NO, KC_NO, KC_TRNS, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_WH_U, + KC_BTN1, KC_BTN2, KC_WH_D, + + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_ACL0, KC_ACL1, KC_ACL2, KC_NO, KC_NO, + KC_TRNS, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO,KC_NO, + KC_NO, + KC_MS_BTN3,KC_MS_BTN4,KC_MS_BTN5 + ), -// leaving this in place for compatibilty with old keymaps cloned and re-compiled. -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - } - return MACRO_NONE; }; -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - // dynamically generate these. - case EPRM: - if (record->event.pressed) { - eeconfig_init(); - } - return false; + + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +#ifdef TAP_DANCE_ENABLE + +// Sends the key press to system, but only if on the Diablo layer +void send_diablo_keystroke(uint8_t diablo_key) { + if (biton32(layer_state) == _DIABLO) { + switch (diablo_key) { + case 0: + SEND_STRING("1"); break; - case VRSN: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - return false; + case 1: + SEND_STRING("2"); break; -#ifndef LAYER_UNDERGLOW_LIGHTING - case RGB_SLD: - if (record->event.pressed) { - rgblight_mode(1); - } - return false; + case 2: + SEND_STRING("3"); break; -#endif - + case 3: + SEND_STRING("4"); + break; + } } - return true; } -void matrix_init_user(void) { -#ifdef LAYER_UNDERGLOW_LIGHTING - rgblight_enable(); - rgblight_set_teal; - rgblight_mode(1); -#endif +// Checks each of the 4 timers/keys to see if enough time has elapsed +// Runs the "send string" command if enough time has passed, and resets the timer. +void run_diablo_macro_check(void) { + uint8_t dtime; + + for (dtime = 0; dtime < 4; dtime++) { + if (check_dtimer(dtime) && diablo_key_time[dtime]) { + diablo_timer[dtime] = timer_read(); + send_diablo_keystroke(dtime); + } + } } -void matrix_scan_user(void) { +#endif + + +void matrix_init_keymap(void) { // Runs boot tasks for keyboard +}; + + +void matrix_scan_keymap(void) { // runs frequently to update info + uint8_t modifiders = get_mods(); + if (!skip_leds) { ergodox_board_led_off(); ergodox_right_led_1_off(); ergodox_right_led_2_off(); ergodox_right_led_3_off(); - -#ifdef LAYER_UNDERGLOW_LIGHTING - uint8_t modifiders = get_mods(); - - if ( modifiders & MODS_SHIFT_MASK) { - ergodox_right_led_1_on(); + + // Since we're not using the LEDs here for layer indication anymore, + // then lets use them for modifier indicators. Shame we don't have 4... + // Also, no "else", since we want to know each, independantly. + if (modifiders & MODS_SHIFT_MASK) { + ergodox_right_led_2_on(); } - if ( modifiders & MODS_CTRL_MASK) { - ergodox_right_led_2_on(); + if (modifiders & MODS_CTRL_MASK) { + ergodox_right_led_1_on(); } - if ( modifiders & MODS_ALT_MASK) { - ergodox_right_led_3_on(); - } -#else - uint8_t layer = biton32(layer_state); - switch (layer) { - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_3_on(); - break; - case 4: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - break; - case 5: - ergodox_right_led_1_on(); - ergodox_right_led_3_on(); - break; - case 6: - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - break; - case 7: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - break; - default: - break; - } -#endif -}; - -uint32_t layer_state_set_kb(uint32_t state) { -#ifdef LAYER_UNDERGLOW_LIGHTING - switch (biton32(state)) { - case 1: - rgblight_set_red; - break; - case 2: - rgblight_set_blue; - break; - case 3: - rgblight_set_green; - break; - case 4: - rgblight_set_yellow; - break; - case 5: - rgblight_setrgb(0xFF, 0xFF, 0x00); - break; - case 6: - rgblight_setrgb(0xFF, 0xFF, 0x00); - break; - case 7: - rgblight_setrgb(0xFF, 0xFF, 0xFF); - break; - default: - rgblight_set_teal; - break; + if (modifiders & MODS_ALT_MASK) { + ergodox_right_led_3_on(); } + + } + + // Run Diablo 3 macro checking code. +#ifdef TAP_DANCE_ENABLE + run_diablo_macro_check(); #endif - return state; -} +}; + diff --git a/keyboards/ergodox_ez/keymaps/drashna/readme.md b/keyboards/ergodox_ez/keymaps/drashna/readme.md deleted file mode 100644 index 90fe44861a85..000000000000 --- a/keyboards/ergodox_ez/keymaps/drashna/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -# Drashna's ErgoDox EZ Underglow Mod - -This is based on the default Ergodox EZ keymap. - -This modifieds the keymay so that it uses the underglow to indicate which layer you're on, rather than the top LEDs. - -Default colors are "teal" for base layer, "red" for Symbols, and "green" for mouse/media. Blue would be the next layer, if you had more. - -Additionally, the top LEDs are Shift/Control/Alt indicators instead (in that order). \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/drashna/rules.mk b/keyboards/ergodox_ez/keymaps/drashna/rules.mk index 9dfddf01ecab..b6c5ed3bd597 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/rules.mk +++ b/keyboards/ergodox_ez/keymaps/drashna/rules.mk @@ -1,5 +1,11 @@ -RGBLIGHT_ENABLE = yes -RGBLIGHT_ANIMATION = no +TAP_DANCE_ENABLE = yes +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +COMMAND_ENABLE = yes # Commands for debug and configuration +RGBLIGHT_ENABLE = yes +MIDI_ENABLE = no +CONSOLE_ENABLE = no + +EXTRAFLAGS = -flto ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c b/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c index c1195ecc0dd0..c79f1612322c 100644 --- a/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c +++ b/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c @@ -14,16 +14,32 @@ enum custom_keycodes { EPRM, VRSN, RGB_SLD, + // shell nav macros + SHELL_LS, + SHELL_LSLTR, + SHELL_CDPRE, + SHELL_LESS, + SHELL_PLESS, + SHELL_PGREP, + SHELL_TAILF, + SHELL_PWD, + SHELL_H3, + SHELL_AMMCOLO, + SHELL_SCREENRD, + SHELL_SCREEN_NEW, + SHELL_SCREEN_LIST, + SHELL_MKE, }; -#define BASE 0 // base dvorak layer -#define KEYNAV 1 // arrow navigation (right hand) -#define KEYSEL 2 // arrow navigation + shift (allow text selection) -#define SHELL_NAV 3 // bash shortcuts -#define MOUSE 4 // mouse layer (can be locked with lock key) -#define COMBINED 5 // combined numbers and symbols layer +#define BASE 0 // base dvorak layer +#define KEYNAV 1 // arrow navigation (right hand) +#define KEYSEL 2 // arrow navigation + shift (allow text selection) +#define SHELL_NAV 3 // bash shortcuts +#define SHELL_SCREEN 4 // linux screen shortcuts +#define MOUSE 5 // mouse layer (can be locked with lock key) +#define COMBINED 6 // combined numbers and symbols layer // macros #define MOUSE_TOGGLE 1 @@ -34,18 +50,38 @@ enum custom_keycodes { #define SWITCH_NDS 7 #define SCREEN_COPY_MODE 8 #define SCREEN_PASTE 9 -#define SHELL_RECALL_LAST_ARG_REMOVE_FIRST_COMMAND 15 +#define SCREEN_RENAME 10 +#define SCREEN_NUMBER 11 +#define SCREEN_0 12 +#define SCREEN_1 13 +#define SCREEN_2 14 +#define SCREEN_3 15 +#define SCREEN_4 16 +#define SCREEN_5 17 +#define SCREEN_6 18 +#define SCREEN_7 19 +#define SCREEN_8 20 +#define SCREEN_9 21 +#define SCREEN_DETACH 22 +#define SHELL_RECALL_LAST_ARG_REMOVE_FIRST_COMMAND 30 +#define MACRO_SCREEN_NUM(MACRO_NAME,NUM) \ + case MACRO_NAME:\ + if (record->event.pressed) {\ + return MACRO( D(LCTL), T(A), U(LCTL), T(NUM), END);\ + }\ + break;\ + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [BASE] = KEYMAP( // left hand - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TAB, KC_QUOTE, KC_COMMA, KC_DOT, KC_P, KC_Y, MEH(KC_2), - MO(SHELL_NAV), KC_A, KC_O, KC_E, KC_U, KC_I, - MEH(KC_0), KC_SCOLON, KC_Q, KC_J, KC_K, KC_X, MEH(KC_3), - MEH(KC_1), OSM(MOD_LSFT), OSM(MOD_LCTL), M(MOUSE_TOGGLE), MO(KEYSEL), + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + KC_TAB, KC_QUOTE, KC_COMMA, KC_DOT, KC_P, KC_Y, MEH(KC_2), + OSL(SHELL_NAV), KC_A, KC_O, KC_E, KC_U, KC_I, + OSL(SHELL_SCREEN), KC_SCOLON, KC_Q, KC_J, KC_K, KC_X, MEH(KC_3), + MEH(KC_1), OSM(MOD_LSFT), OSM(MOD_LCTL), M(MOUSE_TOGGLE), MO(KEYSEL), // left thumb cluster MEH(KC_4), MEH(KC_5), @@ -114,23 +150,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // shell navigation layer [SHELL_NAV] = KEYMAP( // left hand - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS, SHELL_PGREP, SHELL_PLESS, SHELL_LESS, SHELL_MKE, SHELL_H3, + KC_TRNS,LCTL(KC_A), SHELL_CDPRE, SHELL_LSLTR, SHELL_LS, SHELL_PWD, + KC_TRNS,SHELL_SCREEN_LIST, SHELL_SCREENRD, SHELL_SCREEN_NEW, SHELL_TAILF, KC_TRNS, SHELL_AMMCOLO, // bottom row KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, // thumb cluster KC_TRNS,KC_TRNS, - LALT(KC_D), - KC_TRNS,RCTL(KC_W),KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(SWITCH_NDS), - RCTL(KC_L), RCTL(KC_W), KC_HOME, KC_UP, KC_END, LALT(KC_D), RCTL(KC_R), - LALT(KC_B), KC_LEFT, KC_DOWN, KC_RIGHT, LALT(KC_F), LALT(KC_DOT), - RCTL(KC_C), RCTL(KC_U), M(SCREEN_COPY_MODE), M(SCREEN_PASTE), MEH(KC_V), RCTL(KC_K), M(SHELL_RECALL_LAST_ARG_REMOVE_FIRST_COMMAND), - // bottom row - M(SCREEN_TAB_LEFT), M(SCREEN_TAB_RIGHT), M(SCREEN_NEW_TAB), KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(SWITCH_NDS), + RCTL(KC_L), KC_TRNS, KC_HOME, KC_UP, KC_END, KC_TRNS, RCTL(KC_R), + LALT(KC_B), KC_LEFT, KC_DOWN, KC_RIGHT, LALT(KC_F), LALT(KC_DOT), + RCTL(KC_C), KC_TRNS, M(SCREEN_COPY_MODE), M(SCREEN_PASTE), MEH(KC_V), RCTL(KC_K), M(SHELL_RECALL_LAST_ARG_REMOVE_FIRST_COMMAND), + // bottom row (match functionality of base layer) + KC_TRNS, RCTL(KC_W), KC_TRNS, LALT(KC_D), RCTL(KC_U), // thumb cluster KC_TRNS, KC_TRNS, KC_TRNS, @@ -138,16 +174,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), + // linux screen layer + [SHELL_SCREEN] = KEYMAP( + // left hand + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + // bottom row + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + // thumb cluster + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, M(SCREEN_NEW_TAB), M(SCREEN_7), M(SCREEN_8), M(SCREEN_9), M(SCREEN_RENAME), KC_TRNS, + M(SCREEN_TAB_LEFT), M(SCREEN_4), M(SCREEN_5), M(SCREEN_6), M(SCREEN_TAB_RIGHT), KC_TRNS, + KC_TRNS, KC_TRNS, M(SCREEN_1), M(SCREEN_2), M(SCREEN_3), M(SCREEN_NUMBER), KC_TRNS, + // bottom row + M(SCREEN_0), KC_TRNS, KC_TRNS, KC_TRNS, M(SCREEN_DETACH), + // thumb cluster + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), + [COMBINED] = KEYMAP( // left hand KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, - KC_TRNS,KC_ESC, KC_LABK, KC_RABK, KC_DQUO, KC_GRAVE,KC_TRNS, + KC_TRNS,KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC,KC_TRNS, KC_TRNS,KC_LPRN, KC_RPRN, KC_LBRACKET, KC_RBRACKET, KC_UNDS, - KC_TRNS,KC_LCBR, KC_RCBR, KC_BSLS, KC_PIPE, KC_TILD,KC_TRNS, + KC_TRNS,KC_COLN, KC_DQUO, KC_LCBR, KC_RCBR, KC_TRNS,KC_TRNS, // bottom row - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_PIPE, KC_BSLS, KC_CIRC, KC_AMPR, // thumb cluster KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, @@ -157,7 +219,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_MINS, KC_4, KC_5, KC_6, KC_SLSH, MEH(KC_N), KC_TRNS, KC_EQUAL, KC_1, KC_2, KC_3, KC_QUES, MEH(KC_O), // bottom row - KC_0, KC_DOT, KC_TRNS, KC_TRNS, MEH(KC_P), + KC_0, KC_DOT, KC_TILD, KC_GRAVE, MEH(KC_P), // thumb cluster KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS), @@ -230,6 +292,41 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return MACRO( D(LCTL), T(A), U(LCTL), T(C), END); } break; + case SCREEN_DETACH: + if (record->event.pressed) { + return MACRO( D(LCTL), T(A), U(LCTL), T(D), END); + } + break; + case SCREEN_RENAME: + if (record->event.pressed) { + return MACRO( D(LCTL), T(A), U(LCTL), D(LSFT), T(A), U(LSFT), END); + } + break; + case SCREEN_NUMBER: + if (record->event.pressed) { + return MACRO( D(LCTL), T(A), U(LCTL), D(LSFT), T(SCOLON), U(LSFT), + T(N), + T(U), + T(M), + T(B), + T(E), + T(R), + T(SPC), + END); + } + break; + + MACRO_SCREEN_NUM(SCREEN_0,0); + MACRO_SCREEN_NUM(SCREEN_1,1); + MACRO_SCREEN_NUM(SCREEN_2,2); + MACRO_SCREEN_NUM(SCREEN_3,3); + MACRO_SCREEN_NUM(SCREEN_4,4); + MACRO_SCREEN_NUM(SCREEN_5,5); + MACRO_SCREEN_NUM(SCREEN_6,6); + MACRO_SCREEN_NUM(SCREEN_7,7); + MACRO_SCREEN_NUM(SCREEN_8,8); + MACRO_SCREEN_NUM(SCREEN_9,9); + case SCREEN_COPY_MODE: if (record->event.pressed) { return MACRO( D(LCTL), T(A), U(LCTL), T(ESC), END); @@ -282,8 +379,70 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - } + + // shell macros + if(record->event.pressed) { + switch (keycode) { + case SHELL_LS: + SEND_STRING("ls\n"); + return true; + break; + case SHELL_LSLTR: + SEND_STRING("ls -ltr\n"); + return true; + break; + case SHELL_CDPRE: + SEND_STRING("cd ..\n"); + return true; + break; + case SHELL_LESS: + SEND_STRING("less "); + return true; + break; + case SHELL_PLESS: + SEND_STRING(" | less"); + return true; + break; + case SHELL_PGREP: + SEND_STRING(" | grep "); + return true; + break; + case SHELL_TAILF: + SEND_STRING("tail -f "); + return true; + break; + case SHELL_PWD: + SEND_STRING("echo `pwd`/"); + return true; + break; + case SHELL_H3: + SEND_STRING("h3\n"); + return true; + break; + case SHELL_AMMCOLO: + SEND_STRING("ammcolo\n"); + return true; + break; + case SHELL_SCREENRD: + SEND_STRING("screen -r -d "); + return true; + break; + case SHELL_SCREEN_NEW: + SEND_STRING("screen -S "); + return true; + break; + case SHELL_SCREEN_LIST: + SEND_STRING("screen -list\n"); + return true; + break; + case SHELL_MKE: + SEND_STRING("mke\n"); + return true; + break; + } + } + return true; } @@ -306,6 +465,8 @@ void matrix_scan_user(void) { case COMBINED: ergodox_right_led_2_on(); break; + case SHELL_NAV: + case SHELL_SCREEN: case KEYNAV: case KEYSEL: ergodox_right_led_3_on(); diff --git a/keyboards/handwired/woodpad/keymaps/drashna/keymap.c b/keyboards/handwired/woodpad/keymaps/drashna/keymap.c index 4a2893e4aad6..6ec7f52fd6a2 100644 --- a/keyboards/handwired/woodpad/keymaps/drashna/keymap.c +++ b/keyboards/handwired/woodpad/keymaps/drashna/keymap.c @@ -14,37 +14,21 @@ * along with this program. If not, see . */ #include "woodpad.h" +#include "drashna.h" -// 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 _NUMLOCK 0 -#define _NAV 1 -#define _DIABLO 2 -#define _MACROS 3 -#define _MEDIA 4 + // 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. // Fillers to make layering more clear #define _______ KC_TRNS #define XXXXXXX KC_NO -#ifdef RGBLIGHT_ENABLE -#define rgblight_set_blue rgblight_sethsv (0xFF, 0xFF, 0xFF); -#define rgblight_set_red rgblight_sethsv (0x00, 0xFF, 0xFF); -#define rgblight_set_green rgblight_sethsv (0x78, 0xFF, 0xFF); -#define rgblight_set_orange rgblight_sethsv (0x1E, 0xFF, 0xFF); -#define rgblight_set_teal rgblight_sethsv (0xC3, 0xFF, 0xFF); -#define rgblight_set_magenta rgblight_sethsv (0x12C, 0xFF, 0xFF); -#define rgblight_set_yellow rgblight_sethsv (0x3C, 0xFF, 0xFF); -#define rgblight_set_purple rgblight_sethsv (0x10E, 0xFF, 0xFF); -#endif //define layer change stuff for underglow indicator bool skip_leds = false; -bool is_overwatch = false; - #ifdef TAP_DANCE_ENABLE //define diablo macro timer variables @@ -54,76 +38,61 @@ static uint8_t diablo_key_time[4]; bool check_dtimer(uint8_t dtimer) { - // has the correct number of seconds elapsed (as defined by diablo_times) - return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; + // has the correct number of seconds elapsed (as defined by diablo_times) + return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; }; #endif -enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - KC_DIABLO_CLEAR, - KC_OVERWATCH, - KC_SALT, - KC_MORESALT, - KC_SALTHARD, - KC_GOODGAME, - KC_SYMM, - KC_DOOMFIST, - KC_JUSTGAME, - KC_GLHF, - KC_TORB, - KC_MAKE -}; #ifdef TAP_DANCE_ENABLE enum { - TD_DIABLO_1 = 0, - TD_DIABLO_2, - TD_DIABLO_3, - TD_DIABLO_4 + TD_DIABLO_1 = 0, + TD_DIABLO_2, + TD_DIABLO_3, + TD_DIABLO_4 }; // Cycle through the times for the macro, starting at 0, for disabled. // Max of six values, so don't exceed void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) { - if (state->count >= 7) { - diablo_key_time[diablo_key] = diablo_times[0]; - reset_tap_dance(state); - } - else { - diablo_key_time[diablo_key] = diablo_times[state->count - 1]; - } + if (state->count >= 7) { + diablo_key_time[diablo_key] = diablo_times[0]; + reset_tap_dance(state); + } + else { + diablo_key_time[diablo_key] = diablo_times[state->count - 1]; + } } // Would rather have one function for all of this, but no idea how to do that... void diablo_tapdance1(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 0); + diablo_tapdance_master(state, user_data, 0); } void diablo_tapdance2(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 1); + diablo_tapdance_master(state, user_data, 1); } void diablo_tapdance3(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 2); + diablo_tapdance_master(state, user_data, 2); } void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 3); + diablo_tapdance_master(state, user_data, 3); } //Tap Dance Definitions qk_tap_dance_action_t tap_dance_actions[] = { - // tap once to disable, and more to enable timed micros - [TD_DIABLO_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), - [TD_DIABLO_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), - [TD_DIABLO_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), - [TD_DIABLO_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), + // tap once to disable, and more to enable timed micros + [TD_DIABLO_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), + [TD_DIABLO_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), + [TD_DIABLO_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), + [TD_DIABLO_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), }; #endif @@ -170,7 +139,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_SALT, KC_MORESALT, KC_SALTHARD, KC_GLHF \ ), [_MEDIA] = KEYMAP( /* Base */ - RESET, KC_MUTE, KC_VOLD, KC_VOLU,\ + KC_RESET, KC_MUTE, KC_VOLD, KC_VOLU,\ KC_MAKE, _______, RGB_HUI, RGB_HUD, \ KC_MPLY, KC_MSTP, KC_MPRV, KC_MNXT, \ RGB_TOG, RGB_MOD, RGB_SAI, RGB_VAI, \ @@ -181,249 +150,89 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { void numlock_led_on(void) { - PORTF |= (1<<7); + PORTF |= (1 << 7); } void numlock_led_off(void) { - PORTF &= ~(1<<7); + PORTF &= ~(1 << 7); } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - uint16_t kc; - if (is_overwatch) { - kc = KC_BSPC; - } else { - kc = KC_ENTER; - } - switch (keycode) { +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { #ifdef TAP_DANCE_ENABLE - case KC_DIABLO_CLEAR: // reset all Diable timers, disabling them - if (record->event.pressed) { - uint8_t dtime; - - for (dtime = 0; dtime < 4; dtime++) { - diablo_key_time[dtime] = diablo_times[0]; - } - } - return false; - break; -#endif - case KC_OVERWATCH: - if (record->event.pressed) { - is_overwatch = !is_overwatch; - } -#ifdef RGBLIGHT_ENABLE - is_overwatch ? rgblight_mode(17) : rgblight_mode(18); -#endif - return false; - break; - case KC_SALT: - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("Salt, salt, salt..."); - register_code(KC_ENTER); - unregister_code(KC_ENTER); - } - return false; - break; - case KC_MORESALT: - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("Please sir, can I have some more salt?!"); - register_code(KC_ENTER); - unregister_code(KC_ENTER); - } - return false; - break; - case KC_SALTHARD: - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("Your salt only makes my penis that much harder, and even more aggressive!"); - register_code(KC_ENTER); - unregister_code(KC_ENTER); - } - return false; - break; - case KC_GOODGAME: - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("Good game, everyone!"); - register_code(KC_ENTER); - unregister_code(KC_ENTER); - } - return false; - break; - case KC_GLHF: - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("Good luck, have fun!!!"); - register_code(KC_ENTER); - unregister_code(KC_ENTER); - } - return false; - break; - case KC_SYMM: - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("Left click to win!"); - register_code(KC_ENTER); - unregister_code(KC_ENTER); - } - return false; - break; - case KC_DOOMFIST: - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("Hey, look at me. I'm Doomfist, and I'm overpowered! All I do is spam punches all day! I'm DPS, tank and defense, rolled into one! All I need is team healing to be complete!"); - register_code(KC_ENTER); - unregister_code(KC_ENTER); - } - return false; - break; - case KC_JUSTGAME: - - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("It may be a game, but if you don't want to actually try, please go play AI, so that people that actually want to take the game seriously and \"get good\" have a place to do so without trolls like you throwing games."); - register_code(KC_ENTER); - unregister_code(KC_ENTER); - } - return false; - break; - case KC_TORB: - - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("That was positively riveting!"); - register_code(KC_ENTER); - unregister_code(KC_ENTER); - } - return false; - break; - case KC_MAKE: - if (!record->event.pressed) { - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP SS_TAP(X_ENTER)); - } - return false; - break; - + case KC_DIABLO_CLEAR: // reset all Diable timers, disabling them + if (record->event.pressed) { + uint8_t dtime; + for (dtime = 0; dtime < 4; dtime++) { + diablo_key_time[dtime] = diablo_times[0]; + } + } + return false; + break; +#endif } return true; } + #ifdef TAP_DANCE_ENABLE // Sends the key press to system, but only if on the Diablo layer void send_diablo_keystroke(uint8_t diablo_key) { - if (biton32(layer_state) == _DIABLO) { - switch (diablo_key) { - case 0: - SEND_STRING("1"); - break; - case 1: - SEND_STRING("2"); - break; - case 2: - SEND_STRING("3"); - break; - case 3: - SEND_STRING("4"); - break; - } + if (biton32(layer_state) == _DIABLO) { + switch (diablo_key) { + case 0: + SEND_STRING("1"); + break; + case 1: + SEND_STRING("2"); + break; + case 2: + SEND_STRING("3"); + break; + case 3: + SEND_STRING("4"); + break; } + } } // Checks each of the 4 timers/keys to see if enough time has elapsed // Runs the "send string" command if enough time has passed, and resets the timer. void run_diablo_macro_check(void) { - uint8_t dtime; + uint8_t dtime; - for (dtime = 0; dtime < 4; dtime++) { - if (check_dtimer(dtime) && diablo_key_time[dtime]) { - diablo_timer[dtime] = timer_read(); - send_diablo_keystroke(dtime); - } + for (dtime = 0; dtime < 4; dtime++) { + if (check_dtimer(dtime) && diablo_key_time[dtime]) { + diablo_timer[dtime] = timer_read(); + send_diablo_keystroke(dtime); } + } } #endif -void matrix_init_user(void) { - // set Numlock LED to output and low - DDRF |= (1<<7); - PORTF &= ~(1<<7); - -#ifdef RGBLIGHT_ENABLE - rgblight_enable(); - rgblight_set_teal; - rgblight_mode(1); -#endif +void matrix_init_keymap(void) { + // set Numlock LED to output and low + DDRF |= (1 << 7); + PORTF &= ~(1 << 7); - if (!(host_keyboard_leds() & (1 << USB_LED_NUM_LOCK)) ){ - register_code(KC_NUMLOCK); - unregister_code(KC_NUMLOCK); - } + + if (!(host_keyboard_leds() & (1 << USB_LED_NUM_LOCK))) { + register_code(KC_NUMLOCK); + unregister_code(KC_NUMLOCK); + } } -void matrix_scan_user(void) { - numlock_led_off(); - if (is_overwatch && biton32(layer_state) == _MACROS) { - numlock_led_on(); - } +void matrix_scan_keymap(void) { + numlock_led_off(); + if (is_overwatch && biton32(layer_state) == _MACROS) { + numlock_led_on(); + } - // Run Diablo 3 macro checking code. + // Run Diablo 3 macro checking code. #ifdef TAP_DANCE_ENABLE - run_diablo_macro_check(); + run_diablo_macro_check(); #endif } -uint32_t layer_state_set_kb(uint32_t state) { -#ifdef RGBLIGHT_ENABLE -// Check layer, and apply color if its changed since last check - switch (biton32(state)) { - case _NAV: - rgblight_set_blue; - rgblight_mode(1); - break; - case _MACROS: - rgblight_set_orange; - is_overwatch ? rgblight_mode(17) : rgblight_mode(18); - break; - case _DIABLO: - rgblight_set_red; - rgblight_mode(5); - break; - case _MEDIA: - rgblight_set_green; - rgblight_mode(22); - break; - default: - rgblight_set_teal; - rgblight_mode(1); - break; - } - -#endif - return state; -} -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/nyquist/keymaps/333fred/README.md b/keyboards/nyquist/keymaps/333fred/README.md index cc35aff197fc..aa783af07f5f 100644 --- a/keyboards/nyquist/keymaps/333fred/README.md +++ b/keyboards/nyquist/keymaps/333fred/README.md @@ -5,7 +5,7 @@ This nyquist layout is based on my Ergodox Infinity Layout, which is [here](../. ## 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. +The shift modifiers on this layer all use OSM to allow for quick single capitalization. LwrVIM acts a combo one-shot toggle and momentary layer toggle. Tap once to make the next key be sent on the Lower. Hold to move to the Lower layer until release. Tap and hold (so press, release, press and hold) to move to the VIM layer until release. Game is a regular toggle layer. ``` Qwerty @@ -14,11 +14,11 @@ Qwerty |------+------+------+------+------+------+------+------+------+------+------+------| | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | |------+------+------+------+------+-------------+------+------+------+------+------| -| Esc | A | S | D |LTVIMF| G | H | J | K | L | ; | " | +| Esc | A | S | D | F | G | H | J | K | L | ; | " | |------+------+------+------+------+------|------+------+------+------+------+------| | Shift| Z | X | C | V | B | N | M | , | . |/ Ctrl| Shift| |------+------+------+------+------+------+------+------+------+------+------+------| -| Ctrl | Alt | F4 | GUI |Lower | Bksp | Spc | Ent | Lock | = | Game | Del | +| Ctrl | Alt | F4 | GUI |LwrVIM| Bksp | Spc | Ent | Lock | = | RAlt | Del | `-----------------------------------------------------------------------------------' ``` @@ -36,7 +36,7 @@ Lower |------+------+------+------+------+------|------+------+------+------+------+------| | APscr| % | ^ | [ | ] | ~ | 1 | 2 | 3 | \ | Vol- | Vol+ | |------+------+------+------+------+------+------+------+------+------+------+------| -| Pscr | | | | | | 0 | . | = | Prev | Next | Play | +| Pscr | | | | | GAME | 0 | . | = | Prev | Next | Play | `-----------------------------------------------------------------------------------' ``` diff --git a/keyboards/nyquist/keymaps/333fred/keymap.c b/keyboards/nyquist/keymaps/333fred/keymap.c index dfbcd5285642..ab47336a2df5 100644 --- a/keyboards/nyquist/keymaps/333fred/keymap.c +++ b/keyboards/nyquist/keymaps/333fred/keymap.c @@ -1,20 +1,18 @@ #include "nyquist.h" #include "action_layer.h" +#include "action_util.h" #include "eeconfig.h" +#include "333fred.h" extern keymap_config_t keymap_config; -#define _QWERTY 0 -#define _LOWER 1 -#define _VIM 2 -#define _GAME 3 - enum custom_macros { DLEFT, DRIGHT, PSCREEN_APP }; +// Tap dance for layer transitions // Fillers to make layering more clear #define _______ KC_TRNS #define XXXXXXX KC_NO @@ -27,22 +25,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+------+------+------+------+------| * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D |LTVIMF| G | H | J | K | L | ; | " | + * | Esc | A | S | D | F | 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 | + * | Ctrl | Alt | F4 | GUI |Lwr/VM| Bksp | Spc | Ent | Lock | = | Alt | Del | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = KEYMAP( \ +[BASE] = 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, \ + KC_ESC, KC_A, KC_S, KC_D, 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_LOCK, KC_EQL, TG(_GAME), KC_DEL \ + KC_LCTL, KC_LALT, KC_F4, KC_LGUI, TD(TD_SYM_VIM), KC_BSPC, KC_SPC, KC_ENT, KC_LOCK, KC_EQL, KC_RALT, KC_DEL \ ), -/* Lower +/* Symbols * ,-----------------------------------------------------------------------------------. * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | * |------+------+------+------+------+-------------+------+------+------+------+------| @@ -52,36 +50,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | APscr| % | ^ | [ | ] | ~ | 1 | 2 | 3 | \ | Vol- | Vol+ | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Pscr | | | | | | 0 | . | = | Prev | Next | Play | + * | Pscr | | | | | GAME | 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 \ +[SYMB] = 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, _______, _______, _______, _______, TG(GAME), KC_0, KC_DOT, KC_EQL, KC_MPRV, KC_MNXT, KC_MPLY \ ), /* Vim Movement (Hold down F) * ,-----------------------------------------------------------------------------------. * | | | | | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | + * | | | | LSHFT| | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | DLeft|DRight| LCTRL| | | Left | Down | Up | Right| | | + * | | DLeft|DRight| LCTRL| LGUI | | Left | Down | Up | Right| | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | LShft| | | | | | | | + * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_VIM] = KEYMAP( \ +[VIM] = KEYMAP( \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, M(DLEFT), M(DRIGHT), KC_LCTL, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, M(DLEFT), M(DRIGHT), KC_LCTL, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______ \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), /* Gaming mode (Raise) @@ -98,12 +96,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Enter| | Lock | Bksp | Alt | Spc | Lower| Left | Up | Down | Right|QWERTY| * `-----------------------------------------------------------------------------------' */ -[_GAME] = KEYMAP( \ +[GAME] = KEYMAP( \ KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ KC_LCTL, _______, _______, _______, KC_F, _______, _______, _______, _______, _______, _______, _______, \ KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, \ - KC_ENT, _______, KC_LOCK, KC_BSPC, KC_LALT, KC_SPC, OSL(_LOWER), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(_QWERTY) \ + KC_ENT, _______, KC_LOCK, KC_BSPC, KC_LALT, KC_SPC, OSL(SYMB), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(BASE) \ ) }; @@ -133,3 +131,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { } return MACRO_NONE; } + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + tap_dance_process_record(keycode); + return true; +} diff --git a/keyboards/nyquist/keymaps/333fred/rules.mk b/keyboards/nyquist/keymaps/333fred/rules.mk index f8544328074c..5a3543a6f664 100644 --- a/keyboards/nyquist/keymaps/333fred/rules.mk +++ b/keyboards/nyquist/keymaps/333fred/rules.mk @@ -1,6 +1,7 @@ KEY_LOCK_ENABLE = yes NKRO_ENABLE = yes -CONSOLE_ENABLE = yes +CONSOLE_ENABLE = no +TAP_DANCE_ENABLE = yes ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index de7d4e10806e..68c9a1313d31 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -20,8 +20,7 @@ along with this program. If not, see . */ #include "orthodox.h" -#include "action_layer.h" -#include "eeconfig.h" +#include "drashna.h" extern keymap_config_t keymap_config; @@ -29,85 +28,24 @@ extern keymap_config_t keymap_config; // 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 _WORKMAN 3 -#define _LOWER 8 -#define _RAISE 9 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - WORKMAN, - LOWER, - RAISE, - ADJUST, - KC_MAKE -}; // Fillers to make layering more clear #define _______ KC_TRNS #define XXXXXXX KC_NO -#ifdef RGBLIGHT_ENABLE -#define rgblight_set_blue rgblight_sethsv (0xFF, 0xFF, 0xFF); -#define rgblight_set_red rgblight_sethsv (0x00, 0xFF, 0xFF); -#define rgblight_set_green rgblight_sethsv (0x78, 0xFF, 0xFF); -#define rgblight_set_orange rgblight_sethsv (0x1E, 0xFF, 0xFF); -#define rgblight_set_teal rgblight_sethsv (0xC3, 0xFF, 0xFF); -#define rgblight_set_magenta rgblight_sethsv (0x12C, 0xFF, 0xFF); -#define rgblight_set_yellow rgblight_sethsv (0x3C, 0xFF, 0xFF); -#define rgblight_set_purple rgblight_sethsv (0x10E, 0xFF, 0xFF); -#endif - - -#ifdef TAP_DANCE_ENABLE -enum { - TD_FLSH = 0, -}; - - - - - -// on the fourth tap, set the keyboard on flash state -// and set the underglow to red, because red == bad -void dance_flsh_finished(qk_tap_dance_state_t *state, void *user_data) { - if (state->count >= 4) { -#ifdef RGBLIGHT_ENABLE - rgblight_mode(1); - rgblight_setrgb(0xff, 0x00, 0x00); -#endif - reset_tap_dance(state); - reset_keyboard(); - } -} - - - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - //Once for Blue, Twice for Green, Thrice for Red, and four to flash - [TD_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_flsh_finished, NULL), - -}; -#endif const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QWERTY] = KEYMAP( \ +[_QWERTY] = KEYMAP(\ KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_UP, XXXXXXX, KC_DOWN, KC_LEFT, XXXXXXX, KC_RIGHT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \ ), [_COLEMAK] = KEYMAP(\ - KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_UP, XXXXXXX, KC_DOWN, KC_LEFT, XXXXXXX, KC_RIGHT, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \ + KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_UP, XXXXXXX, KC_DOWN, KC_LEFT, XXXXXXX, KC_RIGHT, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \ ), [_DVORAK] = KEYMAP(\ @@ -121,189 +59,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \ ), -[_LOWER] = KEYMAP( \ +[_LOWER] = KEYMAP(\ 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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, XXXXXXX, KC_F12, _______, XXXXXXX, KC_RCTL, KC_F11, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - TD(TD_FLSH),KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, _______, _______, KC_F12, KC_HOME, KC_COMM, KC_DOT, KC_END, _______ \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, XXXXXXX, KC_F12, _______, XXXXXXX, KC_RCTL, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + TD(TD_FLSH),KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_HOME, KC_COMM, KC_DOT, KC_END, _______ \ ), -[_RAISE] = KEYMAP( \ +[_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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, XXXXXXX, KC_F12, _______, XXXXXXX, _______, KC_F11, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, _______, _______, KC_F12, KC_PGUP, KC_COMM, KC_DOT, KC_PGDN, _______ \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, XXXXXXX, KC_F12, _______, XXXXXXX, _______, XXXXXXX, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_PGUP, KC_COMM, KC_DOT, KC_PGDN, _______ \ ), -[_ADJUST] = KEYMAP( \ - KC_MAKE, RESET, TD(TD_FLSH), _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, _______, XXXXXXX, _______, _______, XXXXXXX, _______, AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN, _______, \ +[_ADJUST] = KEYMAP(\ + KC_MAKE, KC_RESET, TD(TD_FLSH), _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, _______, XXXXXXX, _______, _______, XXXXXXX, _______, AG_SWAP, KC_QWERTY, KC_COLEMAK, KC_DVORAK, KC_WORKMAN, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, MAGIC_TOGGLE_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY \ ) }; -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -float tone_workman[][2] = SONG(PLOVER_SONG); -#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_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - persistent_default_layer_set(1UL << _DVORAK); - } - return false; - break; - case WORKMAN: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_workman); - #endif - persistent_default_layer_set(1UL << _WORKMAN); - } - 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; - case KC_MAKE: - if (!record->event.pressed) { -#ifdef RGBLIGHT_ENABLE - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP SS_TAP(X_ENTER)); -#else - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP " RGBLIGHT_ENABLE=no"SS_TAP(X_ENTER)); -#endif - } - return false; - break; - - } - return true; -} - -void matrix_init_user(void) { // Runs boot tasks for keyboard -#ifdef RGBLIGHT_ENABLE - uint8_t default_layer = eeconfig_read_default_layer(); - - rgblight_enable(); - if (default_layer & (1UL << _COLEMAK)) { - rgblight_set_magenta; -} - else if (default_layer & (1UL << _DVORAK)) { - rgblight_set_green; - } - else if (default_layer & (1UL << _WORKMAN)) { - rgblight_set_purple; - } - else { - rgblight_set_teal; - } -#endif - -}; - -void matrix_scan_user(void) { // runs frequently to update info - -}; - -uint32_t layer_state_set_kb(uint32_t state) { // runs on layer switch -#ifdef RGBLIGHT_ENABLE - uint8_t default_layer = eeconfig_read_default_layer(); - switch (biton32(state)) { - case _COLEMAK: - rgblight_set_magenta; - rgblight_mode(1); - break; - case _DVORAK: - rgblight_set_green; - rgblight_mode(1); - break; - case _RAISE: - rgblight_set_yellow; - rgblight_mode(5); - break; - case _LOWER: - rgblight_set_orange; - rgblight_mode(5); - break; - case _ADJUST: - rgblight_set_red; - rgblight_mode(23); - break; - case 6: - rgblight_set_blue; - break; - case _QWERTY: - if (default_layer & (1UL << _COLEMAK)) { - rgblight_set_magenta; - } - else if (default_layer & (1UL << _DVORAK)) { - rgblight_set_green; - } - else if (default_layer & (1UL << _WORKMAN)) { - rgblight_set_purple; - } - else { - rgblight_set_teal; - } - rgblight_mode(1); - break; - } -#endif - return state; -} diff --git a/keyboards/viterbi/keymaps/drashna/keymap.c b/keyboards/viterbi/keymaps/drashna/keymap.c index acddcb741871..b33f05027216 100644 --- a/keyboards/viterbi/keymaps/drashna/keymap.c +++ b/keyboards/viterbi/keymaps/drashna/keymap.c @@ -1,6 +1,7 @@ #include "viterbi.h" #include "action_layer.h" #include "eeconfig.h" +#include "drashna.h" extern keymap_config_t keymap_config; @@ -8,55 +9,21 @@ extern keymap_config_t keymap_config; // 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 _NUMNAV 0 -#define _DIABLO 1 -#define _GAMEPAD 2 -#define _MACROS 3 -#define _MEDIA 4 -#define _COVECUBE 5 - - -enum custom_keycodes { - KC_DIABLO_CLEAR = SAFE_RANGE, - KC_P00, - KC_MAKE, - KC_OVERWATCH, - KC_SALT, - KC_MORESALT, - KC_SALTHARD, - KC_GOODGAME, - KC_SYMM, - KC_DOOMFIST, - KC_JUSTGAME, - KC_GLHF, - KC_TORB, - KC_AIM -}; + // Fillers to make layering more clear #define _______ KC_TRNS #define XXXXXXX KC_NO -#define MACROS TG(_MACROS) + +#define LMACRO TG(_MACROS) #define DIABLO TG(_DIABLO) -#define GAMEPAD TG(_GAMEPAD) +#define GAMEPAD TG(_OVERWATCH) #define MEDIA TG(_MEDIA) #define COVECUBE TG(_COVECUBE) -bool is_overwatch = false; -#ifdef RGBLIGHT_ENABLE -#define rgblight_set_blue rgblight_sethsv (0xFF, 0xFF, 0xFF); -#define rgblight_set_red rgblight_sethsv (0x00, 0xFF, 0xFF); -#define rgblight_set_green rgblight_sethsv (0x78, 0xFF, 0xFF); -#define rgblight_set_orange rgblight_sethsv (0x1E, 0xFF, 0xFF); -#define rgblight_set_teal rgblight_sethsv (0xC3, 0xFF, 0xFF); -#define rgblight_set_magenta rgblight_sethsv (0x12C, 0xFF, 0xFF); -#define rgblight_set_yellow rgblight_sethsv (0x3C, 0xFF, 0xFF); -#define rgblight_set_purple rgblight_sethsv (0x10E, 0xFF, 0xFF); -#endif - #ifdef TAP_DANCE_ENABLE //define diablo macro timer variables static uint16_t diablo_timer[4]; @@ -65,58 +32,58 @@ static uint8_t diablo_key_time[4]; bool check_dtimer(uint8_t dtimer) { - // has the correct number of seconds elapsed (as defined by diablo_times) - return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; + // has the correct number of seconds elapsed (as defined by diablo_times) + return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; }; enum { - TD_DIABLO_1 = 0, - TD_DIABLO_2, - TD_DIABLO_3, - TD_DIABLO_4 + TD_DIABLO_1 = 0, + TD_DIABLO_2, + TD_DIABLO_3, + TD_DIABLO_4 }; // Cycle through the times for the macro, starting at 0, for disabled. // Max of six values, so don't exceed void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) { - if (state->count >= 7) { - diablo_key_time[diablo_key] = diablo_times[0]; - reset_tap_dance(state); - } - else { - diablo_key_time[diablo_key] = diablo_times[state->count - 1]; - } + if (state->count >= 7) { + diablo_key_time[diablo_key] = diablo_times[0]; + reset_tap_dance(state); + } + else { + diablo_key_time[diablo_key] = diablo_times[state->count - 1]; + } } // Would rather have one function for all of this, but no idea how to do that... void diablo_tapdance1(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 0); + diablo_tapdance_master(state, user_data, 0); } void diablo_tapdance2(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 1); + diablo_tapdance_master(state, user_data, 1); } void diablo_tapdance3(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 2); + diablo_tapdance_master(state, user_data, 2); } void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 3); + diablo_tapdance_master(state, user_data, 3); } //Tap Dance Definitions qk_tap_dance_action_t tap_dance_actions[] = { - // tap once to disable, and more to enable timed micros - [TD_DIABLO_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), - [TD_DIABLO_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), - [TD_DIABLO_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), - [TD_DIABLO_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), + // tap once to disable, and more to enable timed micros + [TD_DIABLO_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), + [TD_DIABLO_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), + [TD_DIABLO_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), + [TD_DIABLO_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), }; #endif @@ -124,8 +91,8 @@ qk_tap_dance_action_t tap_dance_actions[] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_NUMNAV] = KEYMAP( - MACROS, DIABLO, GAMEPAD, KC_NLCK, KC_SLCK, KC_COLN, KC_PSLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + [_NUMLOCK] = KEYMAP( + LMACRO, DIABLO, GAMEPAD, KC_NLCK, KC_SLCK, KC_COLN, KC_PSLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ MEDIA, KC_CALC, COVECUBE,KC_P7, KC_P8, KC_P9, KC_PAST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ KC_HOME, KC_DEL, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PMNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ KC_END, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_PPLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ @@ -136,12 +103,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, DIABLO, KC_V, KC_D, XXXXXXX, XXXXXXX, KC_L, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ KC_TAB, KC_S, KC_F, KC_I, KC_M, KC_T, KC_J, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G, KC_F, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_LCTL, (TD_DIABLO_1), TD(TD_DIABLO_2), TD(TD_DIABLO_3), TD(TD_DIABLO_4), KC_Z, KC_DIABLO_CLEAR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_LCTL, TD(TD_DIABLO_1), TD(TD_DIABLO_2), TD(TD_DIABLO_3), TD(TD_DIABLO_4), KC_Z, KC_DIABLO_CLEAR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ KC_LALT, KC_F4, KC_F5, KC_F8, KC_F9, KC_F10, SFT_T(KC_SPACE), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ ), - - [_GAMEPAD] = KEYMAP( // Game pad layout designed primarily for Overwatch - MACROS, KC_ESC, GAMEPAD, KC_1, KC_2, KC_3, KC_4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + + [_OVERWATCH] = KEYMAP( // Game pad layout designed primarily for Overwatch + LMACRO, KC_ESC, GAMEPAD, KC_1, KC_2, KC_3, KC_4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ MEDIA, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ KC_Z, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ KC_Y, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ @@ -149,7 +116,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_MACROS] = KEYMAP( - MACROS, XXXXXXX, GAMEPAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + LMACRO, XXXXXXX, GAMEPAD, 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, \ KC_SYMM, KC_TORB, KC_DOOMFIST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ KC_GLHF, KC_GOODGAME, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ @@ -165,7 +132,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_MEDIA] = KEYMAP( - RESET, KC_MAKE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_RESET,KC_MAKE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ MEDIA, XXXXXXX, RGB_SAI, RGB_VAI, RGB_M_P, RGB_M_B, RGB_M_R, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ RGB_TOG, RGB_MOD, RGB_SAD, RGB_VAD, RGB_M_SW,RGB_M_SN,RGB_M_K, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ KC_MPLY, KC_MSTP, KC_MPRV, KC_MNXT, RGB_M_K, RGB_M_X, RGB_M_G, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ @@ -177,230 +144,67 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - uint16_t kc; - if (is_overwatch) { - kc = KC_BSPC; - } - else { - kc = KC_ENTER; - } - // Once a delay command is added to "SEND_STRING", - // replace these with X_BSPC and X_ENTER instead. - // and add "SS_TAP(kc) SS_DELAY(50)" to all of the - // SEND_STRING commands, to compress things. - switch (keycode) { +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { #ifdef TAP_DANCE_ENABLE - case KC_DIABLO_CLEAR: // reset all Diable timers, disabling them - if (record->event.pressed) { - uint8_t dtime; - - for (dtime = 0; dtime < 4; dtime++) { - diablo_key_time[dtime] = diablo_times[0]; - } - } - return false; - break; -#endif - case KC_P00: - if (!record->event.pressed) { - register_code(KC_P0); - unregister_code(KC_P0); - register_code(KC_P0); - unregister_code(KC_P0); - } - return false; - break; - case KC_MAKE: - if (!record->event.pressed) { - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP SS_TAP(X_ENTER)); - } - return false; - break; - case KC_OVERWATCH: // reset all Diable timers, disabling them - if (record->event.pressed) { - is_overwatch = !is_overwatch; - } -#ifdef RGBLIGHT_ENABLE - is_overwatch ? rgblight_mode(17) : rgblight_mode(18); -#endif - return false; - break; - case KC_SALT: - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("Salt, salt, salt..." SS_TAP(X_ENTER)); - } - return false; - break; - case KC_MORESALT: - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("Please sir, can I have some more salt?!" SS_TAP(X_ENTER)); - } - return false; - break; - case KC_SALTHARD: - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("Your salt only makes my penis that much harder, and even more aggressive!" SS_TAP(X_ENTER)); - } - return false; - break; - case KC_GOODGAME: - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("Good game, everyone!" SS_TAP(X_ENTER)); - } - return false; - break; - case KC_GLHF: - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("Good luck, have fun!!!" SS_TAP(X_ENTER)); - } - return false; - break; - case KC_SYMM: - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("Left click to win!" SS_TAP(X_ENTER)); - } - return false; - break; - case KC_JUSTGAME: - - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("It may be a game, but if you don't want to actually try, please go play AI, so that people that actually want to take the game seriously and \"get good\" have a place to do so without trolls like you throwing games." SS_TAP(X_ENTER)); - } - return false; - break; - case KC_TORB: - - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("That was positively riveting! SS_TAP(X_ENTER)"); - } - return false; - break; - case KC_AIM: - - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("That aim is absolutely amazing. It's almost like you're a machine!" SS_TAP(X_ENTER)); - _delay_ms(50); - SEND_STRING("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!" SS_TAP(X_ENTER)); - } - return false; - break; - + case KC_DIABLO_CLEAR: // reset all Diable timers, disabling them + if (record->event.pressed) { + uint8_t dtime; + for (dtime = 0; dtime < 4; dtime++) { + diablo_key_time[dtime] = diablo_times[0]; + } } - return true; + return false; + break; +#endif + } + return true; } #ifdef TAP_DANCE_ENABLE // Sends the key press to system, but only if on the Diablo layer void send_diablo_keystroke(uint8_t diablo_key) { - if (biton32(layer_state) == _DIABLO) { - switch (diablo_key) { - case 0: - SEND_STRING("1"); - break; - case 1: - SEND_STRING("2"); - break; - case 2: - SEND_STRING("3"); - break; - case 3: - SEND_STRING("4"); - break; - } + if (biton32(layer_state) == _DIABLO) { + switch (diablo_key) { + case 0: + SEND_STRING("1"); + break; + case 1: + SEND_STRING("2"); + break; + case 2: + SEND_STRING("3"); + break; + case 3: + SEND_STRING("4"); + break; } + } } // Checks each of the 4 timers/keys to see if enough time has elapsed // Runs the "send string" command if enough time has passed, and resets the timer. void run_diablo_macro_check(void) { - uint8_t dtime; + uint8_t dtime; - for (dtime = 0; dtime < 4; dtime++) { - if (check_dtimer(dtime) && diablo_key_time[dtime]) { - diablo_timer[dtime] = timer_read(); - send_diablo_keystroke(dtime); - } + for (dtime = 0; dtime < 4; dtime++) { + if (check_dtimer(dtime) && diablo_key_time[dtime]) { + diablo_timer[dtime] = timer_read(); + send_diablo_keystroke(dtime); } + } } #endif -void matrix_init_user(void) { // Runs boot tasks for keyboard -#ifdef RGBLIGHT_ENABLE - rgblight_enable(); - rgblight_set_teal; - rgblight_mode(1); -#endif -}; - -void matrix_scan_user(void) { // runs frequently to update info +void matrix_scan_keymap(void) { // runs frequently to update info #ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. - run_diablo_macro_check(); + run_diablo_macro_check(); #endif }; - -uint32_t layer_state_set_kb(uint32_t state) { -#ifdef RGBLIGHT_ENABLE - rgblight_enable(); - switch (biton32(state)) { - case _NUMNAV: - rgblight_set_teal; - rgblight_mode(2); - break; - case _MACROS: - rgblight_set_orange; - is_overwatch ? rgblight_mode(17) : rgblight_mode(18); - break; - case _DIABLO: - rgblight_set_red; - rgblight_mode(5); - break; - case _GAMEPAD: - rgblight_set_yellow; - rgblight_mode(1); - break; - case _MEDIA: - rgblight_set_blue; - rgblight_mode(1); - break; - case _COVECUBE: - rgblight_set_green; - rgblight_mode(2); - } -#endif - return state; -} diff --git a/keyboards/xd60/keymaps/petesmom/README.md b/keyboards/xd60/keymaps/petesmom/README.md new file mode 100644 index 000000000000..dceb402d722b --- /dev/null +++ b/keyboards/xd60/keymaps/petesmom/README.md @@ -0,0 +1,26 @@ +# pete's mom Layout + +Customized xd60 keymap based on yuuki's but a step sideways with Mac support. For Pete on his 40th + +## Programming Instructions + +Change the layout in `keymap.c` then run `make xd60-petesmom`. The compiled file will be located in `.build/xd60_petesmom.hex` relative to the project root. To flash it onto your keyboard, use whatever program works on your OS. I personally use `dfu-programmer`, and run: + +* `sudo dfu-programmer atmega32u4 erase` +* `sudo dfu-programmer atmega32u4 flash .build/xd60-petesmom.hex` +* `sudo dfu-programmer atmega32u4 start` + +## Layout + +See `keymap.c` for the details, but here are the important features: + +| Key | Function | +| -------------------------- | ---------------------------------- | +| ESC | ESC when pressed alone but acts as ~ when pressed with Shift or LGUI down | +| FN + ESC | Grave | +| Right Shift | When tapped generates / | +| FN + HJKL | Arrow Keys | +| FN + C | ^ | +| FN + V | & | +| FN + , . RShift | Mac Vol - + Mute | +| FN + P [ ] \ | Mac Play/Pause, Prev Track, Next Track, Stop | diff --git a/keyboards/xd60/keymaps/petesmom/keymap.c b/keyboards/xd60/keymaps/petesmom/keymap.c new file mode 100644 index 000000000000..71bb7fb811b5 --- /dev/null +++ b/keyboards/xd60/keymaps/petesmom/keymap.c @@ -0,0 +1,28 @@ +#include "xd60.h" +#include "action_layer.h" + +#define BASE 0 +#define FN 1 + +#define CTL_SLSH CTL_T(KC_SLSH) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // 0: Base Layer + [BASE] = KEYMAP( + KC_GESC, 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_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, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_NO, RSFT_T(KC_SLASH), KC_UP, KC_RCTL, \ + CTL_SLSH, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(FN), KC_LEFT, KC_DOWN, KC_RIGHT + ), + // 1: Function Layer + [FN] = KEYMAP( + 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_DEL, KC_DEL, \ + KC_TRNS, RGB_MOD, RGB_VAI, KC_TRNS, KC_TRNS, KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MRWD, KC_MFFD, KC_MSTP, \ + KC_TRNS, RGB_TOG, RGB_VAD, KC_MUTE, KC_VOLU, KC_VOLD, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_NO, KC_ENT, \ + KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_CIRC, KC_AMPR, KC_TRNS, KC_TRNS, KC_TRNS,KC__VOLDOWN,KC__VOLUP,KC_NO, KC__MUTE,KC_PGUP, RESET, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDOWN,KC_END + ), + +}; diff --git a/layouts/community/ergodox/333fred/README.md b/layouts/community/ergodox/333fred/README.md index f7b4ca42f4aa..8286de173b9a 100644 --- a/layouts/community/ergodox/333fred/README.md +++ b/layouts/community/ergodox/333fred/README.md @@ -5,24 +5,23 @@ ,--------------------------------------------------. ,--------------------------------------------------. | ` | 1 | 2 | 3 | 4 | 5 | = | | L1 | 6 | 7 | 8 | 9 | 0 | - | |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| TAB | Q | W | E | R | T | L2 | | L2 | Y | U | I | O | P | \ | +| TAB | Q | W | E | R | T | L1 | | L2 | Y | U | I | O | P | \ | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| Esc | A | S | D |LT 3,F| G |------| |------| H | J | K | L |; / : | ' | -|--------+------+------+------+------+------| L1 | |TT(3) |------+------+------+------+------+--------| +| Esc | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | +|--------+------+------+------+------+------| L2 | |TT(3) |------+------+------+------+------+--------| | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | Up | Right| RGUI | `----------------------------------' `----------------------------------' ,-------------. ,-------------. - | Copy | Paste| | Alt |Ctrl/Esc| + | Copy | Paste| | Copy | Paste | ,------|------|------| |------+--------+------. | | | PgUp | | PgDn | | | | Bcksp|OSL(2)|------| |------| Ent |Space | - | | | Del | |OSL(2)| | | + | | VIM | Del | |OSL(2)| | | `--------------------' `----------------------' ``` -* Double-click `;` to get a `:` -* Press-and-hold `f` to go to the movement layer +* For a single tap or single hold, OSL behaves like OSL(SYMB). For a tap + hold, it behaves like MO(VIM). ### Keymap 1: Code Layer ``` @@ -38,7 +37,7 @@ | | | | | | | F12 |GoToIm| FAR | | | `----------------------------------' `----------------------------------' ,-------------. ,---------------. - |Format|Build | | Test | DTest | + |Format|Build | | Copy | Paste | ,------|------|------| |------+--------+------. | | |Refact| |Sort U| | | | | |------| |------| | | @@ -46,13 +45,11 @@ `--------------------' `----------------------' ``` * Build - Visualt Studio Build Solution. Sends `CTRL + SHFT + B` -* DTest - Visual Studio Debug Test. Sends `CTRL + R, CTRL + T` * FAR - Visual Studio Find All References. Sends `CTRL + K, R` * Format - Visual Studio Format. Sends `CTRL + K, CTRL + D` * GoToIm - Visual Studio Go To Implementation. Sends `CTRL + F12` * Refact - Visual Studio Refactor. Sends `CTRL + R, R` * Sort U - Visual Studio Sort Usings. Sends `CTRL + R, CTRL + G` -* Test - Visual Studio Run Test. Sends `CTRL + R, T` ### Keymap 2: Symbol Layer @@ -105,9 +102,9 @@ ,--------------------------------------------------. ,--------------------------------------------------. | | | | | | | | | | | | | | | | |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| |KOpen |KType | | | | | | | Copy | | | | Paste| | +| |KOpen |KType | LSFT | | | | | | Copy | | | | Paste| | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| |DLeft |DRight| LCTL | | |------| |------| Left | Down | Up | Right| | | +| |DLeft |DRight| LCTL | LGUI | |------| |------| Left | Down | Up | Right| | | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | |SFT_TB| Tab | | | | | | | | | | | | | `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' @@ -117,7 +114,7 @@ | | | | Home | End | ,------|------|------| |------+------+------. | | | | | | | | - | | LSFT |------| |------| | | + | | |------| |------| | | | | | | | | | | `--------------------' `--------------------' ``` diff --git a/layouts/community/ergodox/333fred/config.h b/layouts/community/ergodox/333fred/config.h index 6a03446e0321..5e1d2cb39546 100644 --- a/layouts/community/ergodox/333fred/config.h +++ b/layouts/community/ergodox/333fred/config.h @@ -4,7 +4,7 @@ #include QMK_KEYBOARD_CONFIG_H #undef TAPPING_TERM -#define TAPPING_TERM 150 +#define TAPPING_TERM 200 #define PERMISSIVE_HOLD diff --git a/layouts/community/ergodox/333fred/keymap.c b/layouts/community/ergodox/333fred/keymap.c index 3fac44e3988f..8c79b111e086 100644 --- a/layouts/community/ergodox/333fred/keymap.c +++ b/layouts/community/ergodox/333fred/keymap.c @@ -2,12 +2,7 @@ #include "debug.h" #include "action_layer.h" #include "version.h" - -#define BASE 0 // default layer -#define CODE 1 // code layer -#define SYMB 2 // symbols -#define MDIA 3 // media keys -#define MOVE 4 // movement layer +#include "333fred.h" enum custom_keycodes { PLACEHOLDER = SAFE_RANGE, // can always be here @@ -48,20 +43,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,--------------------------------------------------. ,--------------------------------------------------. * | ` | 1 | 2 | 3 | 4 | 5 | = | | L1 | 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | Q | W | E | R | T | L2 | | L2 | Y | U | I | O | P | \ | + * | TAB | Q | W | E | R | T | L1 | | L2 | Y | U | I | O | P | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Esc | A | S | D |LT 3,F| G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| L1 | |MO(3) |------+------+------+------+------+--------| + * | Esc | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |--------+------+------+------+------+------| L2 | |MO(3) |------+------+------+------+------+--------| * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | Up | Right| RGUI | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | Copy | Paste| | Alt | Lock | + * | Copy | Paste| | Copy | Paste | * ,------|------|------| |------+--------+------. * | | | PgUp | | PgDn | | | * | Bcksp|OSL(2)|------| |------| Ent |Space | - * | | | Del | | RCtrl| | | + * | | VIM | Del | | RCtrl| | | * `--------------------' `----------------------' */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. @@ -69,22 +64,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [BASE] = LAYOUT_ergodox( // layer 0 : default // left hand KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_ESC, KC_A, KC_S, KC_D, LT(MOVE, KC_F),KC_G, - OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(CODE), + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(CODE), + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, + OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(SYMB), OSM(MOD_LCTL), KC_F4, KC_F5, KC_LGUI,KC_LALT, - LCTL(KC_C),LCTL(KC_V), - KC_PGUP, - KC_BSPC,OSL(SYMB), KC_DEL, + LCTL(KC_C), LCTL(KC_V), + KC_PGUP, + KC_BSPC,TD(TD_SYM_VIM), KC_DEL, // right hand TG(CODE), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, MO(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), OSM(MOD_RSFT), KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, KC_RGUI, - KC_RALT, KC_LOCK, + LCTL(KC_C), LCTL(KC_V), KC_PGDN, - KC_RCTL, KC_ENT, KC_SPC + KC_RCTL, KC_ENT, KC_SPC ), /* Keymap 1: Code Layer * @@ -100,10 +95,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | F12 |GoToIm| FAR | | | * `----------------------------------' `----------------------------------' * ,-------------. ,---------------. - * |Format|Build | | Test | DTest | + * |Format|Build | | Copy | Paste | * ,------|------|------| |------+--------+------. * | | |Refact| |Sort U| | | - * | | |------| |------| | | + * | |ACCESS|------| |------| | | * | | | | | | | | * `--------------------' `----------------------' */ @@ -126,7 +121,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, M(GO_TO_IMPL),M(FIND_ALL_REF),KC_TRNS, KC_TRNS, - M(TEST), M(DEBUG_TEST), + LCTL(KC_C), LCTL(KC_V), M(REMOVE_SORT_USINGS), KC_TRNS, KC_TRNS, KC_TRNS ), @@ -218,9 +213,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,--------------------------------------------------. ,--------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | |KOpen |KType | | | | | | | Copy | | | | Paste| | + * | |KOpen |KType |LSHFT | | | | | | Copy | | | | Paste| | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |DLeft |DRight|LCTRL |ACCESS| |------| |------| Left | Down | Up | Right| | | + * | |DLeft |DRight|LCTRL | LGUI | |------| |------| Left | Down | Up | Right| | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | |SFT_TB| TAB | | | | | | | | | | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' @@ -230,20 +225,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | Home | End | * ,------|------|------| |------+------+------. * | | | | | | | | - * | |LSHIFT|------| |------| | | + * | |ACCESS|------| |------| | | * | | | | | | | | * `--------------------' `--------------------' */ // MEDIA AND MOUSE -[MOVE] = LAYOUT_ergodox( +[VIM] = LAYOUT_ergodox( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(KEEPASS_OPEN),M(KEEPASS_TYPE),KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(DLEFT), M(DRIGHT), KC_LCTL, KC_TRNS, KC_TRNS, + KC_TRNS, M(KEEPASS_OPEN),M(KEEPASS_TYPE),KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, M(DLEFT), M(DRIGHT), KC_LCTL, KC_LGUI, KC_TRNS, KC_TRNS, M(LSFT_TAB), KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_LSFT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, // right hand KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LCTL(KC_C),KC_TRNS, KC_TRNS, KC_TRNS, LCTL(KC_V),KC_TRNS, @@ -349,6 +344,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { + tap_dance_process_record(keycode); switch (keycode) { // dynamically generate these. case EPRM: diff --git a/layouts/community/ergodox/333fred/rules.mk b/layouts/community/ergodox/333fred/rules.mk index d8e081eaa02a..2a522112e5a8 100644 --- a/layouts/community/ergodox/333fred/rules.mk +++ b/layouts/community/ergodox/333fred/rules.mk @@ -3,6 +3,7 @@ LCD_ENABLE = yes BACKLIGHT_ENABLE = yes NKRO_ENABLE = yes KEY_LOCK_ENABLE = yes - +TAP_DANCE_ENABLE = yes +CONSOLE_ENABLE = no diff --git a/layouts/community/ergodox/qwerty_code_friendly/keymap.c b/layouts/community/ergodox/qwerty_code_friendly/keymap.c index a55a1e8d90fe..ff3e43872fd6 100644 --- a/layouts/community/ergodox/qwerty_code_friendly/keymap.c +++ b/layouts/community/ergodox/qwerty_code_friendly/keymap.c @@ -15,16 +15,25 @@ #define CFQ_USE_DYNAMIC_MACRO #if !defined(CFQ_USER_KEY1) -#define CFQ_USER_KEY1 KC_SPC +#define CFQ_USER_KEY1 CFQ_KC_FN1 #endif #if !defined(CFQ_USER_KEY2) -#define CFQ_USER_KEY2 KC_ENT +#define CFQ_USER_KEY2 KC_INS #endif #if !defined(CFQ_USER_KEY3) #define CFQ_USER_KEY3 CFQ_KC_FN3 #endif #if !defined(CFQ_USER_KEY4) -#define CFQ_USER_KEY4 KC_APP +#define CFQ_USER_KEY4 KC_SPC +#endif +#if !defined(CFQ_USER_KEY5) +#define CFQ_USER_KEY5 KC_ENT +#endif +#if !defined(CFQ_USER_KEY6) +#define CFQ_USER_KEY5 CFQ_KC_FN2 +#endif +#if !defined(CFQ_USER_KEY7) +#define CFQ_USER_KEY5 CFQ_KC_FN1 #endif #define BASE 0 // default layer @@ -93,16 +102,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LCtl |Super | Alt | USR4 |Space | | Left | Down | Up |Right | Del | + * | LCtl |Super | Alt | ~L1 |Space | | Left | Down | Up |Right | Del | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | Ins | USR3 | | Home | End | + * | Ins | ~L3 | | Home | End | * ,------|------|------| |------+------+------. * | | | ~L2 | | PgUp | | | - * | USR1 | USR2 |------| |------|Enter |Space | + * |Space |Enter |------| |------|Enter |Space | * | | | ~L1 | | PgDn | | | * `--------------------' `--------------------' + * + * Optional overrides: see CFQ_USER_KEY# defines. + * + * -------+------+------+------+------+ + * | | | | USR1 | | + * `----------------------------------' + * + * ,-------------. + * | USR2 | USR3 | + * ,------|------|------| + * | | | USR6 | + * | USR4 | USR5 |------| + * | | | USR7 | + * `--------------------' */ + // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* [BASE] = LAYOUT_ergodox( // layer 0 : default @@ -111,10 +135,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LPRN, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, - KC_LCTL, KC_LGUI, KC_LALT, CFQ_USER_KEY4, KC_SPC, - KC_INS, CFQ_USER_KEY3, - CFQ_KC_FN2, - CFQ_USER_KEY1, CFQ_USER_KEY2, CFQ_KC_FN1, + KC_LCTL, KC_LGUI, KC_LALT, CFQ_USER_KEY1, KC_SPC, + CFQ_USER_KEY2, CFQ_USER_KEY3, + CFQ_USER_KEY6, + CFQ_USER_KEY4, CFQ_USER_KEY5, CFQ_USER_KEY7, // right hand KC_RCBR, KC_CIRC, KC_AMPR, KC_ASTR,KC_MINS, KC_EQL, KC_BSPC, KC_RPRN, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, @@ -182,10 +206,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,--------------------------------------------------. ,--------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | + * | | | | MsUp | | |MWhlUp| | | | | | | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | |MsLeft|MsDown|MsRght| |------| |------| Left | Down | Up |Right | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * |--------+------+------+------+------+------|MWhlDn| | |------+------+------+------+------+--------| * | | | Rclk | Mclk | Lclk | | | | | | | | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | | | | | | | | | | | | @@ -202,9 +226,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MDIA] = LAYOUT_ergodox( // left hand KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN2, KC_BTN3, KC_BTN1, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_BTN2, KC_BTN3, KC_BTN1, KC_TRNS, KC_WH_D, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MRWD, KC_MFFD, KC_TRNS, diff --git a/layouts/community/ergodox/qwerty_code_friendly/readme.md b/layouts/community/ergodox/qwerty_code_friendly/readme.md index 52677310c072..6153fb259233 100644 --- a/layouts/community/ergodox/qwerty_code_friendly/readme.md +++ b/layouts/community/ergodox/qwerty_code_friendly/readme.md @@ -27,7 +27,7 @@ Some optional behavior is configurable without editing the code using `CFQ_` prefixed defines which can be set by passing `EXTRAFLAGS` to make. -- `CFQ_USER_KEY1` (1..4) are used for custom-keys +- `CFQ_USER_KEY1` (1..7) are used for custom-keys - `CFQ_USE_MOMENTARY_LAYER_KEYS` is used to prevent layer keys from toggling when tapped. - `CFQ_USE_SWAP_RIGHT_SPACE_ENTER` swap Enter and Space on the right hand thumb cluster. While asymmetric, it makes Enter more easily accessible. @@ -38,14 +38,8 @@ using `CFQ_` prefixed defines which can be set by passing `EXTRAFLAGS` to make. ## Keymap 0: Basic layer -When undefined: - -- `USR1` defaults to `KC_SPC`, otherwise use `CFQ_USER_KEY1`. -- `USR2` defaults to `KC_ENT`, otherwise use `CFQ_USER_KEY2`. -- `USR3` defaults to `KC_FN3`, otherwise use `CFQ_USER_KEY3`. -- `USR4` defaults to `APP`, otherwise use `CFQ_USER_KEY4`. - ``` +Keymap 0: Basic layer ,--------------------------------------------------. ,--------------------------------------------------. | Grave | ! | @ | # | $ | % | { | | } | ^ | & | * | - | = | BSpace | |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| @@ -55,15 +49,29 @@ When undefined: |--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | LCtl |Super | Alt | USR4 |Space | | Left | Down | Up |Right | Del | + | LCtl |Super | Alt | ~L1 |Space | | Left | Down | Up |Right | Del | `----------------------------------' `----------------------------------' ,-------------. ,-------------. - | Ins | USR3 | | Home | End | + | Ins | ~L3 | | Home | End | ,------|------|------| |------+------+------. | | | ~L2 | | PgUp | | | - | USR1 | USR2 |------| |------|Enter |Space | + |Space |Enter |------| |------|Enter |Space | | | | ~L1 | | PgDn | | | `--------------------' `--------------------' + +Optional overrides: see CFQ_USER_KEY# defines + + -------+------+------+------+------+ + | | | | USR1 | | + `----------------------------------' + + ,-------------. + | USR2 | USR3 | + ,------|------|------| + | | | USR6 | + | USR4 | USR5 |------| + | | | USR7 | + `--------------------' ``` ## Keymap 1: Symbol layer @@ -100,10 +108,10 @@ Notes: ,--------------------------------------------------. ,--------------------------------------------------. | | | | | | | | | | | | | | | | |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| | | | MsUp | | | | | | | | | | | | +| | | | MsUp | | |MWhlUp| | | | | | | | | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | | |MsLeft|MsDown|MsRght| |------| |------| Left | Down | Up |Right | | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +|--------+------+------+------+------+------|MWhlDn| | |------+------+------+------+------+--------| | | | Rclk | Mclk | Lclk | | | | | | | | | | | `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' | | | | | | | | | | | | @@ -119,10 +127,14 @@ Notes: ## Changelog +- 2017/11/07 + Make thumb left thumb cluster completely configurable with defines. + Add mouse wheel to mouse layer. + - 2017/10/28 Make more keys user defined on the left thumb cluster. Add macro record/replay keys. -- 2017/10/4 +- 2017/10/04 Move Insert key to the left thumb cluster (away from the modifier keys). Replace with `USR2` which defaults to `APP`. diff --git a/quantum/visualizer/resources/lcd_logo.c b/quantum/visualizer/resources/lcd_logo.c index d1a0ffa7f94a..314776c0b296 100644 --- a/quantum/visualizer/resources/lcd_logo.c +++ b/quantum/visualizer/resources/lcd_logo.c @@ -24,6 +24,7 @@ // Update array in the source code with the C array produced by the conversion program // The image below is generated from lcd_logo.png +__attribute__((weak)) const uint8_t resource_lcd_logo[512] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/tmk_core/common/progmem.h b/tmk_core/common/progmem.h index a09f91be866d..dcc9efb3cef8 100644 --- a/tmk_core/common/progmem.h +++ b/tmk_core/common/progmem.h @@ -7,6 +7,7 @@ # define PROGMEM # define pgm_read_byte(p) *((unsigned char*)p) # define pgm_read_word(p) *((uint16_t*)p) +# define pgm_read_dword(p) *((uint32_t*)p) #endif #endif diff --git a/users/333fred/333fred.c b/users/333fred/333fred.c new file mode 100644 index 000000000000..ef2d741e5b38 --- /dev/null +++ b/users/333fred/333fred.c @@ -0,0 +1,63 @@ +#include "333fred.h" +#include "quantum.h" +#include "action.h" + +typedef enum { + SINGLE_TAP, SINGLE_HOLD, DOUBLE +} tap_dance_state_enum; + +static tap_dance_state_enum tap_dance_state; +static bool tap_dance_active = false; + +void tap_dance_layer_finished(qk_tap_dance_state_t *state, void *user_data) { + // Determine the current state + if (state->count == 1) { + if (state->interrupted || state->pressed == 0) tap_dance_state = SINGLE_TAP; + else tap_dance_state = SINGLE_HOLD; + } else { + // Handle any number of other taps as a VIM movement hold + tap_dance_state = DOUBLE; + } + + switch (tap_dance_state) { + case SINGLE_TAP: + if (tap_dance_active) { + reset_oneshot_layer(); + tap_dance_active = false; + } else { + set_oneshot_layer(SYMB, ONESHOT_START); + tap_dance_active = true; + } + break; + case SINGLE_HOLD: + layer_on(SYMB); + break; + case DOUBLE: + layer_on(VIM); + } +} + + +void tap_dance_layer_reset(qk_tap_dance_state_t *state, void *user_data) { + switch(tap_dance_state) { + case SINGLE_TAP: + clear_oneshot_layer_state(ONESHOT_PRESSED); + break; + case SINGLE_HOLD: + layer_off(SYMB); + break; + case DOUBLE: + layer_off(VIM); + break; + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SYM_VIM] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_layer_finished, tap_dance_layer_reset) +}; + +void tap_dance_process_record(uint16_t keycode) { + if (tap_dance_state == SINGLE_TAP && keycode != TD(TD_SYM_VIM)) { + tap_dance_active = false; + } +} diff --git a/users/333fred/333fred.h b/users/333fred/333fred.h new file mode 100644 index 000000000000..4a0462b7a2b3 --- /dev/null +++ b/users/333fred/333fred.h @@ -0,0 +1,22 @@ +#ifndef FRED_333 +#define FRED_333 + +#include "quantum.h" + +#define BASE 0 +#define CODE 1 // code layer +#define SYMB 2 +#define MDIA 3 // media keys +#define VIM 4 +#define GAME 5 + +// Tap dance config shared between my keyboards +enum tap_dance_declarations { + TD_SYM_VIM = 0 +}; + +void tap_dance_layer_finished(qk_tap_dance_state_t*, void*); +void tap_dance_layer_reset(qk_tap_dance_state_t*, void*); +void tap_dance_process_record(uint16_t); + +#endif diff --git a/users/333fred/rules.mk b/users/333fred/rules.mk new file mode 100644 index 000000000000..3160ac2e698d --- /dev/null +++ b/users/333fred/rules.mk @@ -0,0 +1,2 @@ + +SRC += 333fred.c diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c new file mode 100644 index 000000000000..47565ff9cbb0 --- /dev/null +++ b/users/drashna/drashna.c @@ -0,0 +1,379 @@ +#include "drashna.h" +#include "quantum.h" +#include "action.h" +#include "version.h" + +__attribute__ ((weak)) +void matrix_init_keymap(void) {} + +__attribute__ ((weak)) +void matrix_scan_keymap(void) {} + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + + +void matrix_init_user(void) { +#ifdef RGBLIGHT_ENABLE + uint8_t default_layer = eeconfig_read_default_layer(); + + rgblight_enable(); + + if (true) { + if (default_layer & (1UL << _COLEMAK)) { + rgblight_set_magenta; + } + else if (default_layer & (1UL << _DVORAK)) { + rgblight_set_green; + } + else if (default_layer & (1UL << _WORKMAN)) { + rgblight_set_purple; + } + else { + rgblight_set_teal; + } + } + else + { + rgblight_set_red; + rgblight_mode(5); + } +#endif + matrix_init_keymap(); +} + +void matrix_scan_user(void) { + matrix_scan_keymap(); +} + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_workman[][2] = SONG(PLOVER_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) { + + uint16_t kc; + if (is_overwatch) { + kc = KC_BSPC; + } + else { + kc = KC_ENTER; + } +#ifdef CONSOLE_ENABLE + xprintf("KL: row: %u, column: %u, pressed: %u\n", record->event.key.col, record->event.key.row, record->event.pressed); +#endif + + switch (keycode) { + case KC_QWERTY: + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); +#endif + persistent_default_layer_set(1UL << _QWERTY); + } + return false; + break; + case KC_COLEMAK: + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); +#endif + persistent_default_layer_set(1UL << _COLEMAK); + } + return false; + break; + case KC_DVORAK: + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); +#endif + persistent_default_layer_set(1UL << _DVORAK); + } + return false; + break; + case KC_WORKMAN: + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(tone_workman); +#endif + persistent_default_layer_set(1UL << _WORKMAN); + } + 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; + case KC_OVERWATCH: + if (record->event.pressed) { + is_overwatch = !is_overwatch; + } +#ifdef RGBLIGHT_ENABLE + is_overwatch ? rgblight_mode(17) : rgblight_mode(18); +#endif + return false; + break; + case KC_SALT: + if (!record->event.pressed) { + register_code(kc); + unregister_code(kc); + _delay_ms(50); + SEND_STRING("Salt, salt, salt..."); + register_code(KC_ENTER); + unregister_code(KC_ENTER); + } + return false; + break; + case KC_MORESALT: + if (!record->event.pressed) { + register_code(kc); + unregister_code(kc); + _delay_ms(50); + SEND_STRING("Please sir, can I have some more salt?!"); + register_code(KC_ENTER); + unregister_code(KC_ENTER); + } + return false; + break; + case KC_SALTHARD: + if (!record->event.pressed) { + register_code(kc); + unregister_code(kc); + _delay_ms(50); + SEND_STRING("Your salt only makes my penis that much harder, and even more aggressive!"); + register_code(KC_ENTER); + unregister_code(KC_ENTER); + } + return false; + break; + case KC_GOODGAME: + if (!record->event.pressed) { + register_code(kc); + unregister_code(kc); + _delay_ms(50); + SEND_STRING("Good game, everyone!"); + register_code(KC_ENTER); + unregister_code(KC_ENTER); + } + return false; + break; + case KC_GLHF: + if (!record->event.pressed) { + register_code(kc); + unregister_code(kc); + _delay_ms(50); + SEND_STRING("Good luck, have fun!!!"); + register_code(KC_ENTER); + unregister_code(KC_ENTER); + } + return false; + break; + case KC_SYMM: + if (!record->event.pressed) { + register_code(kc); + unregister_code(kc); + _delay_ms(50); + SEND_STRING("Left click to win!"); + register_code(KC_ENTER); + unregister_code(KC_ENTER); + } + return false; + break; + case KC_DOOMFIST: + if (!record->event.pressed) { + register_code(kc); + unregister_code(kc); + _delay_ms(50); + SEND_STRING("Hey, look at me. I'm Doomfist, and I'm overpowered! All I do is spam punches all day! I'm DPS, tank and defense, rolled into one! All I need is team healing to be complete!"); + register_code(KC_ENTER); + unregister_code(KC_ENTER); + } + return false; + break; + case KC_JUSTGAME: + if (!record->event.pressed) { + register_code(kc); + unregister_code(kc); + _delay_ms(50); + SEND_STRING("It may be a game, but if you don't want to actually try, please go play AI, so that people that actually want to take the game seriously and \"get good\" have a place to do so without trolls like you throwing games."); + register_code(KC_ENTER); + unregister_code(KC_ENTER); + } + return false; + break; + case KC_TORB: + if (!record->event.pressed) { + register_code(kc); + unregister_code(kc); + _delay_ms(50); + SEND_STRING("That was positively riveting!"); + register_code(KC_ENTER); + unregister_code(KC_ENTER); + } + return false; + break; + case KC_AIM: + if (!record->event.pressed) { + register_code(kc); + unregister_code(kc); + _delay_ms(50); + SEND_STRING("That aim is absolutely amazing. It's almost like you're a machine!" SS_TAP(X_ENTER)); + _delay_ms(50); + SEND_STRING("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!" SS_TAP(X_ENTER)); + } + return false; + break; + case KC_MAKE: + if (!record->event.pressed) { +#ifdef RGBLIGHT_ENABLE + SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP " RGBLIGHT_ENABLE=yes" SS_TAP(X_ENTER)); +#else + SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP " RGBLIGHT_ENABLE=no"SS_TAP(X_ENTER)); +#endif + } + return false; + break; + case KC_RESET: + if (!record->event.pressed) { +#ifdef RGBLIGHT_ENABLE + rgblight_enable(); + rgblight_mode(1); + rgblight_setrgb(0xff, 0x00, 0x00); +#endif + reset_keyboard(); + } + return false; + break; + case EPRM: + if (record->event.pressed) { + eeconfig_init(); + } + return false; + break; + case VRSN: + if (record->event.pressed) { + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + case KC_P00: + if (!record->event.pressed) { + register_code(KC_P0); + unregister_code(KC_P0); + register_code(KC_P0); + unregister_code(KC_P0); + } + return false; + break; + } + return process_record_keymap(keycode, record); +} + + +uint32_t layer_state_set_kb(uint32_t state) { +#ifdef RGBLIGHT_ENABLE + uint8_t default_layer = eeconfig_read_default_layer(); + + switch (biton32(state)) { + case _NAV: + rgblight_set_blue; + rgblight_mode(1); + break; + case _SYMB: + rgblight_set_blue; + rgblight_mode(2); + break; + case _MOUS: + rgblight_set_yellow; + rgblight_mode(1); + break; + case _MACROS: + rgblight_set_orange; + is_overwatch ? rgblight_mode(17) : rgblight_mode(18); + rgblight_mode(18); + break; + case _MEDIA: + rgblight_set_green; + rgblight_mode(22); + break; + case _OVERWATCH: + rgblight_set_orange; + rgblight_mode(17); + break; + case _DIABLO: + rgblight_set_red; + rgblight_mode(5); + break; + case _RAISE: + rgblight_set_yellow; + rgblight_mode(5); + break; + case _LOWER: + rgblight_set_orange; + rgblight_mode(5); + break; + case _ADJUST: + rgblight_set_red; + rgblight_mode(23); + break; + case _COVECUBE: + rgblight_set_green; + rgblight_mode(2); + default: + if (default_layer & (1UL << _COLEMAK)) { + rgblight_set_magenta; + } + else if (default_layer & (1UL << _DVORAK)) { + rgblight_set_green; + } + else if (default_layer & (1UL << _WORKMAN)) { + rgblight_set_purple; + } + else { + rgblight_set_teal; + } + rgblight_mode(1); + break; + } +#endif + return state; +} diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h new file mode 100644 index 000000000000..0e7b25d2d3d6 --- /dev/null +++ b/users/drashna/drashna.h @@ -0,0 +1,73 @@ +#ifndef USERSPACE +#define USERSPACE + +#include "quantum.h" + +// Define layer names +#define _QWERTY 0 +#define _NUMLOCK 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _WORKMAN 3 +#define _NAV 5 +#define _COVECUBE 6 +#define _SYMB 8 +#define _OVERWATCH 9 +#define _DIABLO 10 +#define _MOUS 11 +#define _MACROS 12 +#define _MEDIA 13 +#define _LOWER 14 +#define _RAISE 15 +#define _ADJUST 16 + + +//define modifiers +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) +#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) + +#ifdef RGBLIGHT_ENABLE +#define rgblight_set_blue rgblight_sethsv (0xFF, 0xFF, 0xFF); +#define rgblight_set_red rgblight_sethsv (0x00, 0xFF, 0xFF); +#define rgblight_set_green rgblight_sethsv (0x78, 0xFF, 0xFF); +#define rgblight_set_orange rgblight_sethsv (0x1E, 0xFF, 0xFF); +#define rgblight_set_teal rgblight_sethsv (0xC3, 0xFF, 0xFF); +#define rgblight_set_magenta rgblight_sethsv (0x12C, 0xFF, 0xFF); +#define rgblight_set_yellow rgblight_sethsv (0x3C, 0xFF, 0xFF); +#define rgblight_set_purple rgblight_sethsv (0x10E, 0xFF, 0xFF); +#endif + +__attribute__ ((weak)) +bool is_overwatch = false; + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + EPRM, + VRSN, + KC_QWERTY, + KC_COLEMAK, + KC_DVORAK, + KC_WORKMAN, + LOWER, + RAISE, + ADJUST, + KC_DIABLO_CLEAR, + KC_OVERWATCH, + KC_SALT, + KC_MORESALT, + KC_SALTHARD, + KC_GOODGAME, + KC_SYMM, + KC_DOOMFIST, + KC_JUSTGAME, + KC_GLHF, + KC_TORB, + KC_AIM, + KC_MAKE, + KC_RESET, + KC_P00, + NEWPLACEHOLDER +}; + +#endif diff --git a/users/drashna/readme.md b/users/drashna/readme.md new file mode 100644 index 000000000000..0d553f08eeeb --- /dev/null +++ b/users/drashna/readme.md @@ -0,0 +1,14 @@ +Copyright 2017 Christopher Courtney @drashna + +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 . diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk new file mode 100644 index 000000000000..0150bb6089d9 --- /dev/null +++ b/users/drashna/rules.mk @@ -0,0 +1,2 @@ + +SRC += drashna.c From e6c309fc96d125fe018ae1ae04243c0d44e88225 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Tue, 7 Nov 2017 20:51:10 -0800 Subject: [PATCH 2/4] Remove Tap Dance from Orthodox keymap --- keyboards/orthodox/keymaps/drashna/keymap.c | 3 +-- keyboards/orthodox/keymaps/drashna/rules.mk | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index 68c9a1313d31..036464104d90 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -22,7 +22,6 @@ along with this program. If not, see . #include "orthodox.h" #include "drashna.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. @@ -72,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_ADJUST] = KEYMAP(\ - KC_MAKE, KC_RESET, TD(TD_FLSH), _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_MAKE,KC_RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, _______, XXXXXXX, _______, _______, XXXXXXX, _______, AG_SWAP, KC_QWERTY, KC_COLEMAK, KC_DVORAK, KC_WORKMAN, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, MAGIC_TOGGLE_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY \ ) diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk index e6eb954bc951..bb4aad689053 100644 --- a/keyboards/orthodox/keymaps/drashna/rules.mk +++ b/keyboards/orthodox/keymaps/drashna/rules.mk @@ -1,5 +1,5 @@ CONSOLE_ENABLE = no -TAP_DANCE_ENABLE = yes +TAP_DANCE_ENABLE = no RGBLIGHT_ENABLE = yes AUDIO_ENABLE = no MOUSEKEY_ENABLE = no From 857e991f091190ac0b563a97009fd2123430eebd Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Fri, 10 Nov 2017 19:46:29 -0800 Subject: [PATCH 3/4] Cleaned up userspace and keymaps --- keyboards/ergodox_ez/keymaps/drashna/keymap.c | 4 +- keyboards/ergodox_ez/keymaps/drashna/rules.mk | 3 +- .../woodpad/keymaps/drashna/config.h | 6 +- .../woodpad/keymaps/drashna/keymap.c | 22 ++-- .../woodpad/keymaps/drashna/rules.mk | 1 + keyboards/orthodox/keymaps/drashna/config.h | 3 + keyboards/orthodox/keymaps/drashna/keymap.c | 6 +- keyboards/orthodox/keymaps/drashna/rules.mk | 3 +- keyboards/viterbi/keymaps/drashna/keymap.c | 50 ++++---- users/drashna/drashna.c | 115 ++++++++++-------- users/drashna/drashna.h | 7 +- users/drashna/rules.mk | 1 + 12 files changed, 116 insertions(+), 105 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/drashna/keymap.c b/keyboards/ergodox_ez/keymaps/drashna/keymap.c index 651703c1e0bb..1f9161236695 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/keymap.c +++ b/keyboards/ergodox_ez/keymaps/drashna/keymap.c @@ -225,7 +225,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_LSFT, LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(_OVERWATCH), LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET, - ALT_T(KC_APP), KC_LEAD, + ALT_T(KC_APP), KC_LGUI, KC_HOME, KC_SPC,KC_BSPC,KC_END, // right hand @@ -234,7 +234,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_H, KC_N, KC_E, KC_I, KC_O, GUI_T(KC_QUOTE), TG(_OVERWATCH),KC_K, KC_M, KC_COMM,KC_DOT, RCTL_T(KC_SLASH), KC_RSHIFT, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TT(_SYMB), - KC_LALT, CTL_T(KC_ESC), + KC_RGUI, CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_DELETE, KC_ENT ), diff --git a/keyboards/ergodox_ez/keymaps/drashna/rules.mk b/keyboards/ergodox_ez/keymaps/drashna/rules.mk index b6c5ed3bd597..bfeb6be49a5e 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/rules.mk +++ b/keyboards/ergodox_ez/keymaps/drashna/rules.mk @@ -1,8 +1,7 @@ TAP_DANCE_ENABLE = yes SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -COMMAND_ENABLE = yes # Commands for debug and configuration +COMMAND_ENABLE = no # Commands for debug and configuration RGBLIGHT_ENABLE = yes -MIDI_ENABLE = no CONSOLE_ENABLE = no EXTRAFLAGS = -flto diff --git a/keyboards/handwired/woodpad/keymaps/drashna/config.h b/keyboards/handwired/woodpad/keymaps/drashna/config.h index be1e4df598cd..780192cf3c9a 100644 --- a/keyboards/handwired/woodpad/keymaps/drashna/config.h +++ b/keyboards/handwired/woodpad/keymaps/drashna/config.h @@ -28,13 +28,13 @@ #ifdef RGBLIGHT_ENABLE #define RGB_DI_PIN D3 -#define RGBLED_NUM 7 // Number of LEDs +#define RGBLED_NUM 14 // Number of LEDs #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_HUE_STEP 12 #define RGBLIGHT_SAT_STEP 12 #define RGBLIGHT_VAL_STEP 12 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 +#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 4 +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 #endif // RGBLIGHT_ENABLE diff --git a/keyboards/handwired/woodpad/keymaps/drashna/keymap.c b/keyboards/handwired/woodpad/keymaps/drashna/keymap.c index 6ec7f52fd6a2..e53c65f10530 100644 --- a/keyboards/handwired/woodpad/keymaps/drashna/keymap.c +++ b/keyboards/handwired/woodpad/keymaps/drashna/keymap.c @@ -47,10 +47,10 @@ bool check_dtimer(uint8_t dtimer) { #ifdef TAP_DANCE_ENABLE enum { - TD_DIABLO_1 = 0, - TD_DIABLO_2, - TD_DIABLO_3, - TD_DIABLO_4 + TD_D3_1 = 0, + TD_D3_2, + TD_D3_3, + TD_D3_4 }; @@ -89,10 +89,10 @@ void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { //Tap Dance Definitions qk_tap_dance_action_t tap_dance_actions[] = { // tap once to disable, and more to enable timed micros - [TD_DIABLO_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), - [TD_DIABLO_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), - [TD_DIABLO_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), - [TD_DIABLO_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), + [TD_D3_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), + [TD_D3_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), + [TD_D3_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), + [TD_D3_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), }; #endif @@ -117,7 +117,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, _______, _______, _______,\ KC_S, KC_F, KC_I, KC_M, \ KC_1, KC_2, KC_3, KC_4, \ - TD(TD_DIABLO_1), TD(TD_DIABLO_2), TD(TD_DIABLO_3), TD(TD_DIABLO_4), \ + TD(TD_D3_1), TD(TD_D3_2), TD(TD_D3_3), TD(TD_D3_4), \ _______, KC_DIABLO_CLEAR, KC_Q, SFT_T(KC_SPACE) \ ), #else @@ -135,7 +135,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_OVERWATCH, _______, _______, XXXXXXX,\ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, KC_JUSTGAME, \ - KC_SYMM, KC_DOOMFIST, KC_TORB, KC_GOODGAME, \ + KC_SYMM, KC_TORB, XXXXXXX, KC_GOODGAME, \ KC_SALT, KC_MORESALT, KC_SALTHARD, KC_GLHF \ ), [_MEDIA] = KEYMAP( /* Base */ @@ -226,7 +226,7 @@ void matrix_init_keymap(void) { void matrix_scan_keymap(void) { numlock_led_off(); - if (is_overwatch && biton32(layer_state) == _MACROS) { + if ((is_overwatch && biton32(layer_state) == _MACROS) || (biton32(layer_state) == _NAV)) { numlock_led_on(); } diff --git a/keyboards/handwired/woodpad/keymaps/drashna/rules.mk b/keyboards/handwired/woodpad/keymaps/drashna/rules.mk index b6c5ed3bd597..bee3ecf505f0 100644 --- a/keyboards/handwired/woodpad/keymaps/drashna/rules.mk +++ b/keyboards/handwired/woodpad/keymaps/drashna/rules.mk @@ -4,6 +4,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration RGBLIGHT_ENABLE = yes MIDI_ENABLE = no CONSOLE_ENABLE = no +NKRO_ENABLE = yes EXTRAFLAGS = -flto diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h index fc483b08e63c..d88481fd62ae 100644 --- a/keyboards/orthodox/keymaps/drashna/config.h +++ b/keyboards/orthodox/keymaps/drashna/config.h @@ -61,5 +61,8 @@ along with this program. If not, see . #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 #endif // RGBLIGHT_ENABLE +#ifdef AUDIO_ENABLE +#define C6_AUDIO +#endif #endif diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index 036464104d90..ca4e6dc2cd7a 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -79,4 +79,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; - +#ifdef FAUXCLICKY_ENABLE +float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A4, 0.0625); // (_D4, 0.25); +float fauxclicky_released_note[2] = MUSICAL_NOTE(_A4, 0.0625); // (_C4, 0.125); +float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C6, 0.25); // (_C4, 0.25); +#endif diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk index bb4aad689053..293faf13e5ec 100644 --- a/keyboards/orthodox/keymaps/drashna/rules.mk +++ b/keyboards/orthodox/keymaps/drashna/rules.mk @@ -4,8 +4,7 @@ RGBLIGHT_ENABLE = yes AUDIO_ENABLE = no MOUSEKEY_ENABLE = no NKRO_ENABLE = yes -FAUXCLICKY_ENABLE = no -EXTRAFLAGS = -flto +FAUXCLICKY_ENABLE = yes ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/viterbi/keymaps/drashna/keymap.c b/keyboards/viterbi/keymaps/drashna/keymap.c index b33f05027216..48a146958e40 100644 --- a/keyboards/viterbi/keymaps/drashna/keymap.c +++ b/keyboards/viterbi/keymaps/drashna/keymap.c @@ -38,10 +38,10 @@ bool check_dtimer(uint8_t dtimer) { enum { - TD_DIABLO_1 = 0, - TD_DIABLO_2, - TD_DIABLO_3, - TD_DIABLO_4 + TD_D3_1 = 0, + TD_D3_2, + TD_D3_3, + TD_D3_4 }; @@ -80,10 +80,10 @@ void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { //Tap Dance Definitions qk_tap_dance_action_t tap_dance_actions[] = { // tap once to disable, and more to enable timed micros - [TD_DIABLO_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), - [TD_DIABLO_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), - [TD_DIABLO_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), - [TD_DIABLO_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), + [TD_D3_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), + [TD_D3_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), + [TD_D3_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), + [TD_D3_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), }; #endif @@ -92,33 +92,33 @@ qk_tap_dance_action_t tap_dance_actions[] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_NUMLOCK] = KEYMAP( - LMACRO, DIABLO, GAMEPAD, KC_NLCK, KC_SLCK, KC_COLN, KC_PSLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - MEDIA, KC_CALC, COVECUBE,KC_P7, KC_P8, KC_P9, KC_PAST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_HOME, KC_DEL, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PMNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_END, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_PPLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_P00, KC_PDOT, KC_PENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + LMACRO, DIABLO, GAMEPAD, KC_NLCK, KC_SLCK, KC_COLN, KC_PSLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + MEDIA, KC_CALC, COVECUBE, KC_P7, KC_P8, KC_P9, KC_PAST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_HOME, KC_DEL, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PMNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_END, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_PPLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_LEFT, KC_DOWN, K C_RGHT, KC_P0, KC_KP_00,KC_PDOT, KC_PENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ ), [_DIABLO] = KEYMAP( - KC_ESC, DIABLO, KC_V, KC_D, XXXXXXX, XXXXXXX, KC_L, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_TAB, KC_S, KC_F, KC_I, KC_M, KC_T, KC_J, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G, KC_F, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_LCTL, TD(TD_DIABLO_1), TD(TD_DIABLO_2), TD(TD_DIABLO_3), TD(TD_DIABLO_4), KC_Z, KC_DIABLO_CLEAR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_LALT, KC_F4, KC_F5, KC_F8, KC_F9, KC_F10, SFT_T(KC_SPACE), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + KC_ESC, DIABLO, KC_V, KC_D, XXXXXXX, XXXXXXX, KC_L, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_TAB, KC_S, KC_F, KC_I, KC_M, KC_T, KC_J, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G, KC_F, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_LCTL, TD(TD_D3_1), TD(TD_D3_2), TD(TD_D3_3), TD(TD_D3_4), KC_Z, KC_DIABLO_CLEAR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_LALT, KC_F4, KC_F5, KC_F8, KC_F9, KC_F10, SFT_T(KC_SPACE), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ ), [_OVERWATCH] = KEYMAP( // Game pad layout designed primarily for Overwatch - LMACRO, KC_ESC, GAMEPAD, KC_1, KC_2, KC_3, KC_4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - MEDIA, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_Z, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_Y, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_F1, KC_U, KC_I, KC_Y, KC_V, KC_SPC, KC_V, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + LMACRO, KC_ESC, GAMEPAD, KC_1, KC_2, KC_3, KC_4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + MEDIA, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_Z, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_Y, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_F1, KC_U, KC_I, KC_Y, KC_V, KC_SPC, KC_V, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ ), [_MACROS] = KEYMAP( - LMACRO, XXXXXXX, GAMEPAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + LMACRO, XXXXXXX, GAMEPAD, 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, \ - KC_SYMM, KC_TORB, KC_DOOMFIST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_SYMM, KC_TORB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ KC_GLHF, KC_GOODGAME, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ KC_SALT, KC_MORESALT, KC_SALTHARD, KC_JUSTGAME, KC_AIM, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ ), diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 47565ff9cbb0..30da7414ee0d 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -3,6 +3,10 @@ #include "action.h" #include "version.h" +// Add reconfigurable functions here, for keymap customization +// This allows for a global, userspace functions, and continued +// customization of the keymap. Use _keymap instead of _user +// functions in the keymaps __attribute__ ((weak)) void matrix_init_keymap(void) {} @@ -13,8 +17,15 @@ __attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } +__attribute__ ((weak)) +uint32_t layer_state_set_keymap (uint32_t state) { + return state; +} +bool is_overwatch = false; +// Call user matrix init, set default RGB colors and then +// call the keymap's init function void matrix_init_user(void) { #ifdef RGBLIGHT_ENABLE uint8_t default_layer = eeconfig_read_default_layer(); @@ -44,6 +55,8 @@ void matrix_init_user(void) { matrix_init_keymap(); } +// No global matrix scan code, so just run keymap's matix +// scan function void matrix_scan_user(void) { matrix_scan_keymap(); } @@ -61,16 +74,10 @@ void persistent_default_layer_set(uint16_t default_layer) { default_layer_set(default_layer); } - +// Defines actions tor my global custom keycodes. Defined in drashna.h file +// Then runs the _keymap's recod handier if not processed here bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - uint16_t kc; - if (is_overwatch) { - kc = KC_BSPC; - } - else { - kc = KC_ENTER; - } + #ifdef CONSOLE_ENABLE xprintf("KL: row: %u, column: %u, pressed: %u\n", record->event.key.col, record->event.key.row, record->event.pressed); #endif @@ -143,6 +150,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; +#if !(defined(KEYBOARD_orthodox_rev1) || defined(KEYBOARD_ergodox_ez)) case KC_OVERWATCH: if (record->event.pressed) { is_overwatch = !is_overwatch; @@ -154,8 +162,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case KC_SALT: if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); + register_code(is_overwatch ? KC_BSPC : KC_ENTER); + unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); _delay_ms(50); SEND_STRING("Salt, salt, salt..."); register_code(KC_ENTER); @@ -165,8 +173,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case KC_MORESALT: if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); + register_code(is_overwatch ? KC_BSPC : KC_ENTER); + unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); _delay_ms(50); SEND_STRING("Please sir, can I have some more salt?!"); register_code(KC_ENTER); @@ -176,10 +184,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case KC_SALTHARD: if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); + register_code(is_overwatch ? KC_BSPC : KC_ENTER); + unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); _delay_ms(50); - SEND_STRING("Your salt only makes my penis that much harder, and even more aggressive!"); + SEND_STRING("Your salt only makes me harder, and even more aggressive!"); register_code(KC_ENTER); unregister_code(KC_ENTER); } @@ -187,8 +195,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case KC_GOODGAME: if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); + register_code(is_overwatch ? KC_BSPC : KC_ENTER); + unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); _delay_ms(50); SEND_STRING("Good game, everyone!"); register_code(KC_ENTER); @@ -198,8 +206,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case KC_GLHF: if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); + register_code(is_overwatch ? KC_BSPC : KC_ENTER); + unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); _delay_ms(50); SEND_STRING("Good luck, have fun!!!"); register_code(KC_ENTER); @@ -209,8 +217,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case KC_SYMM: if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); + register_code(is_overwatch ? KC_BSPC : KC_ENTER); + unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); _delay_ms(50); SEND_STRING("Left click to win!"); register_code(KC_ENTER); @@ -218,21 +226,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case KC_DOOMFIST: - if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); - _delay_ms(50); - SEND_STRING("Hey, look at me. I'm Doomfist, and I'm overpowered! All I do is spam punches all day! I'm DPS, tank and defense, rolled into one! All I need is team healing to be complete!"); - register_code(KC_ENTER); - unregister_code(KC_ENTER); - } - return false; - break; case KC_JUSTGAME: if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); + register_code(is_overwatch ? KC_BSPC : KC_ENTER); + unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); _delay_ms(50); SEND_STRING("It may be a game, but if you don't want to actually try, please go play AI, so that people that actually want to take the game seriously and \"get good\" have a place to do so without trolls like you throwing games."); register_code(KC_ENTER); @@ -242,8 +239,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case KC_TORB: if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); + register_code(is_overwatch ? KC_BSPC : KC_ENTER); + unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); _delay_ms(50); SEND_STRING("That was positively riveting!"); register_code(KC_ENTER); @@ -253,8 +250,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case KC_AIM: if (!record->event.pressed) { - register_code(kc); - unregister_code(kc); + register_code(is_overwatch ? KC_BSPC : KC_ENTER); + unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); _delay_ms(50); SEND_STRING("That aim is absolutely amazing. It's almost like you're a machine!" SS_TAP(X_ENTER)); _delay_ms(50); @@ -262,13 +259,31 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; +#endif case KC_MAKE: if (!record->event.pressed) { + SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP); +#ifndef CATERINA_BOOTLOADER + SEND_STRING(":teensy "); +#else + SEND_STRING(" "); +#endif #ifdef RGBLIGHT_ENABLE - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP " RGBLIGHT_ENABLE=yes" SS_TAP(X_ENTER)); + SEND_STRING("RGBLIGHT_ENABLE=yes "); +#else + SEND_STRING("RGBLIGHT_ENABLE=no "); +#endif +#ifdef AUDIO_ENABLE + SEND_STRING("AUDIO_ENABLE=yes "); +#else + SEND_STRING("AUDIO_ENABLE=no "); +#endif +#ifdef FAUXCLICKY_ENABLE + SEND_STRING("FAUXCLICKY_ENABLE=yes "); #else - SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP " RGBLIGHT_ENABLE=no"SS_TAP(X_ENTER)); + SEND_STRING("FAUXCLICKY_ENABLE=no "); #endif + SEND_STRING(SS_TAP(X_ENTER)); } return false; break; @@ -295,21 +310,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case KC_P00: - if (!record->event.pressed) { - register_code(KC_P0); - unregister_code(KC_P0); - register_code(KC_P0); - unregister_code(KC_P0); - } - return false; - break; } return process_record_keymap(keycode, record); } - -uint32_t layer_state_set_kb(uint32_t state) { +// Runs state check and changes underglow color and animation +// on layer change, no matter where the change was initiated +// Then runs keymap's layer change check +uint32_t layer_state_set_user (uint32_t state) { #ifdef RGBLIGHT_ENABLE uint8_t default_layer = eeconfig_read_default_layer(); @@ -329,7 +337,6 @@ uint32_t layer_state_set_kb(uint32_t state) { case _MACROS: rgblight_set_orange; is_overwatch ? rgblight_mode(17) : rgblight_mode(18); - rgblight_mode(18); break; case _MEDIA: rgblight_set_green; @@ -375,5 +382,5 @@ uint32_t layer_state_set_kb(uint32_t state) { break; } #endif - return state; + return layer_state_set_keymap (state); } diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 0e7b25d2d3d6..6e897ad997fb 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -38,8 +38,7 @@ #define rgblight_set_purple rgblight_sethsv (0x10E, 0xFF, 0xFF); #endif -__attribute__ ((weak)) -bool is_overwatch = false; +extern bool is_overwatch; enum custom_keycodes { PLACEHOLDER = SAFE_RANGE, // can always be here @@ -59,15 +58,13 @@ enum custom_keycodes { KC_SALTHARD, KC_GOODGAME, KC_SYMM, - KC_DOOMFIST, KC_JUSTGAME, KC_GLHF, KC_TORB, KC_AIM, KC_MAKE, KC_RESET, - KC_P00, - NEWPLACEHOLDER + NEWPLACEHOLDER //use "NEWPLACEHOLDER for keymap specific codes }; #endif diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 0150bb6089d9..6ce1ff5ba799 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -1,2 +1,3 @@ SRC += drashna.c +EXTRAFLAGS = -flto From 5e294edae34b925d2a2cfefe3955093be8eef094 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Fri, 10 Nov 2017 19:47:50 -0800 Subject: [PATCH 4/4] Added sample (template)userspace files to my folder --- users/drashna/template.c | 82 ++++++++++++++++++++++++++++++++++++++++ users/drashna/template.h | 18 +++++++++ 2 files changed, 100 insertions(+) create mode 100644 users/drashna/template.c create mode 100644 users/drashna/template.h diff --git a/users/drashna/template.c b/users/drashna/template.c new file mode 100644 index 000000000000..027c780e9561 --- /dev/null +++ b/users/drashna/template.c @@ -0,0 +1,82 @@ +#include "drashna.h" +#include "quantum.h" +#include "action.h" +#include "version.h" + +// Add reconfigurable functions here, for keymap customization +// This allows for a global, userspace functions, and continued +// customization of the keymap. Use _keymap instead of _user +// functions in the keymaps +__attribute__ ((weak)) +void matrix_init_keymap(void) {} + +__attribute__ ((weak)) +void matrix_scan_keymap(void) {} + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} +__attribute__ ((weak)) +uint32_t layer_state_set_keymap (uint32_t state) { + return state; +} + +// Call user matrix init, then call the keymap's init function +void matrix_init_user(void) { + matrix_init_keymap(); +} + +// No global matrix scan code, so just run keymap's matix +// scan function +void matrix_scan_user(void) { + matrix_scan_keymap(); +} + + +// Defines actions tor my global custom keycodes. Defined in drashna.h file +// Then runs the _keymap's recod handier if not processed here, +// And use "NEWPLACEHOLDER" for new safe range +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + case KC_MAKE: + if (!record->event.pressed) { + SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP); +#ifndef CATERINA_BOOTLOADER + SEND_STRING(":teensy "); +#else + SEND_STRING(" "); +#endif + SEND_STRING(SS_TAP(X_ENTER)); + } + return false; + break; + case KC_RESET: + if (!record->event.pressed) { + reset_keyboard(); + } + return false; + break; + case EPRM: + if (record->event.pressed) { + eeconfig_init(); + } + return false; + break; + case VRSN: + if (record->event.pressed) { + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + } + return process_record_keymap(keycode, record); +} + +// Runs state check and changes underglow color and animation +// on layer change, no matter where the change was initiated +// Then runs keymap's layer change check +uint32_t layer_state_set_user (uint32_t state) { + return layer_state_set_keymap (state); +} diff --git a/users/drashna/template.h b/users/drashna/template.h new file mode 100644 index 000000000000..d1251462b27c --- /dev/null +++ b/users/drashna/template.h @@ -0,0 +1,18 @@ +#ifndef USERSPACE +#define USERSPACE + +#include "quantum.h" + +// Define layer names +#define BASE 0 + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + EPRM, + VRSN, + KC_MAKE, + KC_RESET, + NEWPLACEHOLDER //use "NEWPLACEHOLDER for keymap specific codes +}; + +#endif