Well… caps lock is all uppercase… not capitalized.
I’m talking about instances when I know every word should be capitalized. Intermittently hammering Shift is disruptive to typing.
I don't see an easy way to do this in the way you have described, though
others might have some ideas.
An alternative would be to do the typing in lower case, then activate a KM
macro that selects the text, (Command A), copies it to the clipboard,
processes it, then pastes it back into your application. The link below
isn't directly a KM solution for the processing, but might be of interest,
depending how complex your needs are:
I’m already filtering it this way; entering text into a temp variable box or passing it through a filter.
It works well but I guess I was just curious if there was a different way of doing it. Keyboard Maestro is both a simple and complex beast so I thought I may have missed something.
The problem with this is that people tend to type quite quickly, so its easy for the characters to get out of order because of the event queue processing.
But here is a possible way of doing this:
Macro Start/Stop
Trigger: some hot key
Action:
If macro "Watch Spaces" is enabled
Disable Macro "Watch Spaces"
Disable Macro "Capitalize"
else
Enable Macro "Watch Spaces"
Enable Macro "Capitalize"
Macro Watch Spaces
Trigger: USB Device Key trigger [space]
Action:
Enable Macro "Capitalize"
Macro Capitalize
Trigger: 26 triggers for unshifted letters (tedious to set up)
Action:
Disable Macro "Capitalize"
Insert Text by Typing "%TriggerValue%"
Luckily for you, %TriggerValue% for a trigger like "X" (unshifted) is capitalized, so that obviates some steps to capitalize %TriggerValue%.
Should work, whether its performance is sufficient for you, you would have to see. If so, post it as a macro to the forum.
You can choose whether or not to include the making the selection in the macro. For example, these are easy enough to do manually, and provide more flexibility:
CMD-A -- selects ALL of the text in the text area (as suggested above)
Triple-click -- selected the entire sentance, even if on multilpe line.
CMD-SHIFT-LeftArrow -- selects all of the text on the line to the left (use after typing)
OPT-SHIFT-LeftArrow -- Select one word at time to the left.
You probably already know all of these. I'm just suggesting that doing the selection outside of the macro gives you more flexibility without a lot of work.
Then call the macro to capitalize the selection.
OTOH, if you always have the same selection, then it makes sense to put that in the macro.
Just an idea — why not use the hot-key to drop a marker in your text, and then the second press of the hot-key (or perforce a different hot-key) cuts all the text between the marker and the second-press insertion point, filters it to “Title Case”, and pastes it. (I think you might find you have to filter first to all lowercase, then to “Title Case”.)
If you type quickly and don’t want to be interrupted, you could likely leave the “start” and “stop” markers as you type, and process them all when you’re done typing.
Are you referring to title case, in which the first letter of each word is capitalized, like this:
Convert a Line of Text to Title Case With Keyboard Maestro. If so, I wrote an article about how to do it while typing.
I think I would try to trigger this on the "space" key.
So for example when space is triggered copy last word (select whole line width keystroke [CMD]+[Arrowleft] and Regex filter last word ) then make it uppercase and paste it again. –maybe