How to use CAPS LOCK being ON as a condition?

I want to use a keyboard shortcut only when CAPS LOCK is on.

Is there a way to do this?

Do you want to hold Caps Lock while pressing for example cmd+a, or caps lock + a will be the shortcut?

Either way, try 1004, where you wrote CAPS LOCK.

I want my keyboard shortcut (e.g. cmd+A) to do a different thing when Caps Lock is ON (green), and a different thing when Caps Lock is OFF (no light in the key)

Caps Lock Pressing cmd+a
OFF select all
ON open Finder

I don't think it will work like that. But you could switch a preset on/off with Caps Lock.

Green = preset on, cmd + a, does something.

Not green, preset off, cmd + a, does something else.

Cool! How can I configure a preset like this?