Caps Lock + h, j, k, l - Key Repeat in Key Sequences


I am trying to use Caps Lock as a navigation layer by defining key sequences such as:

Caps Lock + h = left
Caps Lock + j = down
Caps Lock + k = up
Caps Lock + l = right

BUT the problem is that I have to lift Caps Lock and press it again everytime I want to trigger Left Arrow. I did enable Key Repeat as shown in the screenshot but that does not seem to work.

Sorry, this is a limitation of key sequences. You can however workaround it by adding an advanced trigger condition and removing capslock from the sequence itself:

1 Like

Okay, thank you so much. That worked out wonderfully!

Okay, one slight quirk, sometimes the cursor moves by two letters instead of one.

As you can see sometimes it moves by one letter and sometimes by two:

CleanShot 2024-06-07 at 14.33.38

honestly I'm not sure if this is a good idea to use the caps lock key like this. I'd rather recommend to remap that on a deeper layer than BTT can do e.g. using Karabiner Elements.

The problem with this setup is, that a key sequence will not block the original key from reaching the current app. So your h / j / k ... keys will always reach the app and I assume this causes issues.

I have also tried this several times. It never worked really well for me. It works better with a shortcut than with a key sequence. However, you have to sacrifice a “normal” key because you can't make a shortcut with a modifier only.

Another problem is the key repetition. This doesn't seem to work reliably even with shortcuts. At least for me and with the arrow keys.

Conclusion: I use the “4” key, which I can reach easily and blindly with my left index finger. When “4” is pressed and held, “j” moves the cursor to the left. If I also hold down “j”, the cursor moves quickly to the left. If I tap “4” briefly, 4 is typed. This works absolutely reliably ... but unfortunately only with KM ... I would actually like to do this with BTT :man_shrugging:

Anything specific that doesn't work for you with that setup?
I just tried it with this setup:

4.bttpreset (2.9 KB)

possibly it's necessary to activate this option to make it work (I'd recommend that option in general for more complicated keyboard setup, so BTT doesn't confuse itself):

//edit: ah sorry this doesn't include the J key, it just moves left while holding 4

How do you make it not output the J key in your scenario with KM?

Maybe you can check again if I explain what the main problem is for me.

Let's make it simple: ⌘+j moves the cursor to the left. This works fine as a single action. If I do this with key repetition switched on (⌘ down / j down) then after 2 seconds the original shortcut of the app pushes through (⌘+j).

Denn Rest nach dem Mittagessen, mein Sohn hat Hunger :slight_smile:

Seems to work fine here, does this happen in all apps or a specific app?

I fixed the issue and created another one lol

So I fixed it by using Key Down in Key Sequences and not recording Key Up. Now when I hit h multiple times, it goes left as expected. However, if I keep h held, it just keeps inputting h.

Btw yeah, as you said, let me try KM KE for this. Maybe it'll work better.

Sorry, yeah, I meant Karabiner Elements.

I'd go one level deeper and use Karabiner Elements instead - it is made for this. Neither BTT nor KM are particularly good key remappers because they work at a too high level.

1 Like

Mm, the problem actually seems to have disappeared. Very nice! But then you've changed something in the last few months or so. Then I tried that for the last time and the error always occurred. I'm quite sure of that.

Pefect, then I like to set it up again with BTT. Of course I deleted everything :cold_face:. But from memory it worked something like this:

  • Short press “4” (max. hold 0.1s) --> 4
  • Long press (and hold) “4” (min. hold 0.2s) --> show very small floating menu in a corner of the screen)
  • If the floating menu is visible: j = left arrow, k = right arrow, and so on
  • Release “4” floating menu disappears. J = J and so on.

If anyone has a better idea, I'm open. By the way, this is exactly how I do it with KM and it works perfectly.

Edit: Ah, I forgot. It needs two “j” actions. If floating menu is not visible, then “j” = “j” (prevent recursive trigger).

Edit 2: Ahh, I remember. That was also a problem and still is. If you set up two “j” actions (to stay with this example), the key repeat no longer works with the cursor function. With or without “prevent recursive trigger”, With the other action.

@Andreas_Hegenberg Do you think you can fix this?

This works perfectly

But if this is added, the key repeat no longer works with the cursor.

You were right. KE is a great key-remapper but not a great Shortcut → Action configuration tool, and BTT is vice versa.

I am going to stick with KE for all my key remapping now, and use BTT for defining actions.

@kayg04 If the problem mentioned above can be solved, your “navigation layer” can be easily implemented. But unfortunately not with a modifier. You need a key that works in the shortcut section.

How so? I wouldn't really mind SPACE as my navigation layer key as I'm planning to use that in KE as well.

Space would work. BUT ... how fast can you type? Whether with BTT or KE “space” would always be typed when the key is released. This is the only way to prevent a space from being typed when you press and hold it.

So, if you can type quickly, the letters are constantly being twisted. Example: you type “space” and “f” in quick succession. Then “f” is typed first and space after.

That's why I use “4”. It's a key that I don't need when typing quickly.

I just tried this and I ran into the issue just as I was typing out this reply but I have also just as quickly found a solution for it. On a good day, I can do 100, 110 on a very good day. On a normal day, it's more 80 - 90 wpm. But even then I did run into this issue. I solved it by using simlayer() instead of layer() on KE

But I do love your suggestion about 4.

As for the navigation layer itself, it was dead easy to implement it in KE. :slight_smile:

All thanks to this DSL: GitHub - evan-liu/karabiner.ts: Write Karabiner-Elements configuration in TypeScript

Edit: As I said before, I am trying to rely purely on KE for key remapping while I am doing all the trigger / action stuff in BTT. Let's see how it works for a week. :slight_smile:

Another Edit: With KE, the caps lock (press/hold) stuff also works much faster than BTT and as a plus, I can use hyper / meh / fn+hyper in key sequences now which is HUGE plus.

Good, then you've found your solution. :slight_smile:

With BTT there is a kind of workaround for the “twisting problem”. But it really isn't perfect. If you want, have a look here.

Yep for this kind of advanced remapping stuff KE is just the absolute best tool available and I'd always recommend to use it. BTT just can't do the same things due to the different layer it works on.

1 Like