Skip to main content
Known Participant
December 31, 2014
Answered

Is it possible to detect an alt-click or cmd-click on a button of a custom panel?

  • December 31, 2014
  • 1 reply
  • 878 views

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

This topic has been closed for replies.
Correct answer DBarranca

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

1 reply

c.pfaffenbichler
Community Expert
Community Expert
December 31, 2014
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")

}

DBarranca
DBarrancaCorrect answer
Legend
January 1, 2015

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