Keyboard Triggers

Keyboard-based triggers are the most common types of Keyboard Maestro triggers. Learn how to create and use them.



Video Transcript

Okay, let's start our exploration of Keyboard Maestro triggers. And the most important of those are really the keyboard-based triggers. So we're going to go ahead and create a group. And we'll call that group a Sample Triggers. And now we've created it right here in the groups list, and we're going to create a macro inside of that that we're going to call Keyboard Triggers.

I really think that keyboard triggers are the most important type of triggers using Keyboard Maestro because it's just too easy to fire these things off with your keyboard. And I'm going to talk more about the ways I do that after I demonstrate a few.

We created a macro here for keyboard triggers. And this tutorial is going to be all about creating those triggers. But we need something to happen on screen. So I'm going to add a couple actions here, text related. So we're going to make one. I’m just searching “text” here. There's Display Text. That's what we want. And we can do that a couple of ways. We can say, “Boom!” And we can say, "Display large text." And I'll just show you what it looks like. Whoa, that fills the screen. I'm not sure we want to do that.

So, we're going to switch that over to “display text in a window”. So let's test that. There it is. A window pops up that says, “Boom!” inside of it. And just for giggles, we're gonna say, "Speak text," as well. I can type in text here. We can pick a voice. I'll pick Alex. And let's test that.

ALEX: Boom.

All right, Alex said boom. How do you like that? Okay, so we want to set that now. We've got an action. Let's do some keyboard triggers, which is the whole reason we started this.

Like I said, my favorite is the hotkey trigger. It works so great. I'm going to create one for this, which is going to have the B key attached to it, but that's also going to say Control+Option+Command. That's the three keys to the left of the spacebar.

So I hold all three of those down. I press B, and I've just added that here. Control+Option+Command+B triggers the “Boom” command. And it's turned on, so everything should work. So I'm going to test it out. I'm going to hold down the three keys, hit B…

ALEX: Boom!

And it worked. I just held down the key combination, and there you go.

This combination of Control+Command+Option+plus one letter is a great one because applications don't generally use that. And you've got the whole keyboard in front of you to work with that. And if you've got an extended keyboard, like I do with a number pad, that gives you even more options, because all those number pad keys register differently. Let's see here. I'm going to change it to Control+Option+Command+3. And you can see, it's keypad 3, it's not the number 3. Just think about that. It's a good reason to get yourself an extended keyboard if you've been putting it off. But I'll go ahead now and try that out. Control+Option+Command+3.

ALEX: Boom!

And it's still working. And I can already tell this, this voice thing is going to make me crazy. I'm going to select that and get the little blue outline around it and press the delete key. And now I will just see “Boom”. I will not hear it.

So, there you go. The simplest method is this key combination, and I use this all the time. It's my favorite way to do these things. Now, as a quick aside, you can also add a super key to your Caps Lock key, and I got this trick from my friend Brett Terpstra. 

Brett Terpstra is an automation nerd. He co-wrote two books with me about Mac tips, the 60 Tips, Volume 1 and 2. And he came up with the idea, or at least published the idea, about using the hyper key. And that's taking the Caps Lock key and turning it into Control+Option+Command+Shift. So all four of those keys held down gives you a whole another set of keyboard shortcuts that nobody else uses. And Brett did this by using an application called Karabiner Elements. I'll put a link in the description of this specific course. Brett actually went through and showed you how to change the JSON file and make it all work. Well, good news is, it's got even easier than since Brett did it.

This is the downloaded Karabiner Elements application I got from the link I shared below. And if you go over to the complex modifications tab, you can say “Add rule”. And it's got a couple built in, and one of the built-in ones, which I've already enabled, is this one. Change Caps Lock to Command+Control+Option+Shift. All I need to do is turn that on. Once I did that now, my Caps Lock key operates a Shift+Control+Command+Option all held down at the same time. And that gives me a whole another set of keyboard shortcuts I can use in Keyboard Maestro. So now, I'm going to go back to this keyboard triggers one. And in fact, I'm going to add one more trigger because you can have multiple triggers even of the same sort. And I'm gonna hold down my Caps Lock key and then press B.

And you can see when I did that, it used, because of Karabiner Elements, instead of saying Caps Lock B, it says Control+Option+Shift+Command+B. And even though that's a lot of modifier keys, I'm easily pulling it off with just my Caps Lock and my B key.

So, one more time, Caps Lock and press B. And then I get my “Boom” again. So that's one way you can do these things with these hotkeys. And, like I said, put the Karabiner Elements installed. Between that and the Option+Control+Command, you've got a lot of stuff to work with, got a lot of real estate on your keyboard. And once again, if you have the extended keyboard with a number pad, it gets even better.

So I've got those enabled. Let's try the next type of keyboard-related trigger: the type string trigger. And this one lets you fire off a Keyboard Maestro command just because you type something in. And I'm going to go semicolon B. “Boom” is only four letters. I gotta keep it pretty short. But if I hit ;+B, it's going to make this thing happen. So Tab key, and then hit ;+B.

And it happened. Now when I did that, you heard there were some alerts because I wasn't in a text box on my Mac. And usually the Mac gives me an alert when I'm trying to type when I'm actually not in a text box.

It's for this reason that I'm not a big fan of using the typed string trigger for Keyboard Maestro macros. It just doesn't work a lot of times because I'm not in a place that I have to type. I hear all those alerts. It gets confusing. And I've got plenty of real estate left to use just hotkeys to do most of this stuff.

Where it does work, however, is if you want to do text replacement type macros. So I'm going to go back now and close this out. And close that. And now that we're in this group of Sample Triggers, we're going to another sample trigger. And this one's going to be a text replacement. One of my favorite Latin sayings. Now I'm going to create a trigger and we'll use a type string semicolon+Ars. So now, I've created a text replacement macro. But it's not really doing what I want because rather than display text in a box, what we want to do is take that text and just type it. And you can do that here. Just change it to insert text by typing or pasting. And use pasting; that works just as well. So now, I'll open text edit. And then I'll go ;+ars, and I've got my text replacement.

People often ask me if you can use Keyboard Maestro as a text replacement application, and the answer is yes. However, it's not as powerful as something like TextExpander that has macros and JavaScript and a bunch of cool stuff. I generally prefer TextExpander for text expansion, but if you're just doing basic stuff, you can do it fine with Keyboard Maestro.

Regardless of where they use hotkeys or type strings, you'll be surprised how often your Keyboard Maestro macros are easily triggered with the keyboard and just how useful it is.

Make sure you understand this as you go forward because it's going to be something we use throughout the entire course.



Links of Note:

Karabiner Elements




Downloadable Keyboard Maestro Script:


Complete and Continue