Skip to content

Erlendms/karabiner-actions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Karabiner actions

Here are some Karabiner-element actions I've put together. I've done it with the wonderful tool Karabiner.ts, and my index.ts file is in this repo, if you want to check it out.

Table of Contents

How to add to Karabiner

First click "Complex Modifications", then "Add your own rule". Then copy and paste everything from the .json files here, and hit save.

Meh key

I have two versions of turning R and U into the Meh key (which is Shift + Control + Option) if they are held down.

How thresholds work

In Karabiner-Elements settings, you can set the threshold for how long you must hold a key for it to be registered as being held down, and not just tapped. A pretty normal threshold, is 200 ms. So, if you have that threshold and the Mey key action installed, it would work like this:

  • Input: Press down (just) R, and release it before 200 ms.
    • Output: r
  • Input: Press down (just) R, and release it after 200 ms.
    • Output: Meh click
  • Input: Press down R, and then hit A before releasing R and before 200 ms.
    • Output: ra
  • Input: Press down R, and then hit A before releasing R, but after 200ms.
    • Output: Meh + A

You should find the threshold that works for you

The default threshold is 500 ms, which is very long. You change it here: 👇🏻

I've went into "Parameters", and then highighted to_if_alone and to_if_held_down. About the first, i've said: "This does the following, when on 1000 milliseconds (1 second): If you hold F for 1 second, and then release it without hitting any other buttons, F gets written. But if you hold for 1.1 secons, Command gets sent instead." And about the second, I wrote: "This starts on 500 - but I'd set it to 200, and see what you ike. It's how long you must hold F before it becomes Command. Lower value makes it possible to do hotkeys faster. But if it's too low, and you write the word "Fast" and hold F and A together for a few milliseconds, you wil send "Command + A"."

Having it higher, means you have to wait after holding, before hitting the second part of the hotkey. But having it lower will lead to more misfirings - like if you just meant to type "react", but you held R and E together for some milliseconds, so you sent the command Meh + E.

The better you are at just giving the keys a little peck while you type, the lower you can have the threshold (and thus wait less).

While testing, it could be a good idea to use Karabiner's EventViewer. 👇🏻

Click Karabiner in the menu bar, then "Launch EventViewer".

Meh actions

  • I have one version, where the threshold of the meh keys will follow the default you've set,
  • and another version with the treshold set to 220 ms even if the other keys have a lower threshold.

Hyper key

The most important one for me, is having Caps Lock, and Quote (Æ on Norwegian keyboards) become the Hyper key. That means all four of Shift+Control+Option+Command. No apps use this for hotkeys, so you can always make them your own.

  • I have one version that makes Caps Lock always be Hyper, and Quote be hyper if you hold it longer than your to_if_held_down_threshold,
  • and another version that keeps Caps Lock's function if it's clicked alone and under your threshold.

Turbo Arrows

What if you're a filthy pleb, like me, who don't know vim motions, but still want to move slighlty faster with the arrow keys?

Doing Command/Option + Arrows works great when going left to right, but not so much up and down. So, I present to you, my latest "invention": Turbo Arrows

If you hold the Meh key and git an arrow, it does 5 arrow clicks. And if you hold Hyper, it does 10. (I'll mostly be using it for up and down, but I added left and right as well.)

Nordic Markdown Helper

Typing _ and * requiers modifiers on (at least) Nordic keyboard layouts. So this little action is designed to make typing those easier.

(PS: I'm Team Single Underscore for Italics and Double Asterisks for Bold. 💪🏻)

We don't use the key to make ¨ often, as we have designated letter keys for Æ Ø Å / Ä Ö Å. So, I've sacrificed it to do this instead:

  • On tap: _
  • On hold: **
  • With Shift + Option or Meh: Regular unmodified function

Using the key with modifiers works like normal.

Home row mods

There's an excellent guide here, with tons of information and usage tips. But the gist of it, is that the keys on the home row (usually A, S, D, F and J, K, L, semicolon) becomes modifiers (like shift and control) when held down.

The same principles apply here as for the actions above - so you got to find the right threshold for you.

Pros and cons vs QMK/ZMK

The most common way to activate home row mods, is by changing your keyboard's firmware, via QMK or ZMK. One of the major benefits of this, is that it allows some more advanced features, like permissive hold, ignore mod tap, and being able to map keys to change thresholds.

But there are two main benefits of doing it through Karabiner-Elements:

  • It works on any keyboard, including internal laptop keyboards,
  • and it has less lag while typing (I greatly prefer the typing feel).

Home row actions

I have one version, where:

  • A -> Control
  • S -> Option
  • D -> Shift
  • F -> Command
  • ... and mirrored on the other hand.

And one version where:

  • A -> Control
  • S -> Option
  • D -> Command
  • F -> Shift
  • ... and mirrored on the other hand.

But I have two versions with the same order as regular keyboards, so:

  • A -> Shift
  • S -> Control
  • D -> Option
  • F -> Command

One regular version, and one version with sticky shifts.

Sticky shifts mean that if you hold A or semicolon and then click something else, you'll get the shifted version even if was before 200 ms. This mimics the Permissive Hold function of QMK - but not perfectly (as that's not possible in Karabiner-Elements). The upside is that you don't need to wait for shifts - but it'll lead to more unintended activations, and you can't keep holding and get more shifts afterwards.

A better solultion, if you really want fast shifts, might be to just have a lower threshold on just those keys.

Holding several modifiers also works, btw! But you have to start holding them at the same time. simultaneous_threshold_milliseconds is how strictly you have to hit them at the same time.

Good luck! 🤗

-Erlend

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published