KeyBind
Do anything when you do anything.
Or anything happens at all!
What is KeyBind?
KeyBind performs "Tasks", which are one or more commands it understands, covering most areas of your computing experience. Basically, if you can do it, KeyBind can probably do it for you. KeyBind comprises four main methods for activating these tasks:-
HotKeys
You press a key or combination of keys and/or mouse button or wheel.
-
Triggers
When a window or program is activated or an event occurs (shutdown, screen lock, login, idle, Bluetooth connect, USB drive unplugged, etc.) or a change is detected in the system ClipBoard, KeyBind is triggered!
-
Sentinels
Sentinels can "watch" folders or files, detecting when a watched folder has a new file land in it, or a watched file has changed in any way. And then do something about it.
-
Schedules
You set a time and/or date for the Task to be run. These can be repeating, one-off, whatever you like.
What is a "Task"?
A Task can be a simple KeyBind command, a string of commands, or the path to a .kc script, which is itself no more than a simple list of commands.
There is a huge list of commands these days covering everything from basic file input/output, GUI elements like dialogs, inputs, progress bars and such, mouse controls (move, click, wheel, drag, etc.), speech, beeps, system control, downloading, and much, much more.
Logic handling enables you to perform basic If/Then/Else, even ForEach structures, and with variable loading and saving it all amounts to a pretty useful little scripting language for all kinds of automation tasks.
Check out KeyBind User Commands for the full list of all the available commands.
Why this is essential software.
I don't use all of KeyBind's functions myself. Not even close. I think up stuff I want KeyBind to be doing for me, or more often, stuff that KeyBind should be doing, then code it, then keep on using the same basic functions I use every day, many, many times a day.
I recently coded up a simple counter so that whenever KeyBind does something for me, it increments the counter. In under a day and a half that counter hit four thousand.
That's 4000 x "Time Saved", let's say it was only 5 seconds; find a window handle, resize (faster with KDE-Mover-Sizer, ten seconds in vanilla Windows 11!), or just a second, finding some "x" to close a window, or whatever, so let's say a mean of 2.5 seconds per task, multiplied by 4000 equals two hours, forty six minutes, and forty seconds. In less than two days KeyBind saved me almost three hours! I'm just doing these calculations now and realising how barmy it is that I haven't realeased this to the world for almost TEN YEARS! Sorry about that.
That's almost ten extra hours a week, every week, hours I can spend with my kids, or more likely this last couple months, coding KeyBind. But still, TEN HOURS. PER WEEK. Read that again. You use KeyBind, you get ten extra hours a week. Not a small thing.
My AI tells me this actually equates to 13 hours, 2 minutes, 13 seconds PER WEEK; that's 2 days, 7 hours, 53 minutes, 20 seconds PER MONTH, and a Holy-Shit Whopping 28 days, 4 hours, 21 minutes, 5 seconds PER Year. So use KeyBind and you owe me a month's wages every year, boyo!
Nah just kidding, KeyBind is 100% FREE. Binaries and full source available. Help yourself.
What I use KeyBind for all the time ...
Escto close tabs and/or windows, just everything; it's muscle memory now.Alt+F2to copy selected file's nameWin+F2to paste copied name to a newly selected file.Ctrl+Alt+Numpad[X]-> move a window into that quadrant (numeric keypad is perfect for this, the keys correspond to your desktop quadrants), *just* the way I like it there, my Explorer window positions are context-specific.Ctrl+Alt+Numpad5moves ALL windows to their default position and size, whatever it might be. More muscle memory for me.Ctrl+Shift+Cto Copy append to ClipBoard (creates a ClipBoard slot, we can play with these)Ctrl+Shift+Xto Cut append to ClipBoard (also creates a slot)Ctrl+Alt+Vto Paste any text as plain text.- Actually this is a massive list! No way I can cover these here.
I made a set of sample HotKeys you can install, with some of my favourites (definitely recommended!).
Then there's all the other stuff KeyBind just does for me, in the background. Keep on scrolling for the full picture ...
HotKeys.
You got to be startin somethin..
- You can give almost any keystroke (Windows reserves some HotKeys for itself) a Task. "Task" is a technical term we use to describe something KeyBind will do; basically a command or string of commands, for example something like
Ctrl+Win+Alt+K, which simply runs theShowHotKeys()command. This lists your current HotKeys in a dialog with useful controls and is used a lot. - You can create global HotKeys that work the same everywhere, or HotKeys that only activate inside specified apps, or both, or sequentially both; i.e. close tabs then the program, when it's the last tab; pretty much any scenario is possible. For me,
Esccloses EVERYTHING. I set it up that way. For some apps that closes tabs, for others it closes the whole program, sometimes both; but for me, essentially it always does the same thing. - You can have KeyBind type boilerplate, snippets, dates (
Ctrl+Alt+Atypes today's date. If I need to reload KeyBind, during development, the few seconds this feature isn't available are painful! That's usually exactly when I'm messing with landmark backups and need a datestamp NOW!) and symbols without actually typing them. Once you get used to working this way, you will not go back. - Repetitive tasks are instant candidates for some KeyBind hands-free action; automatic mouse and keystrokes, clicks, drags, pauses, drags; create elaborate repeating actions.. Drag image from website into folder, click website's "next" image button, wait a sec, drag next image into folder.. and so on.
- Of course that image always has the same name. Darned eBay! But that's okay, as the folder is a "watched" folder and a Sentinel will take care of it, renaming and moving and whatever else I setup for that type of dropped file.
- The HotKeys setup is super-simple, with clicky controls or just hit "Bind" (
Alt+B), mash whatever keys you need. - As mentioned,
Ctrl+Win+Alt+K(in the default keys) brings up a list of your current HotKeys, in any scope. In there you can hit any modifier combination to highlight matching HotKeys, filter the list by text (it opens with the filter activated, ready for typing), even edit HotKeys right there at any time, without opening KeyBind's Config Editor. - When I put the kettle on for a brew, I start a 2m countdown timer on a HotKey, so I don't forget about it.
CountDown()is a KeyBind command, but it's a much more useful command when you give it a HotKey. I drop in a tea-bag, walk through to my PC, hit my HotKey and two minutes later is tea time! KeyBind can do whole lot of things that make life easier. - KeyBind owns
Ctrl+Win+Alt(as developers are scared of using the Windows key, KeyBind grabbed it) and uses this combo for all native HotKeys, you just mash that row, and go. Of course that is configurable, but this combination does make it easy to remember HotKeys; M for theMag(), T for a new trigger, S for a new sentinel, F5 reloads, and well, dozens of others. - I use KeyBind around 3000 times a day (it has a built-in counter; my plan being, for landmarks like one million uses, hit you up for a donation). I don't notice it, it's mostly muscle memory now; mash the row, hit "," for config, mash the row hit H to create a new HotKey. You're getting the jist!
I move windows around my desktop, into my ten preferred places with
Ctrl+Alt+NumPadX,Ctrl+Alt+5puts every app exactly where I like it to be (the numpad provides a perfect placement control), no matter where or how big that might be. Some windows do it themselves (with KeyBind's help, of course) so I don't have to.Downloads are bottom-left, media is top-left, configs middle-right, and so on; I always know where to look. In ALL my apps I use
Ctrl+Alt+Numpad5to set the default size and position, browsers and editors big and wide, log viewer tall and left, and so on; but that's just how I like things. I like to throw windows around, knowing I can get them back to my preferred position instantly, some I just have them to do it when I click on them. - KeyBind enables you to basically do whatever you want, on a HotKey.
Also on a click, but that's another story.
Triggers.
Can you feel it?
- Trigger KeyBind Tasks when windows appear, System events occur, or the ClipBoard changes.
- System events like sign-in, power, hardware, network, activity or lack of it, USB, WiFi, and many others, can all trigger KeyBind to do something, i.e. a Task.
- ClipBoard triggers can fire on every update (I log all my clipboard operations to a file which often comes in handy) or when copied text matches, or contains your trigger, even using regular expression.
As a test, a long time ago, I created a Trigger that fires when the word "foo" enters my clipboard, so I get,
"Foo! And that's the foo!"in Microsoft Hazel whenever I copy any text containg the word "foo". Years later, I still haven't deleted it, and I get a kick out of it every time. This facility also has actual uses. - No HotKey required, Triggers run Tasks so you don't have to, reacting the instant anything happens.
Sentinels.
You know it feels like, somebody's watching me..
- I have a fetish for naughty pictures popping up where they shouldn't and dropping an image into a specific folder, even if it's exactly the same name as the one I just dropped, is handled; renamed, moved, whatever, sorted, next!
That's a Folder Sentinel. You can setup any number of these babies, with different handling for different kinds of files.
- Working with AI, I like to see exactly what file changed and when, so certain files are watched, and I get a wee notification in the bottom-left of my desktop for three seconds when those files get changed in any way, including a brief report of the new size and number of lines (OMG! HOW many lines!?!). Other files are also watched, for different reasons.
That's a File Sentinel. Again, you can setup any number of these (I mean, realistically, thousands would probably be pushing it, but hey, it's your resources! Dozens, even a few hundred active Sentinels will be unnoticable on most systems), even link them, so they can share the same Task; maybe a notification and/or
Beep()or whatever you need. - Use Sentinels to auto-sort downloads or any drop folder, filtered by configurable file types, with your own rules for each type; fix names, create numbered sequences, random names, date/time stamps, move files, and run any KeyBind command on the file at any point in the chain.
- Automatically backup changed files, watch Windows' own system activity; whatever you need, the two basic types of entities on your file system (files and folders) can be monitored efficiently, and any change actioned upon, instantly (we use Windows messaging for this).
- Sentinels can use all the regular commands as well as a few of their own, which makes them sound like Paladins or something; and indeed, they have superpowers.
Schedules.
Remember the Time..
- Like most people, I use Google Calendar and the likes to keep track of birthdays. KeyBind can easily handle this for you, but is designed more with local-type reminders in mind; regular alerts, morning wake up calls, notifications of useful times and dates, like "OpenCode limit has resumed!", and focuses on making it easy to setup schedules quickly; you can basically setup a new schedule with all parameters and a complete task, in one command.
- When I'm working on my PC I get reminders every 30m, to take a break for my body - this gets automatically disabled if I'm away from the PC for 10m, re-enabled when/if I start working again, and never interrupts my movie players (my PC also runs the family screen).
- Missed a Schedule while the PC was off/asleep? Not a problem. KeyBind will tell you about it.
- Run any Task on a Schedule; once, daily, weekdays, weekends, yearly, whatever suits your needs. And the Task can be anything KeyBind can do, which is most things.
- The possibilities are limitless. Also the info tips on that config tab are are good for a laugh.
Fully-Featured Task recorder.
- You can record your actions into reusable scripts. Simply hit record and do stuff. KeyBind records what you do into KeyBind commands.
- Capture mouse drags, clicks, wheel, typing, window focus, anything.
- Your regular HotKeys remain active during recording (KeyBind automatically pauses background schedules and triggers to prevent background jobs interfering with your capture session) and you can choose to record the raw events the HotKey produced, or the HotKey itself, which you might later want to change.
- When you're done, the (optional) Recording Editor opens so you can edit, save or copy your script.
Record()andStopRecording()can also be called from within tasks, as well as by the global start/stop recording HotKey (Ctrl+Win+Alt+F9) or KeyBind's System Tray menu.- With editing disabled, the script is simply saved to your supplied path, overwriting any existing file; if you don't supply a path, you get a Save dialog.
- The editor enables you to fine-tune every action; reorder steps, edit parameters, test individual commands, and then save the complete sequence to your script library, available from your KeyBind tray menu or an Explorer click.
Even more fully-featured configuration editor.
- You can manage everything from KeyBind's Config Editor; HotKeys, Event Triggers, Sentinels, Schedules, as well as many options.
- Not only a place to setup KeyBind's myriad features, but a great place to test your commands, play with your system's speech capabilities (also enable "hidden" voices), and much more. And yeah, of course there's a HotKey for it. (
Ctrl+Win+Alt+,) <- that's a comma. - 100% mouse or 100% keyboard or both control.
- All tabs share one common Task input, so you can move tasks between activation types (e.g. HotKey task -> Schedule; there's also context menu commands for moving and copying Tasks around willy-nilly).
- The first time you visit the Config Editor, you get a welcome message with a few crucial tips. You probably dismissed that dialog without reading it. Here they are again:
- Options groups are free-form wrapping blocks. You can arrange them however you like; simply click their titles and drag them around into your own preferred order, which will of course be remembered.
- If the window is resized, you may have options groups hidden below the bottom of the window. You can use scroll (your mouse wheel or pad) to access these other groups.
Think of the whole options tab like a page and it will make more sense. It's this way so I can add new blocks of options at any time without having to think about where they might go, or fit; which better enables me to add new options in the first place!
- Clicking any label reverts to the previous settings. If you mess up some setting, simply click its label and your old setting returns. Thereafter clicking the label will toggle back and forth between the two settings.
- Note: When you invoke the Config Editor, KeyBind will reload on its exit.
- Also note: KeyBind hosts myried ways to access live settings and edit the parameters of all your Tasks and their activation, general settings, etc., if you know what you are doing (i.e. the
KeyBind()command and the various*Control()commands, the corresponding dialogs, KeyBind System Tray menu, etc.).Here are the settings which are only available from inside the Config Editor (you can also simply edit your ini directly and reload):
- Skip passwords (when recording).
- Mail server configuration.
- That's it!
Obviously the Config Editor is awesome to use and makes editing everything easy, but in most cases it is actually not required.
- And if you were wondering, on looking at the variously-sized and movable options groups, that it was perhaps a puzzle of some kind; yes, it is.
HTML Reporting.
- KeyBind can create HTML reports of all your activators; HotKeys, Triggers, Sentinels and Schedules.
- Hit
Ctrl+Win+Alt+Y(as in, "Why?") to see an options dialog with buttons for all your reports. Slam the SpaceBar/Enter to see all your reports ("All" is focused on open), or pick an individual report. Reports open in your default web browser. - Note: The App Usage report looks similar, but doesn't use (or need) KeyBind's web server; it all happens in JavaScript (inside the web page), working with your locally saved App Usage data files; this month's usage file being updated once a minute; simply refresh for the latest data.
- Report pages are fully interactive and KeyBind spins up a temporary web server to deal with any edits you perform from those pages (via AJAX requests).
- In testing, the server turned out to be so efficient I added an option to have it running all the time; which I do myself; and various editing capabilities have been added to the report pages. If you prefer a web browser for configuring things, KeyBind has you covered.
- Your in-progress edits are remembered. Refresh, F5, restart KeyBind, or your PC; your in-progress edits persist until you click "Cancel".
- You can still get all your reports with the server disabled, they just won't be nearly so useful, or as much fun.
- KeyBind's server also supports sending commands from other apps, if that's your bag, and a full web API exists for your local fun. See the API page for full details of how to access KeyBind's server and send commands, edit settings, request security tokens, that sort of thing; from any other app or script (yes, you can have your local Python scripts send KeyBind commands).
- KeyBind's web server supports security tokens and orgin checking and is designed, by default, to operate securely. Aside from the possiblity of malicious software running on your PC sending arbitrary KeyBind commands; in a local setting these settings may be overkill for your usage scenario. So, either or both settings can be disabled if required.
Though note: the mechanisms exist for local apps to request access and use all the security features availble, so there's really no reason to disable them, unless you really need URLs without tokens in them, for some aeshetic reason, which I get.
The joy of scripts..
- You can chain simple steps into longer jobs (with "**"), or better yet stick them in a
.kcscript (which is just a plain text list of commands). All your.kcscripts are available from your tray menu .kcscripts can call other.kcscripts, ad infinitum (internal recursion is capped at 256 levels, but if the.kcscript command is the last command in your script, there is no limit; i.e. script A can call script B which calls script A, and so on, for ever).- Save reusable jobs as
.kcscripts and fire them from a HotKey, Schedule, Window Trigger, Sentinel.. or directly from the KeyBind tray menu. - Use the Recorder to create
.kcscripts directly from your actions. Put them on a HotKey and have KeyBind do it for you in future. - Make jobs smart; skip or branch steps based on what is open, what exists, some user input, or whether the last step worked (
If/IfNot..) and more. - Use
@ExplorerSelectionto get the full paths of selected Explorer files and folders. A HotKey or.kcscript can process each path withForEach(), e.g.ForEach(@ExplorerSelection|Task), using@Itemfor the current path. The task keeps its captured list even when a dialog changes focus. See the complete examples. - Ask for input mid-job and reuse the answer later; type your new client's name once, KeyBind automatically creates client-specific folders, cover notes, whatever you need. Check out the
ShowMe.kcdemo script for examples. - KeyBind can remember your user values between runs, so jobs can pick up where they left off; number sequences, last file handled, etc.. All your user variables can be saved at shutdown and reloaded at launch; like KeyBind's running CountDown timers, even rebooting your system won't affect them.
- These days I usually just tell my AI to read the KeyBind manual and create me a script to do *whatever*. Automate your automation!
What KeyBind doesn't do:
Typed Abbreviations and Text Expansion
KeyBind does not watch for typed abbreviations or automatically replace them with longer text. It can insert text with Text() when you activate a task, for example with a HotKey (Ctrl+Win+Alt+A, to insert the current date, for example), but typing :tom is not a KeyBind trigger.
For that job, it's best to use a dedicated text-expansion tool such as Espanso. I believe dedicated tools are better suited to keyboard-layout and the application-specific behaviour involved in text expansion, which is not a minor job.
Espanso works well; you define an abbreviation and its replacement, for example :tom for "I'll get in touch tomorrow", and Espanso detects the abbreviation and inserts the replacement as you type.
Espanso and KeyBind can run alongside each other just fine, no configuration required.