Hello!
Is it possible to set a keyboard shortcut in a Photoshop plugin? I’ve seen some threads about it and some documentation mentioning UXP keyboard shortcuts for Adobe XD and thought it might work the same in manifest.json, but it doesn’t.
Any updates on this, in the past for traditional extendscript, I added shortcuts via the shortcut menu, so they aren’t hardcoded into the script .
However with the UXP plugins it would seem that keyboard shortcut menu only goes to the top level of the plugin menu…not down into the commands level (see screenshot attached)
Any idea when this will be available? With CEP I was able to assign a hotkey to an action that fired an extendscript event. Is there any similar method we could use with UXP?
function sendEvent(type) {
new ExternalObject('lib:\PlugPlugExternalObject');
var event = new CSXSEvent();
event.type = type;
event.dispatch();
}
sendEvent('hotkey-process');
It would be nice if keyboard shortcuts could automatically be applied to UXP plugins. Basically, open the keyboard shortcuts menu and there would be a new checkbox for capturing a UXP button click as a shortcut if the checkbox was checked. Once it’s checked, the user could click the UXP button that they wanted to create a checkbox for, and Ps would somehow capture it. Once captured, the user could assign their preferred keyboard shortcut to that item. I know that’s probably asking for a lot, but it would be nice to make it as easy as possible for developers and users.
I think the first step would be to get the Plugins submenu items (plugin commands) into the kbsc dialog.
The “capture a button click” is more of a challenge since the dialog is constructed to map the key to a menu item. Functionally, this wouldn’t be much different than recordAction. Changing the dialog would likely be the larger amount of work.
The workaround right now is the old standby of record an Action and assign one of the F# keys.
How would this be possible in a not-sane way? I really need to add some shortcuts to my plugin, I don’t care how. I just need to run some code when some keys are pressed. If I need to hardcode the keybinds/make my own settings menu then so be it. I tried adding onkeydown handlers in JS to the document/to my elements but that doesn’t seem to be working.
It seems like these are psp files, some binary format, unless I’m looking in the wrong place (appdata/roaming/adobe/adobe photoshop 2024/adobe photoshop 2024 settings)
As an alternate idea, I created a UXP command to do what I want, and now I’m trying to create an ExtendScript/JSX to invoke that command (then I can assign a keybind to the jsx script). I used the script listener plugin to generate the jsx for clicking my uxp command in the plugins menu, but when running that jsx I get “General Photoshop error occurred”.
Does anyone know if that method would be possible? If so, how?
If you are just trying to find a workaround for using a hotkey for a plugin action for your private use, maybe just make your uxp action recordable and then assign a hotkey for an action that triggers the function you want.
Want to give this topic a nudge because keyboard shortcuts for UXP Plugins is super important for me, as well. Its such a obvious functionality, I can’t believe it hasn’t been implemented, yet.