Copy link to clipboard
Copied
For the sake of screen real estate I would like to tie two similar commands to a single button that can be alt-clicked or cmd-clicked for a different outcome.
I know the ScriptUI provides some options but I'm looking for a way to handle it in the panel itself without a pop-up.
I would like to know if it is possible to detect a modifier during a click event inside the panel and, if possible, how to handle it.
Thank you for any insight to the situation.
Regards,
Patrick Deen
It's not clear whether Patrick was asking about a ScriptUI Dialog or an actual HTML Panel - yet I think there's a wide gray area where it's difficult to tell apart Photoshop Scripting, general ExtendScript, Panels, etc. and it's natural (possibly also profitable) for topics to be slightly mixed.
Besides what's been correctly suggested for ScriptUI by c.pfaffenbichler, you can have a look here for panels: MouseEvent altKey Property.
Regards,
Davide Barranca
---
www.davidebarranca.com
www.cs-extensions.
...Copy link to clipboard
Copied
I would like to know if it is possible to detect a modifier during a click event inside the panel
What’s that got to do with Photoshop Scripting?
Wouldn’t you need to address that with Flash or html5 depending on the kind of Panel you create?
Apart from that a Script can be used to do different things depending of pressed keys, for example
if(ScriptUI.environment.keyboardState.shiftKey ){
alert ("shift key pressed")
}
Copy link to clipboard
Copied
It's not clear whether Patrick was asking about a ScriptUI Dialog or an actual HTML Panel - yet I think there's a wide gray area where it's difficult to tell apart Photoshop Scripting, general ExtendScript, Panels, etc. and it's natural (possibly also profitable) for topics to be slightly mixed.
Besides what's been correctly suggested for ScriptUI by c.pfaffenbichler, you can have a look here for panels: MouseEvent altKey Property.
Regards,
Davide Barranca
---
www.davidebarranca.com
www.cs-extensions.com
Copy link to clipboard
Copied
Thank you for your reply. I am aware of the scriptUI keyboardState.
To detect that event inside the photoshop html panel would require a function call to the jsx before it can be available inside the html panel.
The reason my question is relevant to this forum is that the html panel's run on chromium inside the photoshop environment, which I think might pose some limitations to what can be achieved with javascript on the html/panel side.
I was looking into a way to change the appearance of a button so it would give the user some indication that when "ALT-clicked" another precess would take place.
Regards,
Patrick Deen
Copy link to clipboard
Copied
I suspect DBarranca could provide relevant advice here as well as over at
but if the issue concerns an html5 Panel I think this Forum is not a perfect fit.
Copy link to clipboard
Copied
Hi Patrick,
the JS and JSX engines are distinct (which is sometimes a plus, sometimes a minus), so there shouldn't be any overlap between the Photoshop script side and what is pertinent to the Panel. That said, you can open a new thread on the EB3 forum and let's go on with the discussion there.
Regards,
Davide Barranca
---
www.davidebarranca.com
www.cs-extensions.com
Find more inspiration, events, and resources on the new Adobe Community
Explore Now