Skip to content

Commit

Permalink
[Keymap] Updates to noroadsleft keymap for KC60 (2019-11-05) (qmk#7265)
Browse files Browse the repository at this point in the history
* Rename layers_keymap to layer_names

* Update Escape and Left Control keys

- change KC_GESC to KC_ESC
- change KC_LCTL to MT(MOD_LCTL, KC_GRV)

* Disable features I don't use

Makes the firmware lean. Why? Because I can. :D

* Update the readme files

* Add KC_F13 through KC_F24 emulation

... and update the readme files accordingly.

* Update rules/config

- Swap EXTRAFLAGS for LINK_TIME_OPTIMIZATION_ENABLE
  - remove NO_ACTION_MACRO and NO_ACTION_FUNCTION
- Re-enable COMMAND

* concatenate full-length and short layer names

* enable dynamic macros

* update readme files
  • Loading branch information
noroadsleft authored and drashna committed Nov 6, 2019
1 parent dfb78d2 commit 95309e9
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 90 deletions.
9 changes: 9 additions & 0 deletions keyboards/kc60/keymaps/noroadsleft/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@
#define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 5
#define BREATHING_PERIOD 4

#ifdef LOCKING_SUPPORT_ENABLE
# undef LOCKING_SUPPORT_ENABLE
#endif
#ifdef LOCKING_RESYNC_ENABLE
# undef LOCKING_RESYNC_ENABLE
#endif

#define NO_ACTION_ONESHOT
70 changes: 42 additions & 28 deletions keyboards/kc60/keymaps/noroadsleft/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,39 @@
/**********************
** LAYER DEFINITIONS **
**********************/
enum layers_keymap {
enum layer_names {
// BASE LAYERS
// SHORT CODES
_QWERTY = 0,
_QW = _QWERTY,
_DVORAK,
_DV = _DVORAK,
_COLEMAK,
_CM = _COLEMAK,
_MAC,
_MC = _MAC,
_QUAKE2,
_Q2 = _QUAKE2,
_QUAKE2_DVORAK,
_QD = _QUAKE2_DVORAK,
_QUAKE2_CONSOLE,

_QC = _QUAKE2_CONSOLE,
// FUNCTION LAYERS
_FUNCWIN,
_FW = _FUNCWIN,
_FUNCMAC,
_FM = _FUNCMAC,
_FUNCQ2,

_FQ = _FUNCQ2,
// OTHER LAYERS
_NUMPAD,
_NP = _NUMPAD,
_MACROS,
_SYSTEM
_MA = _MACROS,
_SYSTEM,
_SY = _SYSTEM,
};

// LAYER SHORT CODES
#define _QW _QWERTY
#define _DV _DVORAK
#define _CM _COLEMAK
#define _MC _MAC
#define _Q2 _QUAKE2
#define _QD _QUAKE2_DVORAK
#define _QC _QUAKE2_CONSOLE
#define _FW _FUNCWIN
#define _FM _FUNCMAC
#define _FQ _FUNCQ2
#define _NP _NUMPAD
#define _MA _MACROS
#define _SY _SYSTEM


// KEYCODE DEFINITIONS
#define NO_CHNG KC_TRNS // Note for me for keys I need to leave as Pass-through
Expand All @@ -58,6 +55,8 @@ enum layers_keymap {
#define WN_COPY LCTL(DV_C) // Windows/Linux Copy
#define WN_PSTE LCTL(DV_V) // Windows/Linux Paste

#define CTL_GRV MT(MOD_LCTL, KC_GRV) // Left Control when held, Grave accent when tapped

#define MC_PSCR LGUI(LSFT(KC_3)) // MacOS Print Screen (Command + Shift + 3)
#define MC_HOME LGUI(KC_LEFT) // MacOS Home (Command + Left Arrow)
#define MC_END LGUI(KC_RGHT) // MacOS End (Command + Right Arrow)
Expand Down Expand Up @@ -252,6 +251,21 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
}
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;
};
Expand All @@ -267,31 +281,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* QWERTY */
[_QWERTY] = LAYOUT_60_ansi(
// 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
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_ESC, 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_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, \
FW_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_LSFT, NUBS_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \
CTL_GRV, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_MA), MO(_FW), KC_RCTL \
),

/* Dvorak */
[_DVORAK] = LAYOUT_60_ansi(
// 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
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_ESC, 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_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, \
FW_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_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \
CTL_GRV, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_MA), MO(_FW), KC_RCTL \
),

/* Colemak */
[_COLEMAK] = LAYOUT_60_ansi(
// 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
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_ESC, 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_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, \
FW_CAPS, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \
CTL_GRV, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_MA), MO(_FW), KC_RCTL \
),

/****************
Expand Down Expand Up @@ -391,9 +405,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Macro layer */
[_MACROS] = LAYOUT_60_ansi(
// 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
TG(_MA), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, G_PUSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, G_FTCH, G_COMM, _______, _______, _______, _______, T_L3DED, _______, _______, _______, \
TG(_MA), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DM_REC1, DM_REC2, _______, \
_______, _______, _______, G_PUSH, _______, _______, _______, _______, _______, _______, _______, DM_PLY1, DM_PLY2, DM_RSTP, \
_______, _______, _______, G_FTCH, G_COMM, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, G_BRCH, SIGNA, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, NO_CHNG, _______ \
),
Expand Down
14 changes: 13 additions & 1 deletion keyboards/kc60/keymaps/noroadsleft/readme.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
# @noroadsleft's KC60 keymap

### Last updated: April 7, 2019, 2:26 AM UTC-0700
### Last updated: November 5, 2019, 12:07 AM UTC-0800

![](https://i.imgur.com/tzhXQYI.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

Images in this readme follow the following format:

![Legend](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/legend.png)
*Legend*

Descriptions of the physical locations of keys will use the key's function in a US QWERTY layout, even if the layout itself is not QWERTY.


----

# Outline
Expand Down
31 changes: 6 additions & 25 deletions keyboards/kc60/keymaps/noroadsleft/readme_ch1.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,14 @@

## Layer 0: QWERTY - `_QW`

Standard QWERTY layout, with three QMK features:
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 `Escape` key has been replaced with a `KC_GESC` `` ` ~ `` key when used with a `Fn` key or a `Shift` key
- The Left `Control` key has been replaced with a `MT(MOD_CTRL, KC_GRV)` key, which is <code>&#96; ~</code> when tapped and `Ctrl` when held.

###### For the rest of this readme, the physical location of keys will be referred to by their function in a US QWERTY layout.

![QWERTY layer](https://i.imgur.com/2eVsefw.png)

Keycode(s) Sent | Notes
:---------------------------------------------------- | :----
[`KC_GESC`](https://docs.qmk.fm/#/feature_grave_esc) | `Esc` when tapped alone, `` ` ~ `` when used with a `Shift` or `GUI` key.
`LT(_FW, KC_CAPS)` | Opens the Windows Fn layer when held; toggles Caps Lock when tapped.
`MO(_FW)` | Opens the Windows Fn layer when held.
![QWERTY layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/layer_00.png)


----
Expand All @@ -37,13 +30,7 @@ Keycode(s) Sent | Notes

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://i.imgur.com/a6hYedB.png)

Keycode(s) Sent | Notes
:---------------------------------------------------- | :----
[`KC_GESC`](https://docs.qmk.fm/#/feature_grave_esc) | `Esc` when tapped alone, `` ` ~ `` when used with a `Shift` or `GUI` key.
`LT(_FW, KC_CAPS)` | Opens the Windows Fn layer when held; toggles Caps Lock when tapped.
`MO(_FW)` | Opens the Windows Fn layer when held.
![Hardware Dvorak layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/layer_01.png)


----
Expand All @@ -54,13 +41,7 @@ Keycode(s) Sent | Notes

A hardware-based Colemak layout. Been thinking of trying it, so it's here.

![Hardware Colemak layer](https://i.imgur.com/dbQ6HDW.png)

Keycode(s) Sent | Notes
:---------------------------------------------------- | :----
[`KC_GESC`](https://docs.qmk.fm/#/feature_grave_esc) | `Esc` when tapped alone, `` ` ~ `` when used with a `Shift` or `GUI` key.
`LT(_FW, KC_CAPS)` | Opens the Windows Fn layer when held; toggles Caps Lock when tapped.
`MO(_FW)` | Opens the Windows Fn layer when held.
![Hardware Colemak layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/layer_02.png)


----
Expand Down
2 changes: 1 addition & 1 deletion keyboards/kc60/keymaps/noroadsleft/readme_ch2.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

This layer overrides the `Fn` keys on whichever base layer is currently enabled, sending the keyboard to the MacOS-oriented Fn layer `_FM`, instead of the Windows Fn layer `_FW`.

![MacOS Overlay](https://i.imgur.com/lxsEVpm.png)
![MacOS Overlay](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/layer_03.png)


----
Expand Down
10 changes: 5 additions & 5 deletions keyboards/kc60/keymaps/noroadsleft/readme_ch3.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@

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#L404), is a [macro](./keymap.c#L165-L172) 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.
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#L418), is a [macro](./keymap.c#L164-L171) 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#L173-L179) 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#L180-L186) 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#L187-L193) that cancels the sending of the message, and undoes the layers.
When I hit the `Enter` key (bound in-game to text chat), the [macro keycode](./keymap.c#L172-L178) 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#L179-L185) 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#L186-L192) 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 4: Quake 2
![Quake 2](https://i.imgur.com/WEZ9p2u.png)
![Quake 2](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/layer_04.png)

### Layer 5: Quake 2 Dvorak
![Quake 2 Dvorak](https://i.imgur.com/rhugHN4.png)
![Quake 2 Dvorak](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/layer_05.png)

### Layer 6: Quake 2 Console
![Quake 2 Console](https://i.imgur.com/dRTAjcy.png)
![Quake 2 Console](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/layer_06.png)


----
Expand Down
8 changes: 4 additions & 4 deletions keyboards/kc60/keymaps/noroadsleft/readme_ch4.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

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://i.imgur.com/XwCshcz.png)
![Windows Fn layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/layer_07.png)


----
Expand All @@ -27,7 +27,7 @@ Arrows, Navigation keys (Insert, Home, Page Up, etc.), and Function keys are her

Based on my Windows Fn layer, but swaps a few functions for a MacOS environment. Arrow, Navigation, and Function keys are basically unchanged from Layer 2. This layer enables using either `Fn` key as a sort of simulated `Command` key, which I find easier to reach and use.

![MacOS-oriented Fn layer](https://i.imgur.com/Z11kRu2.png)
![MacOS-oriented Fn layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/layer_08.png)


----
Expand All @@ -38,11 +38,11 @@ Based on my Windows Fn layer, but swaps a few functions for a MacOS environment.

Based on the Windows function layer, but removes some functions that are pointless to have while in the game.

![Quake 2 Fn layer](https://i.imgur.com/9PG7yWb.png)
![Quake 2 Fn layer](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/kc60/keymaps/noroadsleft/layer_09.png)

Keycode(s) Sent | Notes
:-------------------------------- | :----
[`Q2_GRV`](./keymap.c#L194-L201) | Sends `KC_GRV`, then enables the Dvorak, Quake 2 Dvorak, and Quake 2 Console layers.
[`Q2_GRV`](./keymap.c#L193-L200) | Sends `KC_GRV`, then enables the Dvorak, Quake 2 Dvorak, and Quake 2 Console layers.



Expand Down
Loading

0 comments on commit 95309e9

Please sign in to comment.