Activate RETURN key only if certains conditions are met?

As many, I have a QWERTY keyboard but set-up as international so I can write in French and using the "+i for ï or the `+e for è. Or event this last one: '+e = é

However, this one is tricky, as ' is right next to RETURN. And in chat apps, I can mistakenly press return instead of ' or ", sending my incomplete message to my recipient.

Is there a way, when using chat apps like Telegram or What's App, to make this RETURN key only working if either:

  • Double pressed RETURN consecutively?
  • RETURN is pressed if no other keys where pressed within a 1 second span?
  • RETURN is pressed for more than 1 second?
  • Or any good criteria you might find clever?

For now, I just de-activated it using this thread, but it's not ideal.

Thank you everyone!

Here's an idea, using one of my multi-press templates.

  • Tapping ↵ once does nothing.
  • Tapping ↵ twice simulates the ↵ key.

Double-Tap Return Key.kmmacros (87 KB)

Macro screenshot

1 Like

Hey thanks, it worked! Thank you so much! However, the message/action seems to act after 1 second after the second RETURN pressed, is that normal?

I don't like messing with normal keys...

When I do I usually put up a palette that demonstrates exactly how I'm interfering. For instance:

image

I use this in Google Chrome when browsing through certain sites where I want to streamline the process, and the palette along with its modifications to normal keys is toggled with a hotkey trigger.

This is not entirely ideal, but it gives me a visual indicator that I've altered my working environment.

Take note that these work on an US English keyboard where the Tilde/Back-tick key is under the Escape key

é == Option-e, e
è == Option-`, e
ï == Option-u, i

HTH.

2 Likes

There will be a slight delay, yes, as the macro is detecting the number of presses. If this isn't ideal, you can always switch to short/long presses instead and see if that feels snappier:


I echo @ccstone's thoughts about not messing with regular keys. However, if you often send chat messages prematurely, this kind of approach might be the lesser of two evils. This may be stating the obvious, but be sure to put the macro in a group that will only be available when using the app(s) you need it for.

1 Like

I've never taken the time to thank you all, especially @noisneil and @ccstone for your help. So, really, thank you.

I've been using the Long Press Enter option with specific apps for a few weeks now and it helps greatly to reduce the number of false "ENTER" I send.

I still haven't found a way to make it work with all internal chats inside a browser without breaking the ENTER basic function .

Does anybody know if it's technically possible to deactivate the ENTER key enterely unless nothing has been typed on the keyboard for the last past 0.5 sec for example?

1 Like

What do you mean by this? Can you give a specific example?

Sure, for example, let say I am using What's App.

If then I press CMD-SPACE to trigger Spotlight, I still have to long-press Enter to do a "normal"enter here, even if Spotlight is not in my list of apps.

Also, in any browsers, I use normal :"enter" in the address bar for example, but would like the "security" of a long-press-enter when in a text-field for example.

But I guess this second case is much more difficult to accomplish.

One solution to this would be to write a KM macro triggered by ⌘Space that disables your long-press Enter macro and then simulates pressing ⌘Space to trigger Spotlight.

Another macro could then enable long-press Enter whenever apps you want it for are activated.

Yep.

If long-pressing in the address bar feels clunky, why not switch to hitting Enter with a modifier? ⌘Enter would probably settle into your muscle memory quite quickly.

Because the frontmost app is still the one from when you triggered the macro -- Spotlight doesn't move to frontmost, even if the Spotlight dialog is active. You can see that with this macro, which opens Spotlight then display the name of the frontmost app:

Spotlight not Frontmost.kmmacros (1.9 KB)