Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Using Same Key to Start & Exit An Application

If you have a question or need help, this is the place to be.
Post Reply
mjw1024
Posts: 7
Joined: Tue Mar 13, 2007 6:22 pm

Using Same Key to Start & Exit An Application

Post by mjw1024 »

How do I setup a key that will launch an application and exit it as well? Example: I press the "DVD" key to start Zoom Player. If I press the same key while in Zoom Player, it will exit the application.

Thanks
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Post by Bartman »

If pressing the DVD key is the only way you start ZP you can enable a close macro in the start macro and disable the start action. You have to use the "Stop processing this event" action in each of the macros. Otherwise both will run in circle.
The other way is to switch between the two macros with the task plugin, as it will give you events when an application is started or closed.
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster »

And the third way is to use the FindWindow action. A layout like this:

Macro: Launch/Exit Zoom Player
Event: DVD
- Find Window: some window from ZP
- Jump: If successful to "Exit Zoom Player" and don't return
- Start Application: Zoom Player

Macro: Exit Zoom Player
- Zoom Player: Exit

This will even do the right thing if ZP was not started by EG.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
Post Reply