diff --git a/keyboards/coseyfannitutti/discipline/keymaps/noroadsleft/keymap.c b/keyboards/coseyfannitutti/discipline/keymaps/noroadsleft/keymap.c new file mode 100644 index 00000000000..6ad9dd1d387 --- /dev/null +++ b/keyboards/coseyfannitutti/discipline/keymaps/noroadsleft/keymap.c @@ -0,0 +1,73 @@ +/* Copyright 2021 James Young (@noroadsleft) + * + * 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 "noroadsleft.h" +#include "sendstring_dvorak.h" + +enum layer_names { + _QW, + _DV, + _NP, + _FN, + _SY +}; + +#define FN_CAPS LT(_FN, KC_CAPS) +#define CTL_GRV MT(MOD_LCTL, KC_GRV) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QW] = LAYOUT_65_ansi( + 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_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, + FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + CTL_GRV, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_DV] = LAYOUT_65_ansi( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_HOME, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_PGUP, + FN_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_PGDN, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, KC_END, + CTL_GRV, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_NP] = LAYOUT_65_ansi( + _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______, _______, _______, _______, _______, + _______, _______, _______, _______, KC_E, KC_F, _______, KC_P4, KC_P5, KC_P6, KC_PAST, KC_PSLS, KC_PEQL, _______, _______, + _______, _______, _______, _______, KC_C, KC_D, _______, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PMNS, KC_PENT, _______, + _______, _______, _______, _______, KC_A, KC_B, _______, KC_P0, _______, KC_PDOT, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_FN] = LAYOUT_65_ansi( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_PSCR, + _______, KC_CALC, KC_APP, _______, _______, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_PSCR, KC_SLCK, KC_PAUS, _______, + _______, M_SALL, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, + _______, M_UNDO, M_CUT, M_COPY, M_PASTE, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, TO(_SY), _______, _______, _______, + _______, _______, _______, TG(_NP), _______, _______, _______, _______, _______, _______ + ), + + [_SY] = LAYOUT_65_ansi( + TG(_SY), TO(_QW), TO(_DV), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, DEBUG, XXXXXXX, VRSN, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, M_MDSWP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, TG(_NP), XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ) + +}; diff --git a/keyboards/kbdfans/kbd75/keymaps/noroadsleft/keymap.c b/keyboards/kbdfans/kbd75/keymaps/noroadsleft/keymap.c index c08e513a7d1..1648224fdf3 100644 --- a/keyboards/kbdfans/kbd75/keymaps/noroadsleft/keymap.c +++ b/keyboards/kbdfans/kbd75/keymaps/noroadsleft/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2020 James Young (@noroadsleft) +/* Copyright 2020-2021 James Young (@noroadsleft) * * 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 @@ -114,31 +114,6 @@ bool led_update_user(led_t led_state) { bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case G_PUSH: - if (record->event.pressed) { - SEND_STRING("git push origin "); - }; - return false; - case G_FTCH: - if (record->event.pressed) { - if ( get_mods() & MOD_MASK_SHIFT ) { - clear_mods(); - SEND_STRING("git pull upstream "); - } else { - SEND_STRING("git fetch upstream "); - } - }; - return false; - case G_BRCH: - if (record->event.pressed) { - if ( get_mods() & MOD_MASK_SHIFT ) { - clear_mods(); - SEND_STRING("master"); - } else { - SEND_STRING("$(git branch-name)"); - } - }; - return false; case GO_Q2: if (record->event.pressed) { layer_move(_QW); @@ -191,21 +166,6 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { } }; return true; - case KC_Z: - if (record->event.pressed) { - if ( get_mods() & MOD_MASK_RALT ) { - register_code(KC_NUBS); - } else { - register_code(KC_Z); - } - } else { - if ( get_mods() & MOD_MASK_RALT ) { - unregister_code(KC_NUBS); - } else { - unregister_code(KC_Z); - } - }; - return false; default: return true; } diff --git a/keyboards/kc60/keymaps/noroadsleft/keymap.c b/keyboards/kc60/keymaps/noroadsleft/keymap.c index 5ad100e0e7c..f69371061ef 100644 --- a/keyboards/kc60/keymaps/noroadsleft/keymap.c +++ b/keyboards/kc60/keymaps/noroadsleft/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2018-2020 James Young (@noroadsleft) +/* Copyright 2018-2021 James Young (@noroadsleft) * * 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 @@ -40,11 +40,7 @@ enum layer_names { // KEYCODE DEFINITIONS -#define NO_CHNG KC_TRNS // Note for me for keys I need to leave as Pass-through - #define FN_CAPS LT(_FN, KC_CAPS) // Function Layer when held, Caps Lock when tapped -#define Q2_CAPS LT(_FQ, KC_CAPS) // Quake 2 Function Layer when held, Caps Lock when tapped - #define CTL_GRV MT(MOD_LCTL, KC_GRV) // Left Control when held, Grave accent when tapped @@ -58,7 +54,6 @@ enum custom_keycodes { /******************* ** MODIFIER MASKS ** *******************/ -#define MOD_MASK_RALT (MOD_BIT(KC_RALT)) unsigned char q2InputMode = 0; @@ -118,51 +113,6 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { } }; return false; - case KC_Z: - if (record->event.pressed) { - if ( get_mods() & MOD_MASK_RALT ) { - register_code(KC_NUBS); - } else { - register_code(KC_Z); - } - } else { - if ( get_mods() & MOD_MASK_RALT ) { - unregister_code(KC_NUBS); - } else { - unregister_code(KC_Z); - } - }; - return false; - case KC_1 ... KC_0: - if (record->event.pressed) { - if ( get_mods() & MOD_MASK_RALT ) { - register_code( keycode + 0x3B ); - } else { - register_code( keycode ); - } - } else { - if ( get_mods() & MOD_MASK_RALT ) { - unregister_code( keycode + 0x3B ); - } else { - unregister_code( keycode ); - } - } - return false; - case KC_F1 ... KC_F12: - if (record->event.pressed) { - if ( get_mods() & MOD_MASK_RALT ) { - register_code( keycode + 0x2E ); - } else { - register_code( keycode ); - } - } else { - if ( get_mods() & MOD_MASK_RALT ) { - unregister_code( keycode + 0x2E ); - } else { - unregister_code( keycode ); - } - } - return false; } // switch() return true; }; @@ -223,9 +173,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_FN] = LAYOUT_60_ansi( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, KC_CALC, KC_APP, _______, _______, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_PSCR, KC_SLCK, KC_PAUS, - NO_CHNG, M_SALL, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, KC_PENT, + _______, M_SALL, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, KC_PENT, _______, M_UNDO, M_CUT, M_COPY, M_PASTE, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, TG(_SY), _______, - _______, _______, _______, TG(_NP), _______, _______, NO_CHNG, _______ + _______, _______, _______, TG(_NP), _______, _______, _______, _______ ), /***************** @@ -238,7 +188,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, KC_E, KC_F, _______, KC_P4, KC_P5, KC_P6, KC_PAST, KC_PSLS, KC_PEQL, _______, _______, _______, _______, _______, KC_C, KC_D, _______, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PMNS, KC_PENT, _______, _______, _______, _______, KC_A, KC_B, _______, KC_P0, _______, KC_PDOT, _______, _______, - _______, _______, _______, TG(_NP), _______, _______, NO_CHNG, _______ + _______, _______, _______, TG(_NP), _______, _______, _______, _______ ), /* Macro layer */ @@ -247,7 +197,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, G_PUSH, _______, _______, _______, _______, _______, _______, _______, DM_PLY1, DM_PLY2, DM_RSTP, _______, _______, _______, G_FTCH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, G_BRCH, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, NO_CHNG, _______ + _______, _______, _______, _______, _______, _______, _______, _______ ), /* System layer */ @@ -256,7 +206,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { XXXXXXX, XXXXXXX, M_MDSWP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_TOGG, BL_INC, BL_BRTG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NO_CHNG, XXXXXXX + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX ), }; diff --git a/keyboards/kc60/keymaps/noroadsleft/readme.md b/keyboards/kc60/keymaps/noroadsleft/readme.md index 59f4386ee37..8d0c6547a4b 100644 --- a/keyboards/kc60/keymaps/noroadsleft/readme.md +++ b/keyboards/kc60/keymaps/noroadsleft/readme.md @@ -1,15 +1,15 @@ # @noroadsleft's KC60 keymap -### Last updated: November 5, 2019, 12:07 AM UTC-0800 +### Last updated: April 26, 2021 13:33 (-0700) -![](https://i.imgur.com/tzhXQYI.jpg) +![](https://i.imgur.com/tzhXQYIl.jpg) I am a full-time Dvorak typist, and occasional semi-serious FPS gamer. The layers are oriented towards a mix of typing and gaming. ---- -# Preface +## Preface Images in this readme follow the following format: @@ -21,18 +21,122 @@ Descriptions of the physical locations of keys will use the key's function in a ---- -# Outline +## Outline -- [Base Layers](./readme_ch1.md) +- [Base Layers](#base-layers) - Layer 0: QWERTY `_QW` - Layer 1: Hardware Dvorak `_DV` - Layer 2: Hardware Colemak `_CM` -- [Quake 2 Overlays](./readme_ch2.md) - - Layers 3, 4 and 5: Quake 2 `_Q2`, Quake 2 Dvorak `_QD`, and Quake 2 Console `_QC` -- [Function Layers](./readme_ch3.md) - - Layer 6: Fn layer `_FN` - - Layer 7: Quake 2 Fn layer `_FQ` -- [Other Layers](./readme_ch4.md) - - Layer 8: Numpad layer `_NP` - - Layer 9: Macro layer `_MA` - - Layer 10: System layer `_SY` +- [Quake 2 Layer](#quake-2-layer) + - Layer 3: Quake 2 `_Q2` +- [Function Layer](#function-layer) + - Layer 4: Fn layer `_FN` +- [Other Layers](#other-layers) + - Layer 5: Numpad layer `_NP` + - Layer 6: Macro layer `_MA` + - Layer 7: System layer `_SY` + + +---- + +## Base Layers + +### Layer 0: QWERTY - `_QW` + +Standard QWERTY layout, with four QMK features: + +- The `Menu` key has been replaced by `MO(_FW)`, which moves to my Windows Fn layer when held. +- The Right `GUI` key has been replaced with a `MO(_MA)` key, which moves to the Macro layer when held. +- The `Caps Lock` key has been replaced with a dual function `LT()` key, which opens the Windows Fn layer when held, and is `Caps Lock` when tapped +- The Left `Control` key has been replaced with a `MT(MOD_CTRL, KC_GRV)` key, which is ` ~ when tapped and `Ctrl` when held. + +![QWERTY layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/qwerty.png) + + +---- + +### Layer 1: Hardware Dvorak - `_DV` + +- Accessed by holding either `Fn` and tapping `/?` key, then tapping `2@`. + +A hardware-based Dvorak Simplified layout. At my weekend job, I use a shared computer that runs MacOS Sierra, in US QWERTY layout. In this layer, I can leave the system in QWERTY, plug my keyboard in, and still type in Dvorak. + +![Hardware Dvorak layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/dvorak.png) + + +---- + +### Layer 2: Hardware Colemak `_CM` + +- Accessed by holding either `Fn` and tapping `/?` key, then tapping `3#`. + +A hardware-based Colemak layout. Been thinking of trying it, so it's here. + +![Hardware Colemak layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/colemak.png) + + +---- + +## Quake 2 Layer + +### Layer 3: Quake 2 `_Q2` + +- Accessed by holding either `Fn` key and tapping the `/?` key, then tapping `4$` + +These layers were born out of the confusion I have had trying to use the in-game chat and the console in [Quake 2](https://en.wikipedia.org/wiki/Quake_II). When Quake 2 came out, alternate keyboard layouts weren't really a thing. As a result, all in-game text input is hard-locked to US QWERTY, regardless of what the operating system is using for its input method. + +I have solved this by writing a custom QMK macro. The keycode in the System layer that enables these layers, [`GO_Q2`](./keymap.c#L205), is a [macro](./keymap.c#L63-L70) that sets the default layer to the QWERTY layer, then turns the Quake 2 layer `_Q2` on. The result is a partially-overwritten QWERTY layer, that changes the dual-function Left Control/Grave key to a standard Left Control, and the Enter key into a special Enter key specific to Quake 2. + +When I hit the `Enter` key (bound in-game to text chat), the [macro keycode](./keymap.c#L71-L86) I've created sends the keycode for `Enter`, then follows with flipping an internal boolean variable and enabling the Hardware Dvorak layer. Now the game is in text chat mode, and my keyboard is in Dvorak. When I hit `Enter` again, another `Enter` key is sent, which sends the message, then the macro flips the boolean back to false and disables the Hardware Dvorak layer, which brings me back to the standard QWERTY+Quake 2 setup. Hitting `Escape` instead runs a [macro](./keymap.c#L87-L97) that cancels the sending of the message, and undoes the layers. + +![Quake 2](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/quake2.png) + + +---- + +## Function Layer + +### Layer 4: Fn layer - `_FN` + +- Accessed by holding either `Fn` key from any base layer + +Arrows, Navigation keys (Insert, Home, Page Up, etc.), and Function keys are here. Also has keys for Calculator, Menu, Volume Control, and shortcuts for Select All, Undo, Cut, Copy, and Paste. Numpad Enter for when I'm working in Adobe Photoshop, because it treats Numpad Enter differently from the regular Enter key. + +![Fn layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/function.png) + + +---- + +## Other Layers + +### Layer 5: Numpad layer - `_NP` + +- Accessed by holding either `Fn` key and tapping `Space`, from any of the Base Layers + +Puts a Numpad on the right-hand side of the keyboard. A through F included for hexadecimal input. Tapping `Space` returns to the previous Base Layer. + +![Numpad layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/numpad.png) + + +---- + +### Layer 6: Macro layer - `_MA` + +- Accessed by holding the right-side `Win` key + +Has some macros that I use in Git, and keys for use with the [Dynamic Macros feature](https://docs.qmk.fm/#/feature_dynamic_macros). + +For macro documentation, see [my userspace readme](../../../../users/noroadsleft/readme.md). + +![Macro layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/macros.png) + + +---- + +### Layer 7: System layer - `_SY` + +- Accessed by holding either `Fn` key and tapping the `/?` key + +This is where I change my keyboard function. Base layer select on `1` through `4`, Backlight controls on `C` through `N`, Reset on `8*`, Debug on `0)`. Hitting `Esc` exits the layer. + +![System layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/system.png) diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch1.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch1.md deleted file mode 100644 index 87fe99c6551..00000000000 --- a/keyboards/kc60/keymaps/noroadsleft/readme_ch1.md +++ /dev/null @@ -1,48 +0,0 @@ -# @noroadsleft's KC60 keymap - -- [Table of Contents](./readme.md) - 1. **Base Layers** - 2. [Quake 2 Overlays](./readme_ch2.md) - 3. [Function Layers](./readme_ch3.md) - 4. [Other Layers](./readme_ch4.md) - - ----- - -## Layer 0: QWERTY - `_QW` - -Standard QWERTY layout, with four QMK features: - -- The `Menu` key has been replaced by `MO(_FW)`, which moves to my Windows Fn layer when held. -- The Right `GUI` key has been replaced with a `MO(_MA)` key, which moves to the Macro layer when held. -- The `Caps Lock` key has been replaced with a dual function `LT()` key, which opens the Windows Fn layer when held, and is `Caps Lock` when tapped -- The Left `Control` key has been replaced with a `MT(MOD_CTRL, KC_GRV)` key, which is ` ~ when tapped and `Ctrl` when held. - -![QWERTY layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/QWERTY.png) - - ----- - -## Layer 1: Hardware Dvorak - `_DV` - -### Accessed by holding either `Fn` and tapping `/?` key, then tapping `2@`. - -A hardware-based Dvorak Simplified layout. At my weekend job, I use a shared computer that runs MacOS Sierra, in US QWERTY layout. In this layer, I can leave the system in QWERTY, plug my keyboard in, and still type in Dvorak. - -![Hardware Dvorak layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/Dvorak.png) - - ----- - -## Layer 2: Hardware Colemak `_CM` - -### Accessed by holding either `Fn` and tapping `/?` key, then tapping `3#`. - -A hardware-based Colemak layout. Been thinking of trying it, so it's here. - -![Hardware Colemak layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/Colemak.png) - - ----- - -Next Chapter: [Quake 2 Overlays](./readme_ch2.md) diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch2.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch2.md deleted file mode 100644 index 427bebb9a1a..00000000000 --- a/keyboards/kc60/keymaps/noroadsleft/readme_ch2.md +++ /dev/null @@ -1,36 +0,0 @@ -# @noroadsleft's KC60 keymap - -- [Table of Contents](./readme.md) - 1. [Base Layers](./readme_ch1.md) - 2. **Quake 2 Overlays** - 3. [Function Layers](./readme_ch3.md) - 4. [Other Layers](./readme_ch4.md) - - ----- - -## Layers 3, 4 and 5: Quake 2 `_Q2`, Quake 2 Dvorak `_QD`, and Quake 2 Console `_QC` - -### Accessed by holding either `Fn` key and tapping the `/?` key, then tapping `4$` - -These layers were born out of the confusion I have had trying to use the in-game chat and the console in [Quake 2](https://en.wikipedia.org/wiki/Quake_II). When Quake 2 came out, alternate keyboard layouts weren't really a thing. As a result, all in-game text input is hard-locked to US QWERTY, regardless of what the operating system is using for its input method. - -I'm attempting to solve this by some creative use of QMK's macro feature. The keycode in the System layer that enables these layers, [`GO_Q2`](./keymap.c#L387), is a [macro](./keymap.c#L101-L108) that sets the default layer to the QWERTY layer, then turns the Quake 2 layer `_Q2` on. The result is a partially-overwritten QWERTY layer, that has some keycodes with some creative layer switching. - -When I hit the `Enter` key (bound in-game to text chat), the [macro keycode](./keymap.c#L109-L115) I've created sends the keycode for `Enter`, then follows with enabling the Hardware Dvorak layer and its corresponding overlay. Now the game is in text chat mode, and my keyboard is in Dvorak. When I hit `Enter` again, another `Enter` [keycode macro](./keymap.c#L116-L122) is sent, which sends the message, then the macro brings me back to the standard QWERTY+Quake 2 setup. Hitting `Escape` instead runs a [macro](./keymap.c#L123-L129) that cancels the sending of the message, and undoes the layers. - -I have been testing this configuration for a few months. Sometimes I end up still in Dvorak mode without any text input systems (in-game chat or the console) running, but it pretty much always happens when I'm focused on the game, so I don't know the cause yet. - -### Layer 3: Quake 2 -![Quake 2](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/Quake%202.png) - -### Layer 4: Quake 2 Dvorak -![Quake 2 Dvorak](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/Quake%202%20Dvorak.png) - -### Layer 5: Quake 2 Console -![Quake 2 Console](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/Quake%202%20Console.png) - - ----- - -Next Chapter: [Function Layers](./readme_ch3.md) diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md deleted file mode 100644 index 57c0bd4900d..00000000000 --- a/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md +++ /dev/null @@ -1,40 +0,0 @@ -# @noroadsleft's KC60 keymap - -- [Table of Contents](./readme.md) - 1. [Base Layers](./readme_ch1.md) - 2. [Quake 2 Overlays](./readme_ch2.md) - 3. **Function Layers** - 4. [Other Layers](./readme_ch4.md) - - ----- - -## Layer 6: Fn layer - `_FN` - -### Accessed by holding either `Fn` key from any base layer - -Arrows, Navigation keys (Insert, Home, Page Up, etc.), and Function keys are here. Also has keys for Calculator, Menu, Volume Control, and shortcuts for Select All, Undo, Cut, Copy, and Paste. Numpad Enter for when I'm working in Adobe Photoshop, because it treats Numpad Enter differently from the regular Enter key. - -![Windows Fn layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/Fn.png) - - ----- - -## Layer 7: Quake 2 Fn layer - `_FQ` - -### Accessed by holding either `Fn` key while either Quake 2 overlay is active. - -Based on the Windows function layer, but removes some functions that are pointless to have while in the game. - -![Quake 2 Fn layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/Quake%202%20Fn.png) - -Keycode(s) Sent | Notes -:-------------------------------- | :---- -[`Q2_GRV`](./keymap.c#L130-L137) | Sends `KC_GRV`, then enables the Dvorak, Quake 2 Dvorak, and Quake 2 Console layers. - - - - ----- - -Next Chapter: [Other Layers](./readme_ch4.md) diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch4.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch4.md deleted file mode 100644 index 97fa675a9da..00000000000 --- a/keyboards/kc60/keymaps/noroadsleft/readme_ch4.md +++ /dev/null @@ -1,110 +0,0 @@ -# @noroadsleft's KC60 keymap - -- [Table of Contents](./readme.md) - 1. [Base Layers](./readme_ch1.md) - 2. [Quake 2 Overlays](./readme_ch2.md) - 3. [Function Layers](./readme_ch3.md) - 4. **Other Layers** - - ----- - -## Layer 8: Numpad layer - `_NP` - -### Accessed by holding either `Fn` key and tapping `Space`, from any of the Base Layers - -Puts a Numpad on the right-hand side of the keyboard. A through F included for hexadecimal input. Tapping `Space` returns to the previous Base Layer. - -![Numpad layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/Numpad.png) - - ----- - -## Layer 9: Macro layer - `_MA` - -### Accessed by holding the right-side `Win` key - -Has some macros that I use in Git, some frequently-typed strings, and keys for use with the [Dynamic Macros feature](https://docs.qmk.fm/#/feature_dynamic_macros). - -Tapping `Esc` exits the Macro layer, if the macro used doesn't do it automatically. - -![Macro layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/Macro.png) - - -### Macros - -#### [G_PUSH](./keymap.c#L71-L75) - -Output: `git push origin ` - -Everything from here down is related to Git or GitHub. - -#### [G_FTCH](./keymap.c#L76-L85) - -| Condition | Output | -| :-------- | :----- | -| If Shift is active | `git pull upstream ` | -| Otherwise | `git fetch upstream ` | - -#### [G_BRCH](./keymap.c#L86-L95) - -| Condition | Output | -| :-------- | :----- | -| If Shift is active | `master` | -| Otherwise | `$(git branch-name)` | - -`$(git branch-name)` is a [git alias](./readme_git.md) that returns the name of the current branch. - -#### [SIGNA](./keymap.c#L96-L100) - -Output: `\- @noroadsleft` Enter - -Sometimes on GitHub, I sign my comments. Types my GitHub name in Markdown syntax, and then taps the `Enter` key. - -#### "Macro Mode" Macros and Customized Keycodes - -Some of my macros and keycodes do different things depending on the value of the [`macroMode` variable](./keymap.c#L65), which is toggled between `0` and `1` by the [`M_MDSWP` custom keycode](./keymap.c#L238-L242). This is mainly at attempt to make various shortcuts the same key combinations between Windows/Linux and MacOS (which I use at home and work, respectively). - -| Keycode | `macroMode == 0` | `macroMode == 1` | `macroMode == 1` with Shift | -| :------------------------------ | :--------------- | :--------------- | :--------------------------- | -| [M_SALL](./keymap.c#L138-L146) | `Ctrl+A` | `Cmd+A` | `Cmd+A` | -| [M_UNDO](./keymap.c#L147-L159) | `Ctrl+Z` | `Cmd+Z` | `Cmd+Shift+Z` | -| [M_CUT](./keymap.c#L160-L168) | `Ctrl+X` | `Cmd+X` | `Cmd+X` | -| [M_COPY](./keymap.c#L169-L177) | `Ctrl+C` | `Cmd+C` | `Cmd+C` | -| [M_PASTE](./keymap.c#L178-L190) | `Ctrl+V` | `Cmd+V` | `Cmd+Shift+Opt+V` | -| `KC_HOME` | `KC_HOME` | `Cmd+Left` | `Cmd+Left` | -| `KC_END` | `KC_END` | `Cmd+Right` | `Cmd+Right` | -| `KC_PSCR` | `KC_PSCR` | `Cmd+Shift+3` | `Cmd+Shift+3` | - -#### [Emulated Non-US Backslash](./keymap.c#L218-L232) - -Sometimes I type in languages from countries that use ISO layout, but my keyboard is ANSI, so I have one key fewer. This macro simulates the Non-US Backslash key if I use Right Alt + Z. - -#### [VRSN](./keymap.c#L233-L237) - -Outputs a string that tells me the Git commit from which my flashed firmware was built. Looks something like: - - kc60/noroadsleft @ 0.6.326-6-gae6d7b-dirty - -#### [Emulated Numeric Keypad](./keymap.c#L243-L257) - -If I hold the Right Alt key, the number row (`KC_1` through `KC_0`) will output numpad keycodes instead of number row keycodes, enabling quicker access to characters like ™ and °. - -#### [Emulated Extended Function Keys](./keymap.c#L258-L272) - -Similar to the emulated numpad, if I hold the Right Alt key with the Fn key, the function row (`KC_F1` through `KC_F12`) will output keycodes `KC_F13` throught `KC_F24`. - ----- - -### Layer 10: System layer - `_SY` - -#### Accessed by holding either `Fn` key and tapping the `/?` key - -This is where I change my keyboard function. Base layer select on `1` through `3`, Backlight controls on `C` through `N`, Reset on `8*`, Debug on `0)`. - -![System layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/System.png) - - ----- - -[Back to the index.](./) diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_git.md b/keyboards/kc60/keymaps/noroadsleft/readme_git.md deleted file mode 100644 index a8564703fcc..00000000000 --- a/keyboards/kc60/keymaps/noroadsleft/readme_git.md +++ /dev/null @@ -1,79 +0,0 @@ -# @noroadsleft's Git aliases - -[Return to the directory index.](./) - -``` -[alias] - # Change branches - co = checkout - cob = checkout -b - - # Cherry Pick - cp = cherry-pick - - # Check out a Pull Request locally - # e.g. `git cop 351` fetches the commits from Pull Request #351 and saves it to local branch 'pr/351'. - cop = "!f() { git fetch upstream pull/$1/head:pr/$1; git checkout pr/$1; }; f" - - # Sync master branch - sync = !git checkout master && git fetch upstream 2> /dev/null && git pull -n upstream master && git push origin master - - # Return the abbreviated SHA-1 of the last three commits, oldest to newest - rl = rev-list -n 3 --abbrev-commit --reverse HEAD - - # Add remote repo (for sending PRs to other forks, or checking out someone else's developments) - ar = "!f() { git remote add $1 https://github.com/$2/qmk_firmware.git; }; f" - - # Return the last five commits on the branch, in a more compact format - hist = log --pretty=format:\"%C(yellow)%h%Creset %Cgreen%ad%Creset %Cblue[%an%Cgreen% GK%Cblue]%C(yellow)%d%Creset%n %w(100,0,2)%s%n\" --graph --date=iso-local -n 5 - histt = log --pretty=format:\"* %C(yellow)%h%Creset %<(58,trunc)%s %Cblue%>(18,trunc)%an%Cgreen% G?%Creset @ %Cgreen%ad%Creset\" --date=iso-local -n 5 - histb = log --reverse --pretty=format:\"- %Cblue%>(20,trunc)%an %Creset%<(97,trunc)%s\" --date=iso-local -n 5 - - # Follow a file's filename history - follow = log --follow --name-only --pretty=format:\"%C(yellow)commit %H%Creset%d\nAuthor: %an <%ae>\nDate: %ad%n%n %s%n\" --date=iso-local - - # compact diff - df = "diff --compact-summary" - - # List all the files changed in a commit - dt = "diff-tree --no-commit-id --name-only -r" - - # Short-form status - st = "!git status --short --untracked-files=no" - stu = "!git ls-files --others -x '*/*'" - - # Returns the name of the current branch - branch-name = "!git rev-parse --abbrev-ref HEAD" - bn = "!git branch-name" # short-form of the above - # List branches by the date of their last commit, newest to oldest - bbd = "for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='\e[33m%(objectname)\e[0m %(objecttype) \e[32m%(refname:short)\e[0m (%(authordate))'" - - # Compare commit counts between current branch and QMK master - # e.g. `git cc dev_branch upstream/master` returns how many commits are on `dev_branch` and not on `upstream/master`, and vice versa. - cc = "!f() { git fetch upstream; echo \"\e[0;32m$(git branch-name)\e[0m vs. \e[0;31m$2\e[0m\"; git rev-list --left-right --count $1...$2; }; f" - - # Push to origin repo - po = "push origin $(git branch-name)" - - # List the stashes - sl = "stash list" - - # Unstage a file - unstage = "reset HEAD" - - # Restore a file to the state it was in when checked out - restore = "checkout --" - - # Compare local master repo to its upstream branch. If anything is returned, local branch has diverged from upstream. - cm = "!f() { git fetch upstream master; git diff $(git branch-name) upstream/master --compact-summary; }; f" - cml = "!f() { git fetch upstream master; git diff $(git branch-name) upstream/master; }; f" - - # Delete a branch from local and remote - del-branch = "!f() { git branch -d $1; git push origin :$1; git fetch -p origin; }; f" - - # Rebase with signatures - rbv = rebase --exec 'git commit --amend --no-edit -n -S' -i - - # Force push without overwriting established history - pushf = push --force-with-lease -``` diff --git a/users/noroadsleft/noroadsleft.c b/users/noroadsleft/noroadsleft.c index 6fb223f9eca..ac634272566 100644 --- a/users/noroadsleft/noroadsleft.c +++ b/users/noroadsleft/noroadsleft.c @@ -1,4 +1,4 @@ -/* Copyright 2020 James Young (@noroadsleft) +/* Copyright 2020-2021 James Young (@noroadsleft) * * 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 @@ -32,7 +32,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case VRSN: if (record->event.pressed) { - SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + SEND_STRING(QMK_KEYBOARD ":" QMK_KEYMAP " @ " QMK_VERSION); } return false; case G_PUSH: @@ -118,6 +118,21 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { macroMode ^= 1; } return false; + case KC_Z: + if (record->event.pressed) { + if ( get_mods() & MOD_MASK_RALT ) { + register_code(KC_NUBS); + } else { + register_code(KC_Z); + } + } else { + if ( get_mods() & MOD_MASK_RALT ) { + unregister_code(KC_NUBS); + } else { + unregister_code(KC_Z); + } + }; + return false; case KC_1 ... KC_0: if (record->event.pressed) { if (get_mods() & MOD_MASK_RALT) { @@ -148,6 +163,33 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case KC_PSCR: + if (record->event.pressed) { + if ( macroMode == 1 ) { + tap_code16(G(S(KC_3))); + } else { + tap_code(KC_PSCR); + } + } + return false; + case KC_HOME: + if (record->event.pressed) { + if ( macroMode == 1 ) { + tap_code16(G(KC_LEFT)); + } else { + tap_code(KC_HOME); + } + } + return false; + case KC_END: + if (record->event.pressed) { + if ( macroMode == 1 ) { + tap_code16(G(KC_RGHT)); + } else { + tap_code(KC_END); + } + } + return false; } // switch() return true; }; diff --git a/users/noroadsleft/noroadsleft.h b/users/noroadsleft/noroadsleft.h index 2d597219f50..52bcec0abd0 100644 --- a/users/noroadsleft/noroadsleft.h +++ b/users/noroadsleft/noroadsleft.h @@ -1,4 +1,4 @@ -/* Copyright 2020 James Young (@noroadsleft) +/* Copyright 2020-2021 James Young (@noroadsleft) * * 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 diff --git a/users/noroadsleft/readme.md b/users/noroadsleft/readme.md index f018a422710..6a454b7c744 100644 --- a/users/noroadsleft/readme.md +++ b/users/noroadsleft/readme.md @@ -2,29 +2,62 @@ This directory holds the code that's the same for every keyboard I use in QMK, which is currently: -| Status | Keyboard | -| :----------------- | :------- | -| :heavy_check_mark: | `kc60` -| :heavy_check_mark: | `kbdfans/kbd75/rev1` +- `kc60` +- `kbdfans/kbd75/rev1` +- `coseyfannitutti/discipline` -## Features -### Emulated Non-US Backslash +## Macro Features and Custom Keycodes -Sends `KC_NUBS` when the Z key is tapped while the Right Alt key is being held. +### [VRSN](./noroadsleft.c#L33-L37) -### Emulated Numeric Keypad +Outputs a string that tells me the Git commit from which my flashed firmware was built. Looks something like: -Turns number row keycodes into their numeric keypad equivalents while the Right Alt key is being held. + kc60:noroadsleft @ 0.6.326-6-gae6d7b-dirty -### Emulated F13-F24 +### Git Macros -Turns F1-F12 into F13-F24 while the Right Alt key is being held. +Some frequently used Git commands. + +| Keycode | Output | Output with Shift | +| :---------------------------------- | :--------------------- | :--------------------------- | +| [`G_PUSH`](./noroadsleft.c#L38-L42) | `git push origin ` | `git push origin ` | +| [`G_FTCH`](./noroadsleft.c#L43-L52) | `git fetch upstream ` | `git pull upstream ` | +| [`G_BRCH`](./noroadsleft.c#L53-L62) | `master` | `$(git branch-name)` | + +`$(git branch-name)` is an alias for `git rev-parse --abbrev-ref HEAD`, which normally return the name of the current branch. + +### "Macro Mode" Macros and Customized Keycodes + +Some of my macros and keycodes do different things depending on the value of the [`macroMode` variable](./noroadsleft.c#L23), which is [toggled between `0` and `1`](./noroadsleft.c#L116-L120) by the `M_MDSWP` custom keycode.[1](#footnotes) This is mainly at attempt to make various shortcuts use the same physical key combinations between Windows/Linux and MacOS (which I use at home and work, respectively). + +| Keycode | `macroMode == 0` | `macroMode == 1` | `macroMode == 1` with Shift | +| :------------------------------------- | :--------------- | :--------------- | :------------------------------------- | +| [`M_SALL`](./noroadsleft.c#L63-L71) | `Ctrl+A` | `Cmd+A` | `Cmd+A` | +| [`M_UNDO`](./noroadsleft.c#L72-L84) | `Ctrl+Z` | `Cmd+Z` | `Cmd+Shift+Z` | +| [`M_CUT`](./noroadsleft.c#L85-L93) | `Ctrl+X` | `Cmd+X` | `Cmd+X` | +| [`M_COPY`](./noroadsleft.c#L94-L102) | `Ctrl+C` | `Cmd+C` | `Cmd+C` | +| [`M_PASTE`](./noroadsleft.c#L103-L115) | `Ctrl+V` | `Cmd+V` | `Cmd+Shift+Opt+V` | +| [`KC_PSCR`](./noroadsleft.c#L166-L174) | `KC_PSCR` | `Cmd+Shift+3` | `Cmd+Shift+3` | +| [`KC_HOME`](./noroadsleft.c#L175-L183) | `KC_HOME` | `Cmd+Left` | `Cmd+Left` | +| [`KC_END`](./noroadsleft.c#L184-L192) | `KC_END` | `Cmd+Right` | `Cmd+Right` | + +### [Emulated Non-US Backslash](./noroadsleft.c#L121-L135) + +Sometimes I type in languages from countries that use ISO layout, but my keyboard is ANSI, so I have one key fewer. This macro simulates the Non-US Backslash key if I use Right Alt + `KC_Z`. + +### [Emulated Numeric Keypad](./noroadsleft.c#L136-L150) + +If I hold the Right Alt key, the number row (`KC_1` through `KC_0`) will output numpad keycodes instead of number row keycodes, enabling quicker access to characters like ™ and °. + +### [Emulated Extended Function Keys](./noroadsleft.c#L151-L165) + +Similar to the emulated numpad, if I hold the Right Alt key with the Fn key, the function row (`KC_F1` through `KC_F12`) will output keycodes `KC_F13` throught `KC_F24`. ## License -Copyright 2020 noroadsleft +Copyright 2020-2021 James Young (@noroadsleft) 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 @@ -38,3 +71,11 @@ 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 . + + +## Footnotes + +- 1: [^](#macro-mode-macros-and-customized-keycodes) The `M_MDSWP` keycode is used in my keymaps in the following locations: + - [KC60](../../keyboards/kc60/keymaps/noroadsleft/keymap.c#L206) + - [KBDfans KBD75 rev1](../../keyboards/kbdfans/kbd75/keymaps/noroadsleft/keymap.c#L102) + - [CoseyFannitutti Discipline](../../keyboards/coseyfannitutti/discipline/keymaps/noroadsleft/keymap.c#L67)