CAPS LOCK Modifier problem, and possible solution

This is just in case anyone else notices the problem so they know what is going on. Peter is investigating it.

I use CAPS LOCK to do special actions, abort a macro, turn logging on, take a different path, whatever. I find it useful as I can press it and leave it.

I noticed recently it wasn't working, I have a macro that uses find any file to save a log of all my files created/modified in the last day, it's worked fine for months but then one day it caused serious problems because I had done a few updates and so the clipboard ended up being 5MB (40K files that day!). Anyway, I used CAPS LOCK to keep the apps open when I saw the problem so I could see what had changed, but they still closed.

It took me a while to track it down but the problem seems to be that if you have a 'Type a keystroke' action prior to the modifier check, then the modifier check will always say that the CAPS LOCK key is OFF. This is also the case if the type action is in a sub-macro.

I have a test macro that you can use to check:

[Test] Macros.kmmacros (8.4 KB)

Anyway, it caught me out so I thought it worth noting.


I wonder if this is why I was unable to get the CAPS LOCK modifier check to work for me when I first tried doing this some months ago. I'm not sure if I can find that old code, but I'm extremely interested in knowing what happens here.

Interesting! Your post is a great reminder to us all that when we encounter odd situations, we should probably post about it because you never know if someone else might encounter the same situation.

And @Sleepy, even if this ends up not being the exact situation you encountered, perhaps it's similar. Did you ever post a question about your issue, or did you just assume that was the way it worked? I know for me I'd probably just assume that's how it works, so I hope this is a lesson to me to verify those assumptions next time.

Thank you.

It took me a while to isolate the cause and it was irritating me no end. As it was such a strange one I thought it worth posting just in case anyone else was having a similar issue.

Honestly, I don't even know how you isolated it. The debugging process must have been excruciating.

Anyway, way cool in figuring it out (as much as you have to this point), and I'm celebrating with you, because I know there aren't many people you can share this kind of success with, who truly understand. :+1::+1:

Oh, and I changed the title of this topic to help other people realize it might help them with a problem. I'm not thrilled with my wording, so if you've got better words, feel free to change it again.

The life of a programmer is isolating causes of problems. I'm doing that probably 8 hours per day. The rewards are with it. Perhaps it's a little like giving birth, there's pain but the final reward is what you remember for the rest of your life.

I confess one thing. Sometimes when I figure out how to do something I don't share my discovery with others. That way I'm the only one who can achieve something. I know that's not generous but it does happen on occasion.

I think that some mechanical jobs like carpenters may share some of the same problem solving skills as a programmer. I wonder if anyone has ever studied that.

It turns out I did post.

That's only a month ago. I thought it was several months ago. This is very important because it tells us when I made my observation. And it gives us the exact code that failed.

I probably will test it again to see if the code now works, but at this moment I'm still just waking up and I can't handle coding at this exact second.

1 Like