Caps Lock key to trigger stylistic set

Hi, I’m currently working on an all-caps font; in order to make it more interesting I designed an alternative stylistic set for the uppercase letters. My goal is to allow the seamless use of the uppercase letters combined with the rest of its stylistic set (limited to some numbers/symbols/punctuation). While it’s easy to switch between lowercase and uppercase letters (regular stylistic set and alternative stylistic set) on a keyboard, the only elegant solution that I figured out to enable the use of the “uppercase stylistic set” in its entirety would be through the Caps Lock key.

Is it possible to trigger an alternative stylistic set through the Caps Lock?
If yes, would it be complex or easy to code?

Thanks in advance to anyone who can help.

No, the Caps Lock key does the same as holding down Shift. A font cannot differentiate between the two.

As far as I can see with Caps Lock ON I can still write basic punctuation and numbers, unlike if I hold Shift. That’s why I figured out that solution.

It depends. On the Mac, Caps Lock mostly just affects letters, while on Windows, I believe, it matches Shift more closely. In either case the resulting text is indistinguishable from the text produced without the use of the Caps Lock key, so the font cannot use different glyphs.