2021-02-11 01:17:42 +06:00
# @noroadsleft's Userspace
This directory holds the code that's the same for every keyboard I use in QMK, which is currently:
2021-04-27 12:44:45 +06:00
- `kc60`
- `kbdfans/kbd75/rev1`
- `coseyfannitutti/discipline`
2021-02-11 01:17:42 +06:00
2021-04-27 12:44:45 +06:00
## Macro Features and Custom Keycodes
2021-02-11 01:17:42 +06:00
2021-11-10 09:45:59 +06:00
### [VRSN](./noroadsleft.c#L44-L48)
2021-02-11 01:17:42 +06:00
2021-04-27 12:44:45 +06:00
Outputs a string that tells me the Git commit from which my flashed firmware was built. Looks something like:
2021-02-11 01:17:42 +06:00
2021-12-14 13:42:43 +06:00
kc60:noroadsleft # @ 0.6.326-6-gae6d7b-dirty
2021-02-11 01:17:42 +06:00
2021-04-27 12:44:45 +06:00
### Git Macros
2021-02-11 01:17:42 +06:00
2021-04-27 12:44:45 +06:00
Some frequently used Git commands.
2022-07-19 08:09:05 +06:00
| Keycode | Output | Output with < kbd > Shift< / kbd > |
| :---------------------------------- | :---------------------------------------------------- | :---------------------------------------------------- |
| [`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)` |
| [`G_PWD` ](./noroadsleft.c#L69-L74 ) | `$( pwd \| sed -e 's;^.*/keyboards/;;' -e 's;/;_;g')` | `$( pwd \| sed -e 's;^.*/keyboards/;;' -e 's;/;_;g')` |
2021-04-27 12:44:45 +06:00
2021-05-04 06:31:36 +06:00
`$(git branch-name)` is an alias for `git rev-parse --abbrev-ref HEAD` , which normally returns the name of the current branch.
2021-04-27 12:44:45 +06:00
2022-07-19 08:09:05 +06:00
The `G_PWD` macro outputs a shell expansion that returns the current working directory in relation to `qmk_firmware/keyboards/` , and with the slashes replaced with underscores. I do a lot of keyboard refactoring in QMK, and this is a string I use regularly.
2021-12-14 13:42:43 +06:00
### Customized Keycodes
2021-04-27 12:44:45 +06:00
2021-12-14 13:42:43 +06:00
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.
2021-04-27 12:44:45 +06:00
2021-12-14 13:42:43 +06:00
| Keycode | Action |
| :------------------------------------ | :-------- |
2022-07-19 08:09:05 +06:00
| [`M_SALL` ](./noroadsleft.c#L75-L79 ) | `Ctrl+A` |
| [`M_UNDO` ](./noroadsleft.c#L80-L88 ) | `Ctrl+Z` |
| [`M_CUT` ](./noroadsleft.c#L89-L93 ) | `Ctrl+X` |
| [`M_COPY` ](./noroadsleft.c#L94-L98 ) | `Ctrl+C` |
| [`M_PASTE` ](./noroadsleft.c#L99-L107 ) | `Ctrl+V` |
2021-04-27 12:44:45 +06:00
2021-12-14 13:42:43 +06:00
### [Emulated Non-US Backslash](./noroadsleft.c#L27-L37)
2021-04-27 12:44:45 +06:00
2021-06-03 12:06:30 +06:00
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.
2021-04-27 12:44:45 +06:00
2021-06-03 12:06:30 +06:00
This macro simulates the Non-US Backslash key if I hold Right Alt and tap the key to the right of Left Shift.
2021-12-14 13:42:43 +06:00
Requires defining `ANSI_NUBS_ROW` and `ANSI_NUBS_COL` in `config.h` at the keymap level.[< sup > 1</ sup > ](#footnotes)
2021-06-03 12:06:30 +06:00
2022-07-19 08:09:05 +06:00
### [Emulated Numeric Keypad](./noroadsleft.c#L108-L122)
2021-04-27 12:44:45 +06:00
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 °.
2022-07-19 08:09:05 +06:00
### [Emulated Extended Function Keys](./noroadsleft.c#L123-L137)
2021-04-27 12:44:45 +06:00
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` .
2021-02-11 01:17:42 +06:00
## License
2022-07-19 08:09:05 +06:00
Copyright 2020-2022 James Young (@noroadsleft)
2021-02-11 01:17:42 +06:00
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 < http: / / www . gnu . org / licenses / > .
2021-04-27 12:44:45 +06:00
## Footnotes
2021-12-14 13:42:43 +06:00
- 1: [^ ](#emulated-non-us-backslash ) `ANSI_NUBS_ROW` and `ANSI_NUBS_COL` are in the following locations:
2021-06-03 12:06:30 +06:00
- [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 )