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

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

Explorer ,
Dec 31, 2014 Dec 31, 2014

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

TOPICS
Actions and scripting
866
Translate
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 1 Correct answer

Advocate , Jan 01, 2015 Jan 01, 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.

...
Translate
Adobe
Community Expert ,
Dec 31, 2014 Dec 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")

}

Translate
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
Advocate ,
Jan 01, 2015 Jan 01, 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

Translate
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 02, 2015 Jan 02, 2015

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

Translate
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 02, 2015 Jan 02, 2015

I suspect DBarranca could provide relevant advice here as well as over at 

Extension Builder 3

but if the issue concerns an html5 Panel I think this Forum is not a perfect fit.

Translate
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
Advocate ,
Jan 02, 2015 Jan 02, 2015
LATEST

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

Translate
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