Skip to main content
StefanStehlik
Inspiring
January 3, 2023
Question

Activate button in AE extension panel with keyboard events, when panel is out of focus

  • January 3, 2023
  • 1 reply
  • 771 views

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. 

This topic has been closed for replies.

1 reply

Community Expert
January 3, 2023

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.

StefanStehlik
Inspiring
January 4, 2023

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?

Community Expert
January 4, 2023

it sounds like it implements my second soggestion of using idle_hook to check the os for keyboard state and mouse location directly.