Setup: My keymaps in progress (qwerty/qwertz based)

To answer a question in another thread I am posting my current keymaps. The keymaps are evolving, because I have the UHK just a bit more than a week. But I am already pretty happy due the great help I got here to define my needed layer-toggles and functions.

The keymaps are based on the experience I had with an extended navigation and character layer I am using for the German qwertz-Layout already since 2008, described here in detail: DeutschlandPlus - custom navigation and character layer.

The general idea is similar to the one from Max, using the CapsLock as the modifier key for an extended layer. I restrict my keymaps/ layouts in such a way that they are as compatible as possible across different keyboards (standard, laptop, ANSI, ISO) and follow the rule that I try to make the most work from the home-row-position, touch-typing with 10 fingers (~ 60wpm to 80 wpm). A modifier (Shift, mod) must always be pressed with the opposing hand.

Base layer

The base layer is pretty standard and shows US symbols in Agent, while my OS is set to German:

I added arrow keys to the bottom right, which I use for keyboard shortcuts or one-handed (while browsing). Switching to the mod layer is with the two large thumb-keys. The right one triggers space on a keyTap and mod when hold-down.

# Space Mod
# this works reliable in contrast to the default SecondaryRole function:
resolveSecondary 200 primaryaction secondaryaction 
primaryaction: final tapKey space
secondaryaction: final holdLayer mod

I use PrintScreen (and combos with it) very often for my work, so that got a dedicated key on the case button.

The key-module as well the left case button allow to switch to the Mouse and Media layer with a single key press. Holding the key just activates the mouse layer and exits when released.The case button doubles in that role, when I remove the modules for “on the lap” use of the keyboard and still want access to the mouse layer than of course.

# Mouse layer - base
holdLayer mouse
ifInterrupted break
ifPlaytime 300 break
toggleLayer mouse

I want also DEL as a one-key operation for one-handed (browsing) use, same for ESC.

mod layer

The mod-layer is the navigation and editing layer and includes the most important shortcuts:


The mod layer is my main extended layer – easy to reach with both thumb keys (space bar left/ right). Therefore I assigned the actual F-keys I use. For F4 I never use it alone, but only together with Alt, so I use Alt-F4 default instead of F4.

On the left are the (mostly) default window functions. On the right I have the Vim navigation + PageUp/Down in easy to access positions, because those are used most often.
The most used Ctrl-combos get also a position (X,C,V,Z,A,S). The Shift-Win-F combo launches my search engine (Everything from voidtools – highly recommend). Finally INS and DEL and ESC also need a home on the main (right-hand) navigation layer.

Mouse layer

The mouse layer can be toggled into and left with a single key press. This is a mouse and media consumption layer, which often is used one-handed. Therefore arrows and the like are duplicated also on the left hand side. So depending on the situation one can use the left or right hand, either in home-row position or the hands placed to the left/ right of the keyboard. One typical use case is using the mouse in the right hand and using the left hand for the navigation keys.

To get out of the layer use the following macro, which also is robust in the sense that it also allows holding the key and still having the mouse-layer active:

# Mouse layer - untoggle
holdLayer mouse
unToggleLayer

Fn layer

Simple layer with less used functions to control the hardware: UHK, computer and display. In addition the F-keys are duplicated, this time always without a combo-key. In case I will ever need an pure F4-key :wink: I could delete the other F-keys which I will never use, but left them just for consistence.


Remarks

I do not have a number pad included in my layers, because I type numbers blind and quickly on the top row for many years.

Looking forward to hear any ideas for improvement or other cool features I could integrate.

EDIT: The above config works great, but I was thinking to remove the need to stretch the hand for Enter in the base layer and have started to change my mod-layer significantly and will post an update after some days or weeks, when I see what works best for me. :slight_smile:

7 Likes

Hey there. I like your idea of the mouse layer that’s sticky when you activate it , might try something like that.

How are you finding the arrow keys in the bottom right? I tried that at first but then settled on VIM style keys with the mod key - as you also have.

My biggest issue is that I often get the mod and super (I’m on a mac) key confused, so I often will Mod-S for example to save when I meant to cmd-s. I’m thinking I might map the mod layer to be the same as the super (cmd) layer for all the keys apart from the keys I have specifically mapped to the mod layer…

Thanks Matt. The mouse “sticky” layer is actually a one-press change, I am not sure how you would call that normally. The phrase “sticky” is normally used for modifiers which do not need to be held down, but get released after a second key was pressed. Can also be useful and I thought about making Shift a sticky key. I think that would be a little bit better than to have to hold Shift down. I am not sure if I want the modifier keys sticky as well.

I really like the bottom 4 arrow keys and am happy with the layout. The only thing I would wish is that the right corner key would be smaller and making place for an extra key. Also the 4 arrow keys should be the same size (1u would be fine for me, but 1.25u is also o.k. I think). Then I would also like to have the legends (backlit) for the arrow keys. But other than that I am pretty sure I will not change that part of the keymap. :slight_smile: And of course when touch-typing I use the Vim-style keys with mod. Just have to retrain myself, because I used to use CapsLock (with no mod key on a standard keyboard) for that.

Regarding Mac specific keys I can not comment. I used to use Macs as main PCs for a few years, but that is so long ago that I forgot the role of the CMD-key. I do not use Linux or macOS any longer nowadays. Apple lost me long time ago…

It seems resolveSecondary is deprecated. I’m a beginner with UHK. How could we update your “Space Mod” macro to the new syntax?

ifSecondary advancedStrategy final holdLayer mod
tapKey space

is the new recommended form. advacedStrategy can be left out when default resolution strategy is set to advanced.

1 Like

Thank you @kareltucek, your script works!

If I may, I have a follow-up question for your script: the original script seems to put a “delay of 200ms” for triggering a SecondaryRole which differentiates it from the default SecondaryRole function. Your script seems to use the default SecondaryRole function as it is. That supposing I understood things correctly, which is unlikely because I just started to read about macros a few hours ago.

Would it be possible to include a “delay” between changing roles in your script with the new syntax?

For context: it seems I often overlap key presses when typing, and the default SecondaryRole is triggered unintentionally, so the “delay to trigger SecondaryRole” is what I’m trying to achieve.

Ah, sorry for the oversight. Actually, the original macro shortens the timeout from the default 350ms. Please read more about secondary role configuration at firmware/doc-dev/user-guide.md at master · UltimateHackingKeyboard/firmware · GitHub .

1 Like

I see you already have a working solution. I just tried to update the post with the new code I use, but I have no rights to update my post (which is a pity IMO).

Here the new code I use for SpaceMod:

// tap: space, hold: mod 
set secondaryRole.advanced.timeout 250
// set secondaryRole.advanced.timeoutAction secondary
// set secondaryRole.advanced.triggerByRelease true
ifSecondary advancedStrategy goTo secondaryaction
primaryaction: final tapKey space
secondaryaction: final holdLayer mod

@rpnfan I am curious why you set the timeout within that macro. I configure all timings and any other initialisation in the $onInit macro:

set secondaryRole.defaultStrategy advanced
set secondaryRole.advanced.timeout 250
set secondaryRole.advanced.timoutAction secondary
set secondaryRole.advanced.triggerByRelease 1
set secondaryRole advanced.safetyMargin +5

Within other macros, I then just use something like:

ifSecondary goTo secondaryaction
...

or just set a secondary role on the key itself using the Agent UI.

That is an option as well of course. Because I have been testing different parameters I did not use the oninit macro here. Might move it there in the future.