Using KM to *not* do things. (a tip for beginners)

Usually we use KM to do things.
But also useful to use KM to not do things, in order to block common mistakes.

Here are two macros I’ve been using to block my common mistakes.
I hope others will post more ideas how KM can used in a negative way for positive benefit.

1. Stop quitting by mistake:

Usually CMD-Q is the shortcut to quit.
But sometimes my fingers hit CMD-Q by mistake.
If the program auto-saves before quitting, no problem.
But some programs just quit, without a save.
Firefox does that sometimes, and all tabs disappear.
(Yes, I know about “restore tabs” preference: Sometimes that preference works, sometimes not.)

Here’s the macro to solve that problem forever.
KM swallows keystroke CMD-Q, displays an alert, and then does nothing.
Now, the only way to quit Firefox is mouse click.


2. Prevent premature email send:

The same built-in shortcut can do different things in different programs.
That's a common problem.

On my email program, CMD-return is the built-in shortcut to send.
But in another program, CMD-return creates a new line.
Too many times, I’ve sent an email that way, without intending to.

This KM macro solves that problem.
Similar to above, KM just swallows the un-wanted action and does nothing.


In both examples, alert is optional.
Could have no action at all.