Typing Underscores with Spacebar while capslock is held down

Hi there,

I have been struggling to make a macro that would make a big difference in my life. When writing SQL I am constantly typing words separated by underscores like database_name_one. Using Auto Hot Key I built a macro that would turn the spacebar into an underscore only while the caps lock key is held down. What I could do was hold the spacebar down the whole time while typing and each hit of the space bar would lean to one underscore. I have tried a few things. The closest I got was with a trigger of caps lock and an if then where the space bar was down. I also tried a hotkey trigger of shift-space, but it would still maintain the shift functionality at the same time plus I want to be able to use shift to type multiple words in uppercase. Any advice would be much appreciated. Thanks,

-Carter

Maybe I'm misunderstanding, but it seems like this should work:

image
Another option, though perhaps too different for muscle memory, would be to have two spaces become an underscore. The visually blank string field shown here is actually two spaces.

image

1 Like

Thank you so much for your response. I like the idea of the double-tap of the space bar, I used it at work today and it worked quite well. And you are right, I am kind of holding on to muscle memory. The only reason why the top option wouldn't work for me is that the text would be in uppercase eg DATABASE_NAME when I am looking for database_name. If you have any thoughts that would be appreciated, but otherwise thanks a bunch of the help!

-Carter

The top option wouldn't affect the database name. The name would be typed as desired, and only when you type Shift-Space would an underscore be inserted instead of a space.