• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Explorer ,
Jan 03, 2023 Jan 03, 2023

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. 

TOPICS
Error or problem , Resources , Scripting , SDK

Views

241

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 03, 2023 Jan 03, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 04, 2023 Jan 04, 2023

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 04, 2023 Jan 04, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 09, 2023 Jan 09, 2023

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 10, 2023 Jan 10, 2023

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines