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.

Latent command?

If you have a question or need help, this is the place to be.
Post Reply
eli2k
Posts: 26
Joined: Mon Jun 29, 2009 10:34 pm

Latent command?

Post by eli2k »

I was looking through EventGhost log to figure out what happened when a system I set up did not properly wake up at the specified time. Below is the log. Computer was placed on Stand By at 10:32pm. At 9:27am the computer resumed on its own, but then the Stand By command was immediately issued afterwards. I use the power button on the computer itself to turn it on (haven't figured out how to turn it on with the remote yet), but use the Power button on an MCE remote to place it on standby. Was the stand by command at 9:27am from the previous night? How can I prevent this from happening in the future?

Thanks,
- Eli

Code: Select all

10:32:22 PM   MceRemote.Power
10:32:22 PM      Power -> Alt+F4
10:32:22 PM         Stand By
10:32:22 PM   System.QuerySuspend
10:32:22 PM   System.Suspend
9:27:16 AM   System.ResumeAutomatic
9:27:16 AM   MceRemote.Power
9:27:16 AM      Power -> Alt+F4
9:27:16 AM         Stand By
9:27:16 AM   System.QuerySuspend
9:27:32 AM   System.Suspend
12:33:56 PM   System.ResumeAutomatic
12:33:56 PM   System.Resume
12:34:56 PM   System.Idle
1:55:52 PM   System.UnIdle
setup: windows 7 + EventGhost 0.5.0-rc4 + Intel nuc6i5syh
User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: Latent command?

Post by jinxdone »

Looks like it. You could try using the "Clear pending events" action as the first thing when EG resumes, it should take care of that..
eli2k
Posts: 26
Joined: Mon Jun 29, 2009 10:34 pm

Re: Latent command?

Post by eli2k »

Thanks. I'm not sure where I would place that command. The "Clear pending events" action you mention says it should be placed at the end of the macro. I was testing it out, and I put this action right before the actual action I want (which is put the computer into Standby). I tested with the following code below (have to test with keyboard since I don't have access to a remote right now), which seemed to work properly. I added the 1.0s wait time so that the user has time to stop pressing the button, executes the action, and then I guess Clear Pending Events gets rid of everything else. Is this a reasonable approach?

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1076">
    <Macro Name="Foobar2000: Volume Mute" Expanded="True">
        <Event Name="Keyboard.Oem3" />
        <Action>
            EventGhost.ShowOSD(u'Muting', u'0;-24;0;0;0;700;0;0;0;1;0;0;2;32;Arial', (255, 255, 255), (0, 0, 0), 0, (50, 50), 0, 3.0, True)
        </Action>
        <Action>
            EventGhost.Wait(1.0)
        </Action>
        <Action>
            EventGhost.FlushEvents()
        </Action>
        <Action>
            Foobar2000.VolumeMute()
        </Action>
    </Macro>
</EventGhost>
setup: windows 7 + EventGhost 0.5.0-rc4 + Intel nuc6i5syh
User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: Latent command?

Post by jinxdone »

Yep, sounds like it should do the trick. I was somehow thinking about running it as the first action after resume, but it might be better to run it just before. Perhaps you could make a new macro for the clear pending events action and trigger it with the System.Suspend event?

Either way the idea is to clear the events so they don't get executed later after the resume.
eli2k
Posts: 26
Joined: Mon Jun 29, 2009 10:34 pm

Re: Latent command?

Post by eli2k »

Good idea. I forgot I can use trigger events, such as System.Suspend or System.Resume. I guess I can add them, for redundancy, just in case :)
setup: windows 7 + EventGhost 0.5.0-rc4 + Intel nuc6i5syh
Post Reply