I find myself repeatedly entering the same strings over the course of a work day. These typically vary from day to day so I can record them once in the mornings and save time over the course of the day.
I also have to do repeated actions in text files, do once, record, play back. Yes could probably do with regex and vim actions but I am not always in vim.
One small comment to get this working though: you need to enable extended macro commands.
To do this, create a macro called $onInit which contains the following content:
That’s correct!
I had assumed everyone had those on, but then again I have been using the “extended commands” with Karels firmware since I pretty much got the keyboard!
The great thing about “runtime macros” is, that you always have them because your UHK has them, no matter if the application you need has macros or not.
I want share my enhanced version of this macro, which allows you to repeat the macro until release.
The downside of this is that you need to create 2 macros, instead of only 1.
Can’t you put it into a single macro by replacing ifNotAnyMode exec PlayRepeatMacro with ifAnyMod break and just adding the commands of the PlayRepeatMacro below?
I want to hold down a single key, and I want it to activate a layer and shift at the same time. The OP mentions holding down a layer key and a separate shift key at the same time.
Any alternative solution that achieves the same desired effect would also be fine.
What I’m getting at is:
Ty for this. This has been great for gaming. Because it’s a split keyboard it’s harder to reach keys like m, p, i from the left side, but I don’t necessarily want to permanently bind these keys to my key cluster module.
I did try the other script that allows for repeating, and it does work… up to a point. I find if I click the key a few times in succession I get a lot of issues, like it looping uncontrollably and causing programs to crash.
Is there a way for the macro to include typing delays?
Like @Tunney, I often am testing something where I need to do the same workflow repeatedly, which includes logging into something, typing a bit, waiting for something to load – I’d love to record a macro that runs in “real time”: that is, the macro is played back at the same speed as I recorded it. Right now, my UHK when replaying the macro just blasts the keystrokes out, which works fine for many things that do proper input buffering, but not for my use case.
I know pre-programmed macros can do delays, but I am hoping to get that working automatically.
Then, on Fn-8 (“8” rhymes with “wait”, and is next to 9…), I just have:
recordMacroDelay
Let’s say I’m logging into a website. I do this:
shift-Fn-9 to start recording.
Enter my login credentials. Tab to the “log in” button, hit enter.
Now I have to wait for the website to respond. I hold Fn-8 while that happens.
When I’m logged in, I release Fn-8, and perhaps tab twice and hit enter to open the first item.
Shift-Fn-9 to stop recording.
What’s great about this approach is that I can type slowly and carefully (so the macro is recorded correctly) when, say, entering my username and password, but that part of the macro plays back at full speed. So it’s actually in some sense better than what I asked for: the delays are exactly where I need them, and exactly the length they need to be.
Since no delay is introduced and nothing recorded when I’m not doing anything with the keyboard, I can also do something like this:
when the slow part of the workflow starts, don’t do anything, just count to yourself to time how long it takes.
when the UI is ready, then hold down Fn-8 for the same count to record the same delay. Release, and continue recording. The actual real-world time you were waiting – and during which the UHK was recording – was about twice as long as needed, but when playing back, only the Fn-8 delay time is used.
This is truly amazing. It’s life-changing. Now when doing repetitive testing or workflows I can record a macro and it’ll go soooo much faster.