Copy link to clipboard
Copied
I would like to create a global keyboard event that runs a certain function when it's called in my CEP Panel. Is this possible with javascript or C++? I achieved this only when the panel was focused, adding an onkeydown="keyDownInBody()" in the body element of my HTML. Is it possible to get key events when the panel is out of focus? I saw that some third-party plugins that I installed in After Effects, have the ability to run with global shortcuts when the panel is out of focus.
Copy link to clipboard
Copied
if it's a native AE shortcut, you can have your plug-in edit the shortcuts file.
otherwise, in a C panel you can create an idle_hook, and check the keyboard state directly through the system a few times per second. but i don't think there's a way to get a direct keyboard event when the panel is not in focus.
Copy link to clipboard
Copied
Thank you, I appreciate your help. What about plugins like Video Copilot FX Console, which can run with keyboard shortcuts without editing the shortcuts file, and also capture the mouse position on the screen?
Copy link to clipboard
Copied
it sounds like it implements my second soggestion of using idle_hook to check the os for keyboard state and mouse location directly.
Copy link to clipboard
Copied
Hey, thank you. However, I think this plugin is not using things like idle_hook, because the plugin doesn't need as much ram memory, and always runs smoothly. Does anybody have a different suggestion?
Copy link to clipboard
Copied
errr... that doesn't stirke me as a deterministic deduction...
take a peek at it's components. if there's a AEGP involved, chances are there's an idle hook involved.