Capitalise Macro

I’m hoping to make a macro (for keyboardio and possibly mouse too) along the lines of this:

ctrl-left arrow (to get to the start of the word being typed)
Shift-right arrow (to highlight the first letter of the word)
ctrl-shift-A / Shift-F3 / something like that (to capitalise that letter)
Shift-right arrow (to get back where we started)

Alternatively, ctrl-shift-left arrow to highlight the whole word if the something like that only capitalises the first letter instead of the first two steps.

I know how to make this work for office programs, but am hoping there’s a way it can work globally? Anyone know any shortcuts like that for windows? Basically, I just want to streamline the process of “oops, I forgot to capitalise the word I’m typing now”.

This seems like it might be challenging, but in theory your plugin could remember the last letter that came after a non-letter? This would be specifically for fixing the capitalization of the last word you typed, not of whatever word you clicked on on the screen.

You could make it fully delete and re-type too, instead of relying on app-specific arrow key shortcuts. So if it buffers that the letters typed since the last non-letter are andrew, the macro could type backspace six times and then re-type Andrew.