mirror of
https://github.com/openstenoproject/qmk
synced 2024-11-21 16:04:38 +00:00
Update noroadsleft userspace and keymaps (2021-12-13) (#15470)
* remove macroMode functionality * update kbdfans/kbd75/rev1:noroadsleft keymap - replace `_______` instances with `XXXXXXX` on System layer - add line breaks between keymap layers
This commit is contained in:
parent
8d604e707b
commit
59a1495fbf
6 changed files with 45 additions and 105 deletions
|
@ -63,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
|
||||
[_SY] = LAYOUT_65_ansi(
|
||||
TG(_SY), TO(_DV), TO(_QW), 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, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
||||
|
|
|
@ -56,6 +56,7 @@ qk_tap_dance_action_t tap_dance_actions[] = {
|
|||
#define FN_CAPS LT(_FN,KC_CAPS)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_DV] = LAYOUT_75_ansi_wkl(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, MO(_SY),
|
||||
KC_GRV, 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,
|
||||
|
@ -64,6 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
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,
|
||||
KC_LCTL, TD(LAG), KC_SPC, TD(RAG), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
|
||||
[_QW] = LAYOUT_75_ansi_wkl(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, MO(_SY),
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME,
|
||||
|
@ -72,6 +74,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
|
||||
KC_LCTL, TD(LAG), KC_SPC, TD(RAG), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
|
||||
[_Q2] = LAYOUT_75_ansi_wkl(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
@ -80,6 +83,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, KC_LALT, _______, KC_RALT, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[_FN] = LAYOUT_75_ansi_wkl(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, DM_REC1,
|
||||
|
@ -88,14 +92,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
_______, M_UNDO, M_CUT, M_COPY, M_PASTE, G_BRCH, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, DM_PLY2,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[_SY] = LAYOUT_75_ansi_wkl(
|
||||
_______, TO(_DV), TO(_QW), _______, TG(_Q2), _______, _______, _______, RESET, EEP_RST, DEBUG, _______, VRSN, _______, _______, _______,
|
||||
_______, _______, M_MDSWP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______,
|
||||
_______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_BRTG, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______
|
||||
TG(_SY), TO(_DV), TO(_QW), XXXXXXX, TG(_Q2), XXXXXXX, XXXXXXX, XXXXXXX, RESET, EEP_RST, DEBUG, XXXXXXX, VRSN, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL, XXXXXXX,
|
||||
XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, 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, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
||||
),
|
||||
|
||||
};
|
||||
|
||||
bool led_update_user(led_t led_state) {
|
||||
|
|
|
@ -108,7 +108,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
|
||||
[_SY] = LAYOUT_60_ansi(
|
||||
TG(_SY), TO(_DV), TO(_QW), TO(_CM), TG(_Q2), XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, DEBUG, XXXXXXX, VRSN, 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, BL_DEC, BL_TOGG, BL_INC, BL_BRTG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX
|
||||
|
|
|
@ -17,11 +17,6 @@
|
|||
#include "noroadsleft.h"
|
||||
#include "version.h"
|
||||
|
||||
/*******************
|
||||
** MODIFIER MASKS **
|
||||
*******************/
|
||||
bool macroMode = 0;
|
||||
|
||||
__attribute__((weak))
|
||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; };
|
||||
|
||||
|
@ -73,60 +68,35 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
return false;
|
||||
case M_SALL:
|
||||
if (record->event.pressed) {
|
||||
if ( macroMode == 1 ) {
|
||||
SEND_STRING(SS_LGUI("a"));
|
||||
} else {
|
||||
SEND_STRING(SS_LCTL("a"));
|
||||
}
|
||||
tap_code16(C(KC_A));
|
||||
}
|
||||
return false;
|
||||
case M_UNDO:
|
||||
if (record->event.pressed) {
|
||||
if ( macroMode == 1 ) {
|
||||
if ( get_mods() & MOD_MASK_SHIFT ) {
|
||||
SEND_STRING(SS_LSFT(SS_LGUI("z")));
|
||||
} else {
|
||||
SEND_STRING(SS_LGUI("z"));
|
||||
}
|
||||
} else {
|
||||
SEND_STRING(SS_LCTL("z"));
|
||||
}
|
||||
register_code(KC_LCTL);
|
||||
register_code(KC_Z);
|
||||
} else {
|
||||
unregister_code(KC_Z);
|
||||
unregister_code(KC_LCTL);
|
||||
}
|
||||
return false;
|
||||
case M_CUT:
|
||||
if (record->event.pressed) {
|
||||
if ( macroMode == 1 ) {
|
||||
SEND_STRING(SS_LGUI("x"));
|
||||
} else {
|
||||
SEND_STRING(SS_LCTL("x"));
|
||||
}
|
||||
tap_code16(C(KC_X));
|
||||
}
|
||||
return false;
|
||||
case M_COPY:
|
||||
if (record->event.pressed) {
|
||||
if ( macroMode == 1 ) {
|
||||
SEND_STRING(SS_LGUI("c"));
|
||||
} else {
|
||||
SEND_STRING(SS_LCTL("c"));
|
||||
}
|
||||
tap_code16(C(KC_C));
|
||||
}
|
||||
return false;
|
||||
case M_PASTE:
|
||||
if (record->event.pressed) {
|
||||
if ( macroMode == 1 ) {
|
||||
if ( get_mods() & MOD_MASK_SHIFT ) {
|
||||
SEND_STRING(SS_LSFT(SS_LALT(SS_LGUI("v"))));
|
||||
} else {
|
||||
SEND_STRING(SS_LGUI("v"));
|
||||
}
|
||||
} else {
|
||||
SEND_STRING(SS_LCTL("v"));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case M_MDSWP:
|
||||
if (record->event.pressed) {
|
||||
macroMode ^= 1;
|
||||
register_code(KC_LCTL);
|
||||
register_code(KC_V);
|
||||
} else {
|
||||
unregister_code(KC_V);
|
||||
unregister_code(KC_LCTL);
|
||||
}
|
||||
return false;
|
||||
case KC_1 ... KC_0:
|
||||
|
@ -159,33 +129,6 @@ 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;
|
||||
};
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include QMK_KEYBOARD_H
|
||||
|
||||
#define MOD_MASK_RALT (MOD_BIT(KC_RALT))
|
||||
extern bool macroMode;
|
||||
|
||||
enum userspace_keycodes {
|
||||
VRSN = SAFE_RANGE,
|
||||
|
@ -31,7 +30,6 @@ enum userspace_keycodes {
|
|||
M_CUT,
|
||||
M_COPY,
|
||||
M_PASTE,
|
||||
M_MDSWP,
|
||||
KEYMAP_SAFE_RANGE
|
||||
};
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ This directory holds the code that's the same for every keyboard I use in QMK, w
|
|||
|
||||
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
|
||||
kc60:noroadsleft # @ 0.6.326-6-gae6d7b-dirty
|
||||
|
||||
### Git Macros
|
||||
|
||||
|
@ -21,40 +21,37 @@ Some frequently used Git commands.
|
|||
|
||||
| Keycode | Output | Output with <kbd>Shift</kbd> |
|
||||
| :---------------------------------- | :--------------------- | :--------------------------- |
|
||||
| [`G_PUSH`](./noroadsleft.c#L49-L53) | `git push origin ` | `git push origin ` |
|
||||
| [`G_FTCH`](./noroadsleft.c#L54-L63) | `git fetch upstream ` | `git pull upstream ` |
|
||||
| [`G_BRCH`](./noroadsleft.c#L64-L73) | `master` | `$(git branch-name)` |
|
||||
| [`G_PUSH`](./noroadsleft.c#L44-L48) | `git push origin ` | `git push origin ` |
|
||||
| [`G_FTCH`](./noroadsleft.c#L49-L58) | `git fetch upstream ` | `git pull upstream ` |
|
||||
| [`G_BRCH`](./noroadsleft.c#L59-L68) | `master` | `$(git branch-name)` |
|
||||
|
||||
`$(git branch-name)` is an alias for `git rev-parse --abbrev-ref HEAD`, which normally returns the name of the current branch.
|
||||
|
||||
### "Macro Mode" Macros and Customized Keycodes
|
||||
### 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#L127-L131) by the `M_MDSWP` custom keycode.[<sup>1</sup>](#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).
|
||||
I used to have a boolean variable that changed the functionality of these keycodes, but I no longer work in the environment that I wrote the functionality for, so I took it out. The keycodes still exist because all my `keymap.c` files reference the custom keycodes I defined.
|
||||
|
||||
| Keycode | `macroMode == 0` | `macroMode == 1` | `macroMode == 1` with <kbd>Shift</kbd> |
|
||||
| :------------------------------------- | :--------------- | :--------------- | :------------------------------------- |
|
||||
| [`M_SALL`](./noroadsleft.c#L74-L82) | `Ctrl+A` | `Cmd+A` | `Cmd+A` |
|
||||
| [`M_UNDO`](./noroadsleft.c#L83-L95) | `Ctrl+Z` | `Cmd+Z` | `Cmd+Shift+Z` |
|
||||
| [`M_CUT`](./noroadsleft.c#L96-L104) | `Ctrl+X` | `Cmd+X` | `Cmd+X` |
|
||||
| [`M_COPY`](./noroadsleft.c#L105-L113) | `Ctrl+C` | `Cmd+C` | `Cmd+C` |
|
||||
| [`M_PASTE`](./noroadsleft.c#L114-L126) | `Ctrl+V` | `Cmd+V` | `Cmd+Shift+Opt+V` |
|
||||
| [`KC_PSCR`](./noroadsleft.c#L162-L170) | `KC_PSCR` | `Cmd+Shift+3` | `Cmd+Shift+3` |
|
||||
| [`KC_HOME`](./noroadsleft.c#L171-L179) | `KC_HOME` | `Cmd+Left` | `Cmd+Left` |
|
||||
| [`KC_END`](./noroadsleft.c#L180-L188) | `KC_END` | `Cmd+Right` | `Cmd+Right` |
|
||||
| Keycode | Action |
|
||||
| :------------------------------------ | :-------- |
|
||||
| [`M_SALL`](./noroadsleft.c#L69-L73) | `Ctrl+A` |
|
||||
| [`M_UNDO`](./noroadsleft.c#L74-L82) | `Ctrl+Z` |
|
||||
| [`M_CUT`](./noroadsleft.c#L83-L87) | `Ctrl+X` |
|
||||
| [`M_COPY`](./noroadsleft.c#L88-L92) | `Ctrl+C` |
|
||||
| [`M_PASTE`](./noroadsleft.c#L93-L101) | `Ctrl+V` |
|
||||
|
||||
### [Emulated Non-US Backslash](./noroadsleft.c#L32-L42)
|
||||
### [Emulated Non-US Backslash](./noroadsleft.c#L27-L37)
|
||||
|
||||
Sometimes I type in languages from countries that use ISO layout, but my keyboards are all ANSI layout, so I have one key fewer than necessary.
|
||||
|
||||
This macro simulates the Non-US Backslash key if I hold Right Alt and tap the key to the right of Left Shift.
|
||||
|
||||
Requires defining `ANSI_NUBS_ROW` and `ANSI_NUBS_COL` in `config.h` at the keymap level.[<sup>2</sup>](#footnotes)
|
||||
Requires defining `ANSI_NUBS_ROW` and `ANSI_NUBS_COL` in `config.h` at the keymap level.[<sup>1</sup>](#footnotes)
|
||||
|
||||
### [Emulated Numeric Keypad](./noroadsleft.c#L132-L146)
|
||||
### [Emulated Numeric Keypad](./noroadsleft.c#L102-L116)
|
||||
|
||||
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#L147-L161)
|
||||
### [Emulated Extended Function Keys](./noroadsleft.c#L117-L131)
|
||||
|
||||
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`.
|
||||
|
||||
|
@ -79,11 +76,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
## 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#L111)
|
||||
- [KBDfans KBD75 rev1](../../keyboards/kbdfans/kbd75/keymaps/noroadsleft/keymap.c#L93)
|
||||
- [CoseyFannitutti Discipline](../../keyboards/coseyfannitutti/discipline/keymaps/noroadsleft/keymap.c#L66)
|
||||
- 2: [^](#emulated-non-us-backslash) `ANSI_NUBS_ROW` and `ANSI_NUBS_COL` are in the following locations:
|
||||
- 1: [^](#emulated-non-us-backslash) `ANSI_NUBS_ROW` and `ANSI_NUBS_COL` are in the following locations:
|
||||
- [KC60](../../keyboards/kc60/keymaps/noroadsleft/config.h#L35-L36)
|
||||
- [KBDfans KBD75 rev1](../../keyboards/kbdfans/kbd75/keymaps/noroadsleft/config.h#L26-L27)
|
||||
- [CoseyFannitutti Discipline](../../keyboards/coseyfannitutti/discipline/keymaps/noroadsleft/config.h#L19-L20)
|
||||
|
|
Loading…
Reference in a new issue