Is there a way to let keyspresses go through on the original application they’re coming from?
My menubar app shows different information when a keyboard letter or number is pressed in Clip Studio Paint. While my app is displaying the right information when a key is pressed, Clip Studio Paint no longer registers those keystrokes, so it doesn’t change tools.
Unfortunately, I think Jared is right. Neither the Mouse Click & Keyboard Events example nor Event Logging example catch keyclicks from another app when the other app is frontmost.
I also tried using a timer that checked Keyboard.AsyncKeyDown - it only catches modifier keys & arrow keys when another app is in front.
I’ve settled on using only two shortcuts that iterates up and down through a list of tool dictionaries to display the info I want. It’s a PITA compared to catching keyboard keys, but it’s a least clunky solution.
Then the app need to be code-signed and in Privacy Settings you need to grant access to Accessibility features. Then the MBS-Sample worked in my test (cool!)
I’ve code-signed it with App Wrapper using a Development profile, and added it to Accessibility and Input Monitoring in Privacy and Security, and I’m not getting any keystrokes when I switch to another app, unfortunately.