Skip navigation
javier.franciscojmp
Currently Being Moderated

How can I temporarily disable hotkeys in photoshop?

Jun 10, 2013 8:29 AM

Tags: #c++ #plugin #hotkeys

Hi all,

 

I have a plugin in C++ that starts an external process.

This process has UI and his event loop.

That event loop runs in external code so that I cant use the regular dialogproc to capture WM_KEYDOWN events.

 

After start we have mainly one direction comunication. plugin UI -> Photoshop

the plugin implements functions that the external process can use to talk to photoshop as well.

 

The photoshop UI works fine, anything happening there will not affect the plugin UI.

I thought that was the difficult part of the implementation but... I found no way to disable hotkeys in photoshop.

I know when to disable them because I am getting events in my plugin UI for it... but no idea which command should I use to prevent photoshop from getting the plugin Ui events as hotkeys.

 

Is something I can do in "AutoPluginMain" ?

 

I hope I could explain myself properly.

 

Thanks,

Javier

 
Replies
  • Currently Being Moderated
    Jul 12, 2013 12:12 PM   in reply to javier.franciscojmp

    If your plugin is running as a separate process it should not be getting any events meant for Photoshop if your plugin process is active.

     

    If you're spinning an event loop in your Photoshop side of things, only process UI update events - ignore any other events such as input events.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 12, 2013 12:32 PM   in reply to javier.franciscojmp

    I also use an external process for my Photoshop plugins but I don't keep any kind of connection with Photoshop. When I launch my process I save the full Photoshop image to a RAW temp file and send other attributes on the command-line. In my external process I overwrite the image and when it exits, back in Photoshop, the PS-side of things reads the image back in from the RAW file and sends them as tiles back to PS.

     

    This simplifies everything immensely, and there are no collisions at all with PS - it essentially "goes to sleep" while my UI is up.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 12, 2013 1:17 PM   in reply to javier.franciscojmp

    Run a persistent automation plugin

    Install a winows hook on keyboard events on startup (and don't forget to uninstall on shutdown...)

    On any even check whether the window in focus is the one that belongs to your plugin

    If it is, eat the event; otherwise pass it forward to PS.

     

    This is the dark side of the force however apparently you are trying to have a semi-modal GUI in PS which is explicitly unsupported (outside of the Flex panel framework), so don't expect out-of-the-box Jedi solutions here

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 12, 2013 2:26 PM   in reply to javier.franciscojmp

    Well, you can simply have a Flex panel floating around (check the Extension bullder SDK), with text input, buttons, lists and whatever else Flex lets you do, talking to your extental app to your heart's content. No problems with Photoshop shortcuts, no "dark force" and what not.

    The thing with PS API is that its indeed dated and quite limitied in terms of what you can and cannot do, however if you do know its capabilities there is a lot you can achieve. There is a need for hackery if you want to overcome these limitations, however from the description of the problem, you may be able to get away without resorting to it by using the right approach.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points