Intercepting keypresses/mouse clicks?

Kind of an obscure question, and really not specifically JUCE-related (i don’t think), but I figured i’d put it out there…

i’m working on an app where i want to know if the user pressed a key or clicked the mouse – even when my app isn’t the “focussed” application.
i know how to install hooks to do this in windows, but i’m stumped for the mac.

any ideas?


It’s not very easy, and most OSes would probably discourage it, because an app shouldn’t be snooping on your interactions with another one. Not sure if it’s even possible on the mac.

What’s your reason for needing to do it? Writing some spyware, perhaps?.. :wink: