Command line events

If you have a question or need help, this is the place to be.
Post Reply
ralphberner
Posts: 7
Joined: Mon Jun 03, 2019 7:18 am

Command line events

Post by ralphberner » Sun Aug 25, 2019 6:30 am

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?

jonib
Plugin Developer
Posts: 1318
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Command line events

Post by jonib » Thu Aug 29, 2019 2:55 pm

ralphberner wrote:
Sun Aug 25, 2019 6:30 am
Any ideas about this?
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
XBMC2 plugin to control XBMC. If you want to flatter me Image

ralphberner
Posts: 7
Joined: Mon Jun 03, 2019 7:18 am

Re: Command line events

Post by ralphberner » Thu Aug 29, 2019 4:57 pm

Thanks for the hint. But i couldn't get it run.

jonib
Plugin Developer
Posts: 1318
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Command line events

Post by jonib » Thu Aug 29, 2019 9:46 pm

ralphberner wrote:
Thu Aug 29, 2019 4:57 pm
Thanks for the hint. But i couldn't get it run.
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
XBMC2 plugin to control XBMC. If you want to flatter me Image

ralphberner
Posts: 7
Joined: Mon Jun 03, 2019 7:18 am

Re: Command line events

Post by ralphberner » Sat Aug 31, 2019 6:51 am

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:
Image
https://pasteboard.co/IvcAF9R.bmp
EvnetGhost Version 0.5.0.-rc6 (2018-12-24)
Windows 10 Pro X64

jonib
Plugin Developer
Posts: 1318
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Command line events

Post by jonib » Sat Aug 31, 2019 3:02 pm

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
XBMC2 plugin to control XBMC. If you want to flatter me Image

jonib
Plugin Developer
Posts: 1318
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Command line events

Post by jonib » Sat Aug 31, 2019 4:15 pm

Response to the issue:
DanEdens wrote:You can get around this by using the wildcards * and ? in your trigger.

For example:

*.LShift+f2
jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

ralphberner
Posts: 7
Joined: Mon Jun 03, 2019 7:18 am

Re: Command line events

Post by ralphberner » Thu Sep 05, 2019 2:56 pm

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. :D

jonib
Plugin Developer
Posts: 1318
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Command line events

Post by jonib » Thu Sep 05, 2019 3:51 pm

ralphberner wrote:
Thu Sep 05, 2019 2:56 pm
After that it works again with the old command
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
XBMC2 plugin to control XBMC. If you want to flatter me Image

User avatar
kgschlosser
Site Admin
Posts: 4938
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Command line events

Post by kgschlosser » Sun Sep 08, 2019 7:39 am

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 12 times
If you like the work I have been doing then feel free to Image

jonib
Plugin Developer
Posts: 1318
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Command line events

Post by jonib » Sun Sep 08, 2019 7:26 pm

So trying the "Cli.py" on EG rc6 I got this error and EventGhost didn't' start:

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
jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

User avatar
kgschlosser
Site Admin
Posts: 4938
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Command line events

Post by kgschlosser » Mon Sep 09, 2019 12:27 am

That would figure I grabbed the wrong Cli.py file to edit.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4938
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Command line events

Post by kgschlosser » Mon Sep 09, 2019 12:27 am

That would figure I grabbed the wrong Cli.py file to edit.
If you like the work I have been doing then feel free to Image

Post Reply