Different Behavior of the Spacebar

Can KM simulate the behavior of the Spacebar as if „key repeat“ was off (but it is not!)

Behavior of the Spacebar (repeat off) is:

Press and hold Spacebar, the cursor takes one step to the right and stops. No matter how long Spacebar is pressed.

you might wonder why I don't just choose this keyboard setting. Because this setting also affects other Key (Backspace) and I only want to influence the behavior of the spacebar.

I would be very grateful for a macro. Thank you!

Hi there! That can indeed be accomplished with Keyboard Maestro. Have you attempted to create a macro already?

I have one I just whipped up and can provide if you'd like, but it's always good to attempt it yourself first to learn more :wink:

If you want to try and make it yourself, take a look at the following actions:
While Conditions Are Met Action
Pause Action
Insert Text by Typing Action

Again, if you're stumped or anything just let me know and I can share the macro I made. :grin:

-Chris

Thank you, Chris, that might be easy (for you) :slight_smile:
I just want the solution. Can you do that to me? That would be very nice of you :sunny:
Thanks again, Chris :slight_smile:

No problem! I don't mind whipping up macros for people when I have time. I also like teaching too (I do a lot of volunteer work that involves teaching; indeed if I wasn’t a professional interpreter I would likely look for a job in the education field), so I like to try and help folks on this forum to learn a little more about KM if possible.

Take a look at the following macro. Essentially it repeatedly inserts a space the entire time the space bar is down. The 0.1 second is to prevent it from repeating too fast and inserting too many spaces. Adjust the time to whatever works best for your system.

Simulate space bar repeat.kmmacros (2.9 KB)

Macro screenshot (click to expand/collapse)

I try it and then I tell you, that you are my hero :slight_smile:

Sorry Chris, do we have a misunderstanding?

„Essentially it repeatedly inserts a space the entire time the space bar is down.“

In fact, I want the opposite. When Spacebar ist pressed/down and hold the cursor takes one step to the right and stops. No matter how long Spacebar is pressed.

Perhaps! Let me read your initial post again :laughing:

So you want to leave Key Repeat on in the system preferences, but for the space bar to insert only one space no matter how long it's held down?

Yes!....

Well stink! My apologies! I'm not sure how to do that unfortunately, and my first attempt didn't work. Let me think on it some more.

The workaround would be to set Key Repeat of in the system preferences. So Spacebar does what it should. And then use your macro to set it back for Backspace, arrow keys and so on. But that ist a bit a bit complicated.

yea would be one work-around... but like you said you would have to do that for every key you want. simulate repeats.

I don't urge you, but if you find the solution that would be great! :sunny:

Ok here's a work-around that isn't ideal... but it may work for you. The caveat is that it does not insert the space until the space bar is released (see the trigger), but it simply didn't work the way you wanted with the other trigger options.

I'll keep monkeying with it to see if I can come up with something better, and perhaps others more knowledgeable than me will chime in too.

Simulate space bar repeat.kmmacros (4.9 KB)

Macro screenshot (click to expand/collapse)

https://unshaky.nestederror.com/ might help solve this for you. You can set it to capture and ignore multiple key presses of the same key (and limit it to only a single key as well).

That's exactly the point, Chris. I need this one space, when Spacebar ist down :neutral_face:

Thank you, I' will have a look at it. But I am convinced that there is a solution with KM

With this App I can stop the spacebar, but normal text typing is not possible any more :neutral_face:
Thank you anyway for the hint :slight_smile:

that shouldn't be the case. Have you played around with Unshaky's settings?

I tried to :slight_smile: If the delay is long (1000 or longer) then there is no space between short words.

„I love you“, becomes

„Iloveyou“

If the delay ist shorter, the cursor moves to fast, when Space ist pressed and hold.

Do you know other settings?

Whenever I need to change something like the behaviour of keys or remapping of keys I typically use a different program (Karabiner Elements).

There it is possible to manually define a custom rule that disables the key repeat just for space.

You could install Karabiner first on your system. In order to get this custom "Complex Modification" installed on your machine please go to this website and on the right hand side paste in this code I wrote for you:

{
  "title": "Disable spacebar key repeat",
  "rules": [
    {
      "description": "Disable spacebar key repeat",
      "manipulators": [
        {
          "from": {
            "key_code": "spacebar",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "spacebar",
              "repeat": false
            }
          ],
          "type": "basic"
        }
      ]
    }
  ]
}

Then you can install it which will basically add it to your local Karabiner.

After that you need to activate it in the Karabiner Preferences→Complex Modifications by selecting Add Rule and adding the Disable spacebar key repeat.

It takes a few steps but achieves exactly what you are looking for.

Hope this helps.