Help me Obi Wan......

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
Speshal
Posts: 8
Joined: Wed May 28, 2014 2:38 pm

Help me Obi Wan......

Post by Speshal » Wed May 28, 2014 3:08 pm

First off a big hello there, and please excuse me I am a n00b to all of this :D

Let me explain my problem and I really hope you guys can help, essentially I want to trigger an EG macro from a VB script using the sendkeys method.

I've got EG set up so that when I press the physical keys on the keyboard the desired action happens but I get nothing when I try it via sendkeys. (I don't speak python :( )

I'm using EG to send to WINLirc that then goes to an Iguanaworks IR transmitter

I've attached a picture to help explain. E.g. to mute the TV, I press Ctrl and F1 an this works fine from my physical keyboard but not when I trigger this script...

Code: Select all

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys ("%{F1}")
Do I need another plugin? if so which one?

Image

I searched high and low through the forum and found this post - viewtopic.php?f=9&t=5339&p=25842&hilit=sendkeys#p25842

Which led me to this post viewtopic.php?f=10&t=1322&p=7747&hilit= ... asic#p7747 which may as well be in Greek to me lol

This is the only thing holding up my project and I really hope you guys can help, point me in the right direction or chuck me a python script that an idiot could modify :)

Thanks in advance :D

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

Re: Help me Obi Wan......

Post by jonib » Wed May 28, 2014 5:10 pm

I think the easiest way is to use the EventGhost commandline option"-event". Sending a key is probably not the way to send an event to EventGhost.
If you want a more direct way look at the Broadcast plugin.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

Speshal
Posts: 8
Joined: Wed May 28, 2014 2:38 pm

Re: Help me Obi Wan......

Post by Speshal » Wed May 28, 2014 6:01 pm

Thanks for that :)

How would I phrase a command line event then?

Code: Select all

D:\EventGhost\EventGhost.exe -event (what to put here? this is the bit I get stuck at)

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

Re: Help me Obi Wan......

Post by jonib » Wed May 28, 2014 7:44 pm

Speshal wrote:How would I phrase a command line event then?
You can put almost anything and it becomes the event so..

This command will:

Code: Select all

EventGhost.exe -e eventname
Create this event:

Code: Select all

Main.eventname
If you put a space after eventname anything after will be put in the event payload.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

Speshal
Posts: 8
Joined: Wed May 28, 2014 2:38 pm

Re: Help me Obi Wan......

Post by Speshal » Wed May 28, 2014 8:53 pm

Thanks very much, it's all working now and aside from having a cmd prompt on my screen momentarily (doesn't matter as the control PC won't have a monitor anyway) I now have voice control over my TV :D

Post Reply