How to Create One Letter Hotkey Triggers and Still Being Able to Type Them in a Text Field?

Hi KM lovers,

I'm trying to program macros that would be trigger simply by one letter keystroke like "q", "s", "d", etc and still being able to type those letter in a texte field if needed.

I couldn't find a way to set a condition like "If I'm in a text filed".

I tried several conditions like if (letter is double pressed, is pressed a longtime, also mouse conditions like "if the mouse's left button is pressed" but the letters concerned won't work in a text filed.

Any ideas how I could proceed?

Thanks a lot :pray:

Hi. This has been covered a lot if you search for it. The concensus seems to prevail that you shouldn't use single character hotkeys for apps that accept typing. There's no perfect workaround for it and the drawbacks are significant. It's not that hard to hold a modifier and if you really want a one-finger solution, consider a second hand Stream Deck.

2 Likes

Thanks !

@noisneil is always very consistent on this subject. And he is right. But probably a bit too pessimistic. :wink:

He himself has developed a very good multipress macro, which you can find here in the forum.

Otherwise, single key triggers also work with the triggers built into KM.

You don't have to distinguish in which field you type. You can distinguish which trigger you use.

Example

  1. short press (is tapped) "q" = "q" in each field. Note that the letter is typed when the key is released.

  2. long press (is long pressed) "q" = any action. Again, the action is triggered when the key is released.

Noisneil solved this better. If I remember correctly, his long press is triggered when the key is pressed.

1 Like

:open_mouth: I think that will solve my problem, thanks a lot !

One more thing.

Do you write fast? If so, you will have a problem. If single letters are typed when releasing the key and others when pressing it, there will be letter twists. :upside_down_face:

1 Like

Here's another idea that may or may not be applicable for your use.

I have a bunch of single character macros whose group is only available in a Apple Mail when the front window title matches Archive|Inbox|Search.

This means that these keys don't interfere with email compose windows or searches, which are the only times I type. Be aware that if you use the menubar help search function, those keys won't be registered in its text field.

90 words per minute on tenfastfinger.com if you ask .. x) But I figured a way to make it work perfectly for my use! thanks again!

I'll sleep on it. Thanks :slight_smile:

Ok, you write almost as fast as me :wink:

If you don't want to leave the basic position (fingers) to press a modifier, then there is a better solution.

Just add "shift".

  • short press: shift q = shift q
  • long press: shift q = any action

Very fast and no letter twists.

Surely not shift if you're gonna use a modifier, as that's still typing...?

I do not understand what you mean.

Shift-q = Q so you'll potentially still have the same speed typing issue.

Mmm, no, I have tested this extensively.

The capital Q is typed when the key (Q) is released. Then shift is released and the next letter is pressed. I never had a problem with this. :man_shrugging:

Mmm, yes.

Hold ⇧ and hit yqy quickly. You should get YQY but you get YYQ.

As you can see, hitting YQY results in YQYQ being registered as input and YYQ actually being typed, due to macro interference.

It may not make a real-world difference if you're not a fast typer, but you are fast, and if you type anything in caps without using caps lock, you may run into issues.

CleanShot 2023-02-02 at 15.06.46

It's funny because about a year ago we were on opposite sides of the same discussion. I realised you were right, and that fast typing is interrupted by multi-press macros.

Now I understand. You mean when you type several capital letters in a row.

Yes, then you are right, but I do that very rarely ... never.

The normal case is upper case followed by lower case. Then this does not happen. That's probably why I never noticed it.

1 Like

Yeah. I personally do that quite often, particularly when naming parent folders. If it works for you then great. Just wanted to make it clear that if you're going to use a single modifier, ⇧ is the only one that could interfere with typing.

1 Like

I actually didn't consider that, because I never do it.

But you don't need such triggers anyway, you have a stream deck. :wink: :smiley:

1 Like

Could you please let me know what kind of "way" this is? Without letter twister? I would be very interested in that. Thanks :slightly_smiling_face:

Well I just added the condition "if the right click of the mouse is pressed".

So my macros are not technically one letter keystroke but one letter keystroke plus a mouse condition which work just fine for my music software :slight_smile: