Command line events
-
- Posts: 7
- Joined: Mon Jun 03, 2019 7:18 am
Command line events
I triggert events by command lines for former versions of EventGhost (4.x) sucessfully.
Example:
"C:\Program Files (x86)\EventGhost\eventghost.exe" -e Keyboard.LShift+F2
for a macro called "Volume Up" wich is triggered by the event "Keyboard.LShift+F2".
After i switched to 0.5.0-rc6 this doesn't work anymore.
Has the command line structure altered from version 4 to 5?
I don't understand the help well because there are no examples.
Any ideas about this?
Example:
"C:\Program Files (x86)\EventGhost\eventghost.exe" -e Keyboard.LShift+F2
for a macro called "Volume Up" wich is triggered by the event "Keyboard.LShift+F2".
After i switched to 0.5.0-rc6 this doesn't work anymore.
Has the command line structure altered from version 4 to 5?
I don't understand the help well because there are no examples.
Any ideas about this?
Re: Command line events
I get "Main.Keyboard.LShift+F2" event, I guess the "Main." part is different from before? Don't know if it's possible to make non "Main." events from the commandline in the current EventGhost version.
jonib
-
- Posts: 7
- Joined: Mon Jun 03, 2019 7:18 am
Re: Command line events
Thanks for the hint. But i couldn't get it run.
Re: Command line events
So what is not working? you are not getting an event? or the wrong event? the event needs to match the event in the macro.
jonib
-
- Posts: 7
- Joined: Mon Jun 03, 2019 7:18 am
Re: Command line events
Here are more details:
I trigger this command by a cmd file:
"C:\Program Files (x86)\EventGhost\eventghost.exe" -e Keyboard.LShift+F2
If i quit EventGhost and trigger it, EventGhost just starts. That proves the path to the exe is correct.
If Event ghost is running already and i trigger the command, i get this:

https://pasteboard.co/IvcAF9R.bmp
EvnetGhost Version 0.5.0.-rc6 (2018-12-24)
Windows 10 Pro X64
I trigger this command by a cmd file:
"C:\Program Files (x86)\EventGhost\eventghost.exe" -e Keyboard.LShift+F2
If i quit EventGhost and trigger it, EventGhost just starts. That proves the path to the exe is correct.
If Event ghost is running already and i trigger the command, i get this:

https://pasteboard.co/IvcAF9R.bmp
EvnetGhost Version 0.5.0.-rc6 (2018-12-24)
Windows 10 Pro X64
Re: Command line events
Looks like you need to add the "Main.Keyboard.LShift+F2" event to the macro for it to work.
I created an issue in the Eventghost issue tracker as I don't know if this is an intended breaking behavior compared to the old Eventghost 0.4.
jonib
I created an issue in the Eventghost issue tracker as I don't know if this is an intended breaking behavior compared to the old Eventghost 0.4.
jonib
Re: Command line events
Response to the issue:
jonibDanEdens wrote:You can get around this by using the wildcards * and ? in your trigger.
For example:
*.LShift+f2
-
- Posts: 7
- Joined: Mon Jun 03, 2019 7:18 am
Re: Command line events
OK, i renamed the event wthin the macro from
Keyboard.LShift+F2
to
Main.Keyboard.LShift+F2
After that it works again with the old command
"C:\Program Files (x86)\EventGhost\eventghost.exe" -e Keyboard.LShift+F2
Thanks for the help.
Keyboard.LShift+F2
to
Main.Keyboard.LShift+F2
After that it works again with the old command
"C:\Program Files (x86)\EventGhost\eventghost.exe" -e Keyboard.LShift+F2
Thanks for the help.

Re: Command line events
Good.
Looks like it is a bug in the new versions and will probably be fixed later, but for now that seems to be the way to fix it.
jonib
- kgschlosser
- Site Admin
- Posts: 5508
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Command line events
if you want to you can replace program files (x86)\eventghost\eg\Cli.py with the file that is attached. this is get rid of the "Main" prefix only if you are triggering an event that has a "." in it. otherwise it will add the "Main" to it.
- Attachments
-
- Cli.py
- (6.24 KiB) Downloaded 79 times
Re: Command line events
So trying the "Cli.py" on EG rc6 I got this error and EventGhost didn't' start:
jonib
Code: Select all
Traceback (most recent call last):
File "EventGhost.pyw", line 53, in <module>
File "D:\Program\Util\EventGhost\eg\__init__.py", line 31, in <module>
import Cli
File "D:\Program\Util\EventGhost\eg\Cli.py", line 30, in <module>
from NamedPipe import is_eg_running
ImportError: No module named NamedPipe
- kgschlosser
- Site Admin
- Posts: 5508
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Command line events
That would figure I grabbed the wrong Cli.py file to edit.
- kgschlosser
- Site Admin
- Posts: 5508
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Command line events
That would figure I grabbed the wrong Cli.py file to edit.