eatmeimadanish wrote:The HDMI CEC adapter from either pulse 8 or RCAware will tell you when a device comes on, and let you query a device status.
yup... but not worth spending $50 for me. When they are $20, I'm in.
eatmeimadanish wrote:The HDMI CEC adapter from either pulse 8 or RCAware will tell you when a device comes on, and let you query a device status.
snack wrote:My Vizio 47" TV that is connected to the computer via HDMI gives this event when I turn on the TV:
System.DeviceRemoved [u'\\\\?\\DISPLAY#VIZ0033#4&1117d43&0&UID52628224#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}']
System.DeviceAttached [u'\\\\?\\DISPLAY#VIZ0033#4&1117d43&0&UID52628224#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}']
Can EventGhost trigger on this so I can run a batch file to kill an app and restart it? This particular app is configured to run on the secondary monitor (TV). When the TV is powered off, it stays on the secondary monitor. When I power back on, the app reappears on my main monitor.
snack wrote:I read the wikis before I posted. I do not find anything about System.DeviceAttached. I know how to create an event for it. What I am requesting is to specify the string the follows the System.DeviceAttached so the event is activated on that particular device being attached. Without this parameter, then many devices (e.g. USB flash drive) will activate the event.
You need to read the "eg.event.payload" variable to get to the extra data in the event.snack wrote:I played with EventGhost before posting, and it does not specifying a parameter for System.DeviceAttached.

Livin wrote:You are missing the point... Drag and drop the event from the log to the macro. Forget about creating anything.
from threading import Thread, Event
from win32api import EnumDisplayMonitors
class MyThread(Thread):
def __init__(self):
Thread.__init__(self, name = 'CheckTV_Thread')
self.event = Event()
self.tv = False
def run(self):
while True:
mons = EnumDisplayMonitors()
if len(mons) > 1:
if not self.tv:
self.tv = True
print "TV Connected"
eg.TriggerEvent("Connected", prefix = "TV")
else:
if self.tv:
self.tv = False
print "TV Not Connected"
eg.TriggerEvent("Disconnected", prefix = "TV")
self.event.wait(5)
self.event.clear()
mt = MyThread()
mt.start()device = 'DISPLAY#VIZ0033#4&1117d43&0&UID52628224#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}'
eg.event.payload_copy = eg.event.payload
eg.event.suffix_copy = eg.event.suffix
if eg.event.payload_copy.find(device) != -1:
if eg.event.suffix_copy.find('Removed') != -1:
eg.TriggerEvent('Removed', prefix = 'My_Vizio_47')
if eg.event.suffix_copy.find('Attached') != -1:
eg.TriggerEvent('Attached', prefix = 'My_Vizio_47')
Livin wrote: (I'm sure it works, just want to see if there is a functional difference)
Users browsing this forum: No registered users and 1 guest