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

Is it possible to use keyboard shortcuts for CEP panel's function when the panel is out of focus?

Explorer ,
Oct 01, 2022 Oct 01, 2022

Copy link to clipboard

Copied

Hi guys, Is it possible to assign keyboards shortcuts that will initiate my jsx function? I  am building CEP panel for after effects and I want to give a user an ability to quickly launch function using shortcuts rather than clicking on gui. I know it is possible to listen to keydowns/ups when panel is on focus, but how to listen globally in app?

TOPICS
Scripting , SDK , User interface or workspaces

Views

2.2K

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

correct answers 2 Correct answers

Participant , Oct 06, 2022 Oct 06, 2022

I'm not sure what exactly you want to achieve but here's a suggestion: You could create a jsx file (or multiple ones) in AE's "Scripts" folder (not the "ScriptUI Panels" folder) which you can assign shortcuts to in AE's keyboard shortcuts dialog. (You can also add the shortcuts automatically by writing to AE's keyboard shortcuts file.) Now, I don't know about CEP panels but with a ScriptUI panel, you could call the panel from within your jsx file in the "Scripts" folder and hand over a global va

...

Votes

Translate

Translate
Community Expert , Oct 07, 2022 Oct 07, 2022

That's a good suggestion for a workaround! Also see my tutorial here about configuring keyboard shortcuts for jsx scripts:

https://mamoworld.com/docs/automation-blocks/tutorials-ae/keyboardShortcuts

This tutorial is about Automation Blocks, but the same works with any other jsx script.
The jsx script that is triggered by the shortcut could also create an event that your CEP panel could listen to:
https://www.davidebarranca.com/2014/07/html-panels-tips-11-externalobject-cep-events/

 

Votes

Translate

Translate
LEGEND ,
Oct 01, 2022 Oct 01, 2022

Copy link to clipboard

Copied

I don't think it's in any way possible as the panel's event listener would block a lot of other functions and trigger a ton of errors, after which the script would stop and you'd have to relaunch it.

 

Mylenium

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 ,
Oct 02, 2022 Oct 02, 2022

Copy link to clipboard

Copied

As Mylennium says, there is no good, clean way to do that. I think the tool Excalibur  does this with a dirty hack - by running a process which monitors keystrokes in the background or something like that. Besides the security implications (nobody wants a tool to monitor everything that is typed) it causes limitations like the keyboard shortcut also being fired when a dialog is open.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

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
Participant ,
Oct 06, 2022 Oct 06, 2022

Copy link to clipboard

Copied

I'm not sure what exactly you want to achieve but here's a suggestion: You could create a jsx file (or multiple ones) in AE's "Scripts" folder (not the "ScriptUI Panels" folder) which you can assign shortcuts to in AE's keyboard shortcuts dialog. (You can also add the shortcuts automatically by writing to AE's keyboard shortcuts file.) Now, I don't know about CEP panels but with a ScriptUI panel, you could call the panel from within your jsx file in the "Scripts" folder and hand over a global variable to tell the panel which function to execute. Or depending on what you want to do, just execute the function from the jsx file in the "Scripts" folder.

 

There's also a way to assign multiple shortcuts to a single jsx file while still being able to execute multiple functions. But it's complicated. See my explanation here:
https://creativecow.net/forums/thread/limit-to-after-effect-script-hotkeys/

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 ,
Oct 07, 2022 Oct 07, 2022

Copy link to clipboard

Copied

LATEST

That's a good suggestion for a workaround! Also see my tutorial here about configuring keyboard shortcuts for jsx scripts:

https://mamoworld.com/docs/automation-blocks/tutorials-ae/keyboardShortcuts

This tutorial is about Automation Blocks, but the same works with any other jsx script.
The jsx script that is triggered by the shortcut could also create an event that your CEP panel could listen to:
https://www.davidebarranca.com/2014/07/html-panels-tips-11-externalobject-cep-events/

 

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

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