Interesting. Thank you for this comment. But I have a question. Is “space” typed or not when you type “space” + letter?
With Karabiner Elements, you can create custom "modes" that act like modifier keys (similar to Ctrl or Command). For example, in my setup, pressing Spacebar + D simultaneously launches an app. But if I press the Spacebar, release it, and then press D, it simply types a regular "space" followed by a letter "d".
John Lindquist has a great video showcasing GokuRakuJoudo here:
Ah, ok, I was hoping you'd explain how to turn lead into gold. No offense, just kidding.
Obviously you don't type fast, otherwise the result wouldn't be “space” followed by D ... but the other way around ... unfortunately
I believe it’s less about how fast you type and more about how effectively and efficiently you use your keyboard/devices. I’m not even sure if I type particularly fast or slow (around 100–150 WPM), but these days, most of my time is spent analyzing information and working across various tools, not just typing.
With Karabiner-Elements + GokuRakuJoudo, it's easy to add conditions like "sim" (how quickly keys must be pressed together), "delay" and "conditions" (specific applications or active "modes"), allowing you to fine-tune your setup for optimal workflows.
If it were that simple ... this "system" would only work if it could read your mind and knew what you want to type before you typed it.
Because that's not the case ... Thank you for your time. I'm happy if it works for you, but we still haven't managed to turn lead into gold.
No, unlike Keyboard Maestro, space is not typed when you simultaneously press “spacebar” + letter (verified with Karabiner-EventViewer).
Also, you can setup many workflows to be triggered for a single modifier/normal key adjusting its specific (overriding the global) sim/delay/alone/held parameters in Karabiner (to have one function if pressed alone, held, double/triple pressed, etc.).
Using Karabiner’s MultitouchExtension + GokuRakuJoudo, you can trigger Keyboard Maestro macros based on the number of fingers and their position on the trackpad. This allows for powerful, context-sensitive conditions that go beyond what standard KM triggers can handle.
In fact, most of my macros don’t have any assigned triggers, I use alternative methods to call them (with or without arguments).
@JuanWayri Please excuse the delayed response.
In the meantime, I have set up something with BTT that can probably also be done with KM. But of course I don't know how.
Let's assume “Space” is supposed to be a “modifier”. “Space” + letter should trigger something without anything being typed. Then Space is the only key that has to be typed when it is released.
All letters are typed when the key “is pressed”. But with a slight delay to compensate for the fact that “Space” is typed when it is released. Example for “A”.
This “compensation” ensures that ‘Space’ is not typed after A when typing quickly, even though “Space” was pressed before.
I think with KM you would have to set up a “letters group” and a “triggers group”.
The “Letter group” is always activated. If “Space” is pressed and held, it is deactivated and the "triggers group" (or a palette) is activated. Now you can trigger something (from the palette) with “A”, for example.
If there is a multipress macro in the palette, for example, “A”, “A + A” or long press A can be triggered ... at least I think so.
If “Space” is released, the palette is deactivated again and the “Letters group” is reactivated.
I hope that makes sense
Very creative use of KM/BTT trigger features...
While I find it quite easy to do this with GokuRakuJoudo, I'll try to make time to implement what you're describing in KM, if only for the sake of experimenting with it myself
Haha, if you can, I would be very grateful if you could post the triggers here
With Karabiner? Mm, I still don't think that works. Whenever an app tries to “guess” what I want to do, it fails.
While the karabiner.edn
file below works for the scenario you proposed (as long as you fine-tune the individual :params
to suit your keyboard and typing speed), I prefer to configure it using less frequently used keys instead of the spacebar. My spacebar mode is already set up with combinations that are less likely to interfere with regular typing, such as Spacebar+CapsLock, Spacebar+Tab or Spacebar+#Number. These trigger different macros than CapsLock+Spacebar, Tab+Spacebar or #Number+Spacebar, since the order of the keys matters.
Unfortunately, I can't interpret your screeshot because I don't know anything about karabiners.
The regular typing is not disturbed. Not if you mean an incorrect order of letters. "Space" is typed when the key is released. And "Space" is not typed when the key is pressed and held. Problems arise when a key should or should not do something after or during a certain time.
By the way, "Space" is just an example. It also works with any other key.
But the letters are much more important. Here, too, the same thing always happens. All letters are typed with a delay when the key is pressed. Not if a certain key was tapped before or after. There is no condition.
Of course, you pay a price for this. Writing appears on the screen with a slight delay.
It would be completely safe if all keys were typed when released. But then the visible delay on the screen is very annoying.
Every rule in Goku generally follows a four-part structure, with the first two parts required and the remaining two optional or inheritable from previously defined conditions or defaults:
[ <from> <to> <conditions> <other options> ]
Near the top of the image you'll find an example of the fundamental structure of a "Goku rule" using the "hyper-key" example:
Here is what each component represents in the example:
Component | Example Code | Description |
---|---|---|
<from> |
:caps_lock |
The Trigger. This is the key or combination of keys that you physically press to initiate the rule. In this case, it's the Caps Lock key. |
<to> |
["hyper-mode" 1] |
The Primary Action (When Held). This is what happens immediately when the <from> key is pressed down. Here, it doesn't output a keystroke but instead sets a variable "hyper-mode" to 1 . This action is designed for when you intend to hold the key down and press another key. |
<conditions> |
nil |
The Pre-requisite. This defines any conditions that must already be true before the rule can even run. nil means there are no specific prerequisites for this rule (unless it is inheriting a condition from the "rules" block). The rule is always available to be triggered by pressing Caps Lock . |
<other options> |
{...} |
The Alternate Actions and Parameters This is a collection of special behaviors that override the primary <to> action in specific contexts, like tapping or releasing the key. In this example, it contains two options: :alone and :afterup . Additionally, you can override the "threshold" parameters here. |
Explanation of the Code:
This configuration defines two main things: how to enter a "spacebar-mode" and what happens when you are in that mode.
1. Entering "Spacebar Mode":
[:spacebar [["spacebar-mode" 1]]
nil
{
:alone :spacebar
:afterup [ ["spacebar-mode" 0] ["a-press-count" 0] ]
}
]
Section | Content | Explanation |
---|---|---|
FROM | :spacebar | This rule applies to the spacebar key |
TO | ["spacebar-mode" 1] | When you press the spacebar, it sets a variable called spacebar-mode to 1. Think of this as turning on the spacebar mode. |
CONDITIONS | nil | indicates that there is no specific condition for the standard action (“TO”) of this rule |
OTHER OPTION | :alone :spacebar | If you press and release the spacebar by itself (a normal tap), it will just act as a regular spacebar. |
OTHER OPTION | :afterup [ ["spacebar-mode" 0] ["a-press-count" 0] ] | When you release the spacebar, it sets the spacebar-mode variable back to 0 (turning the mode off) and also resets a another variable called "a-press-count" to 0. |
In simple terms, holding down the spacebar activates a special mode. If you just tap it, it's a normal space.
2. Actions within "Spacebar Mode":
The next section, described as "Spacebar Mode Actions", defines what other keys do while the spacebar is held down (i.e., when "spacebar-mode" is 1). Note the :spacebar-mode
condition applied to the entire set of rules: it is inherited by every rule within the block.
:rules [ :spacebar-mode
[:a [[:km "Double Press A"]]
["a-press-count" 1]
{
:afterup ["a-press-count" 0]
}
]
[:a ["a-press-count" 1]
nil
{
:held [:km "Long Press A"]
:alone [:km "Single Press A"]
}
]
]
This section defines what happens while spacebar-mode is active.
Rule 1: The "Double Press" Rule
This rule is checked first. Its purpose is to listen for a second key press.
Section | Content | Description |
---|---|---|
FROM | :a | This rule applies to the a key. |
TO | [[:km "Double Press A"]] | If the conditions are met, trigger the "Double Press A" KM macro. |
CONDITIONS | ["a-press-count" 1] | This rule only activates if the variable "a-press-count" is already 1, meaning the 'a' key has just been tapped once. |
OTHER OPTION | :afterup ["a-press-count" 0] | After the a key is released (completing the double press), reset the "a-press-count" variable back to 0. |
Rule 2: The "Single/Long Press" Rule
This rule is checked second. It handles the first key press and sets up the condition for the double press.
Section | Content | Explanation |
---|---|---|
FROM | :a | This rule also applies to the a key. It only runs if Rule 1's conditions were not met. |
TO | ["a-press-count" 1] | When this rule runs, its main action is to set the "a-press-count" variable to 1. This "arms" Rule 1 for the next key press. |
CONDITIONS | nil | This rule has no starting condition, so it will always match the first time a is pressed in spacebar mode. |
OTHER OPTION | :alone [:km "Single Press A"] | If the a key is tapped and released , trigger the "Single Press A" KM macro. |
OTHER OPTION | :held [:km "Long Press A"] | If the a key is pressed and held , trigger the "Long Press A" KM macro. |
This example also highlights the importance of rule order: if multiple from
conditions can be triggered, only the first matching rule will be executed. That’s why the 'Double Press' rule is placed before the 'Single Press' rule.
While spacebar-mode
isn't as practical as other modes (such as hyperkey-mode
, tab-mode
, or right-shift-mode
) due to its potential to interfere with typing, it serves as a good example of how Keyboard Maestro can be complemented with external tools.