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.

Techniques: controlling multiple programs

If you have a question or need help, this is the place to be.
User avatar
WharfRat
Experienced User
Posts: 159
Joined: Wed Dec 25, 2013 11:56 am

Re: Techniques: controlling multiple programs

Post by WharfRat »

blaher...

I see that you have referred to Technique 2 as tree2.xml in your post. Did you have the same experience as Ron The Don with copying the code? I am new to EventGhost and the forums, so I might need some help with posting things properly.
EventGhost 0.4.1.r1640
PHX01RN plugin v3.0.1
Windows XP 32bit (v5.1 Build 2600 Service Pack 2)
Windows7 64bit (v6.1 Build 7601 Service Pack 1)
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: Techniques: controlling multiple programs

Post by blaher »

WharfRat wrote:blaher...

I see that you have referred to Technique 2 as tree2.xml in your post. Did you have the same experience as Ron The Don with copying the code? I am new to EventGhost and the forums, so I might need some help with posting things properly.
I can never seem to copy and paste stuff that I see posted here. I've tried dragging, right click copying & pasting, choosing edit then copying & pasting, and nothing works; only opening .xml files works.

Your examples are really good if people bother to open the .xml files though.
User avatar
WharfRat
Experienced User
Posts: 159
Joined: Wed Dec 25, 2013 11:56 am

Re: Techniques: controlling multiple programs

Post by WharfRat »

blaher...
I can never seem to copy and paste stuff that I see posted here.
Well... in that case, I will always put things in an archive as well.

EDIT: archive is now in the first post
Last edited by WharfRat on Wed Feb 12, 2014 1:28 pm, edited 2 times in total.
EventGhost 0.4.1.r1640
PHX01RN plugin v3.0.1
Windows XP 32bit (v5.1 Build 2600 Service Pack 2)
Windows7 64bit (v6.1 Build 7601 Service Pack 1)
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: Techniques: controlling multiple programs

Post by blaher »

WharfRat wrote:blaher...
Well... in that case, I will always put things in an archive as well.
I suggest adding it to the top of your very first post.
User avatar
WharfRat
Experienced User
Posts: 159
Joined: Wed Dec 25, 2013 11:56 am

Re: Techniques: controlling multiple programs

Post by WharfRat »

Done
EventGhost 0.4.1.r1640
PHX01RN plugin v3.0.1
Windows XP 32bit (v5.1 Build 2600 Service Pack 2)
Windows7 64bit (v6.1 Build 7601 Service Pack 1)
User avatar
WharfRat
Experienced User
Posts: 159
Joined: Wed Dec 25, 2013 11:56 am

Re: Techniques: controlling multiple programs

Post by WharfRat »

I just want to clarify the configuration that themaster1 uses.

When you look at it closely (if you are able to), it is actually technique 2 with the technique 4 variation applied to it.
EventGhost 0.4.1.r1640
PHX01RN plugin v3.0.1
Windows XP 32bit (v5.1 Build 2600 Service Pack 2)
Windows7 64bit (v6.1 Build 7601 Service Pack 1)
User avatar
WharfRat
Experienced User
Posts: 159
Joined: Wed Dec 25, 2013 11:56 am

Re: Techniques: controlling multiple programs

Post by WharfRat »

Earlier I said:
There are many solutions.
One is to use more context folders.
Another is the new technique 2 method, which explicitly enables and disables a folder containing the menu commands.
This is what I meant about using more context folders:
(t_cmp_2b.xml)

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1640" Guid="{7FAC2C68-CAEF-433C-B485-32A62ECE2D4D}" Time="1392181954.05">
    <Autostart Name="Autostart" Expanded="True">
        <Plugin Identifier="DesktopRemote" Guid="{5DFFBD61-7582-4D6F-8EA9-9CB36284C9CF}" File="DesktopRemote">
            gAIpLg==
        </Plugin>
        <Plugin Identifier="OSM" Guid="{FCF3C7A7-FBC1-444D-B768-9477521946DC}" File="OSM">
            gAIpLg==
        </Plugin>
    </Autostart>
    <Folder Name="not important">
        <Folder Name="generic remote">
            <Macro Name="show">
                <Event Name="Main.OnInit" />
                <Action>
                    DesktopRemote.CreateNew(40, 40, 3, 3, 4, (108, 108, 108), (255, 255, 255), (78, 78, 78), u'0;-13;0;0;0;700;0;0;0;0;3;2;1;34;Arial', u'remote', 1, True, True, True)
                </Action>
                <Action>
                    DesktopRemote.AddButton({'invisible': True, 'width': 183, 'height': 5, 'event': u'', 'label': u'increase width of remote'})
                </Action>
                <Action>
                    DesktopRemote.StartNewLine(0)
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 0, 0), 'fontInfo': u'0;-19;0;0;0;400;0;0;0;2;3;2;1;2;Wingdings', 'event': u'generic.Power', 'label': u'\xa1'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'invisible': True, 'event': u'', 'label': u''})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'invisible': True, 'event': u'', 'label': u''})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (0, 200, 200), 'foregroundColour': (0, 0, 0), 'event': u'generic.Function', 'label': u'Fn'})
                </Action>
                <Action>
                    DesktopRemote.StartNewLine(25)
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'label': u'/', 'foregroundColour': (0, 0, 0), 'event': u'generic.Documents', 'fontInfo': u'0;-16;0;0;0;400;0;0;0;2;3;2;1;18;Wingdings 2'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'label': u'\xaf', 'foregroundColour': (0, 0, 0), 'event': u'generic.Music', 'fontInfo': u'0;-16;0;0;0;400;0;0;0;2;3;2;1;18;Webdings'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'label': u'J', 'foregroundColour': (0, 0, 0), 'event': u'generic.Pictures', 'fontInfo': u'0;-16;0;0;0;400;0;0;0;2;3;2;1;2;Wingdings'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'label': u'\xb9', 'foregroundColour': (0, 0, 0), 'event': u'generic.Videos', 'fontInfo': u'0;-16;0;0;0;400;0;0;0;2;3;2;1;18;Webdings'})
                </Action>
                <Action>
                    DesktopRemote.StartNewLine(5)
                </Action>
                <Action>
                    DesktopRemote.AddButton({'fontInfo': u'0;-16;0;0;0;700;0;0;0;2;3;2;1;18;Wingdings 3', 'event': u'generic.Cancel', 'label': u':'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'fontInfo': u'0;-16;0;0;0;400;0;0;0;2;3;2;1;18;Webdings', 'event': u'generic.Minimize', 'label': u'0'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'fontInfo': u'0;-16;0;0;0;400;0;0;0;2;3;2;1;18;Webdings', 'event': u'generic.Maximize', 'label': u'1'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'fontInfo': u'0;-13;0;0;0;700;0;0;0;0;3;2;1;34;Arial', 'event': u'generic.Info', 'label': u'i'})
                </Action>
                <Action>
                    DesktopRemote.StartNewLine(15)
                </Action>
                <Action>
                    DesktopRemote.AddButton({'label': u'L', 'event': u'generic.LeftClick', 'fontInfo': u'0;-13;0;0;0;700;0;0;0;0;3;2;1;34;Arial'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'invisible': True, 'event': u'', 'label': u''})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'invisible': True, 'event': u'', 'label': u''})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'label': u'R', 'event': u'generic.RightClick', 'fontInfo': u'0;-13;0;0;0;700;0;0;0;0;3;2;1;34;Arial'})
                </Action>
                <Action>
                    DesktopRemote.StartNewLine(0)
                </Action>
                <Action>
                    DesktopRemote.AddButton({'invisible': True, 'event': u'', 'label': u''})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'invisible': True, 'width': 18, 'event': u'', 'label': u''})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'label': u'\xe3', 'foregroundColour': (0, 0, 0), 'event': u'generic.Up', 'fontInfo': u'0;-13;0;0;0;400;0;0;0;2;3;2;1;18;Wingdings 3'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'invisible': True, 'width': 19, 'event': u'', 'label': u''})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'invisible': True, 'event': u'', 'label': u''})
                </Action>
                <Action>
                    DesktopRemote.StartNewLine(0)
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'label': u'\xe1', 'foregroundColour': (0, 0, 0), 'event': u'generic.Left', 'fontInfo': u'0;-13;0;0;0;400;0;0;0;2;3;2;1;18;Wingdings 3'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'label': u'8', 'event': u'generic.OK', 'fontInfo': u'0;-16;0;0;0;700;0;0;0;2;3;2;1;18;Wingdings 3'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'label': u'\xe2', 'foregroundColour': (0, 0, 0), 'event': u'generic.Right', 'fontInfo': u'0;-13;0;0;0;400;0;0;0;2;3;2;1;18;Wingdings 3'})
                </Action>
                <Action>
                    DesktopRemote.StartNewLine(0)
                </Action>
                <Action>
                    DesktopRemote.AddButton({'invisible': True, 'event': u'', 'label': u''})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'invisible': True, 'width': 18, 'event': u'', 'label': u''})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'label': u'\xe4', 'foregroundColour': (0, 0, 0), 'event': u'generic.Down', 'fontInfo': u'0;-13;0;0;0;400;0;0;0;2;3;2;1;18;Wingdings 3'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'invisible': True, 'width': 19, 'event': u'', 'label': u''})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'invisible': True, 'event': u'', 'label': u''})
                </Action>
                <Action>
                    DesktopRemote.StartNewLine(15)
                </Action>
                <Action>
                    DesktopRemote.AddButton({'fontInfo': u'0;-15;0;0;0;400;0;0;0;2;3;2;1;18;Webdings', 'event': u'generic.Stop', 'label': u'<'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'fontInfo': u'0;-15;0;0;0;400;0;0;0;2;3;2;1;18;Webdings', 'event': u'generic.Play', 'label': u'4'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'foregroundColour': (255, 0, 0), 'fontInfo': u'0;-15;0;0;0;400;0;0;0;2;3;2;1;18;Webdings', 'event': u'generic.Record', 'label': u'='})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'fontInfo': u'0;-15;0;0;0;400;0;0;0;2;3;2;1;18;Webdings', 'event': u'generic.Pause', 'label': u';'})
                </Action>
                <Action>
                    DesktopRemote.StartNewLine(0)
                </Action>
                <Action>
                    DesktopRemote.AddButton({'fontInfo': u'0;-15;0;0;0;400;0;0;0;2;3;2;1;18;Webdings', 'event': u'generic.Previous', 'label': u'9'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'fontInfo': u'0;-15;0;0;0;400;0;0;0;2;3;2;1;18;Webdings', 'event': u'generic.Rewind', 'label': u'7'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'fontInfo': u'0;-15;0;0;0;400;0;0;0;2;3;2;1;18;Webdings', 'event': u'generic.FastForward', 'label': u'8'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'fontInfo': u'0;-15;0;0;0;400;0;0;0;2;3;2;1;18;Webdings', 'event': u'generic.Next', 'label': u':'})
                </Action>
                <Action>
                    DesktopRemote.StartNewLine(0)
                </Action>
                <Action>
                    DesktopRemote.AddButton({'invisible': True, 'event': u'', 'label': u''})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'invisible': True, 'event': u'', 'label': u''})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'invisible': True, 'event': u'', 'label': u''})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'fontInfo': u'0;-16;0;0;0;400;0;0;0;2;3;2;1;18;Webdings', 'event': u'generic.Mute', 'label': u'X'})
                </Action>
                <Action>
                    DesktopRemote.StartNewLine(0)
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'foregroundColour': (0, 0, 0), 'event': u'generic.1', 'label': u'1'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'foregroundColour': (0, 0, 0), 'event': u'generic.2', 'label': u'2'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'foregroundColour': (0, 0, 0), 'event': u'generic.3', 'label': u'3'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'label': u'5', 'foregroundColour': (0, 0, 0), 'event': u'generic.Increase', 'fontInfo': u'0;-16;0;0;0;400;0;0;0;2;3;2;1;18;Webdings'})
                </Action>
                <Action>
                    DesktopRemote.StartNewLine(0)
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'foregroundColour': (0, 0, 0), 'event': u'generic.4', 'label': u'4'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'foregroundColour': (0, 0, 0), 'event': u'generic.5', 'label': u'5'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'foregroundColour': (0, 0, 0), 'event': u'generic.6', 'label': u'6'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'label': u'6', 'foregroundColour': (0, 0, 0), 'event': u'generic.Decrease', 'fontInfo': u'0;-16;0;0;0;400;0;0;0;2;3;2;1;18;Webdings'})
                </Action>
                <Action>
                    DesktopRemote.StartNewLine(0)
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'foregroundColour': (0, 0, 0), 'event': u'generic.7', 'label': u'7'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'foregroundColour': (0, 0, 0), 'event': u'generic.8', 'label': u'8'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'foregroundColour': (0, 0, 0), 'event': u'generic.9', 'label': u'9'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'label': u'+', 'foregroundColour': (0, 0, 0), 'event': u'generic.Plus', 'fontInfo': u'0;-16;0;0;0;700;0;0;0;0;3;2;1;34;Arial'})
                </Action>
                <Action>
                    DesktopRemote.StartNewLine(0)
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'foregroundColour': (0, 0, 0), 'fontInfo': u'0;-16;0;0;0;700;0;0;0;2;3;2;1;18;Wingdings 2', 'event': u'generic.Star', 'label': u'\xd4'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'foregroundColour': (0, 0, 0), 'event': u'generic.0', 'label': u'0'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'foregroundColour': (0, 0, 0), 'fontInfo': u'0;-16;0;0;0;700;0;0;0;0;3;2;1;34;Arial', 'event': u'generic.Hash', 'label': u'#'})
                </Action>
                <Action>
                    DesktopRemote.AddButton({'backgroundColour': (200, 200, 200), 'label': u'-', 'foregroundColour': (0, 0, 0), 'event': u'generic.Minus', 'fontInfo': u'0;-19;0;0;0;700;0;0;0;0;3;2;1;34;Arial'})
                </Action>
                <Action>
                    DesktopRemote.StartNewLine(0)
                </Action>
                <Action>
                    DesktopRemote.Show(10, 10, True)
                </Action>
                <Action>
                    EventGhost.TriggerEvent(u'check_for_remote', 0.0)
                </Action>
            </Macro>
        </Folder>
        <Folder Name="log pane">
            <Macro Name="check for remote">
                <Event Name="Main.check_for_remote" />
                <Action>
                    Window.FindWindow(None, u'remote', u'wxWindowClassNR', None, None, 1, False, 0.0, 2)
                </Action>
                <Action>
                    EventGhost.NewJumpIf(XmlIdLink(91), 1, False)
                </Action>
                <Action>
                    EventGhost.TriggerEvent(u'setup_log_pane', 0.0)
                </Action>
            </Macro>
            <Macro Name="wait for remote" id="91">
                <Action>
                    EventGhost.Wait(0.25)
                </Action>
                <Action>
                    EventGhost.TriggerEvent(u'check_for_remote', 0.0)
                </Action>
            </Macro>
            <Macro Name="setup log pane">
                <Event Name="Main.setup_log_pane" />
                <Action>
                    EventGhost.PythonScript(u'eg.Wait(0.5)\neg.log.ctrl.data.clear()\neg.Wait(0.25)\nprint "Technique 2b"\nprint ""\nprint "select the mode with this button:"\nprint "   Function (blue Fn)"\nprint "navigate the menu with these buttons:"\nprint "   up down"\nprint "   OK (black down-and-left)"\nprint "   Cancel (black up-and-left)"\nprint ""\nprint "system mode buttons:"\nprint "   Info (black i)"\nprint ""\nprint "mouse mode buttons:"\nprint "   L R up down left right"\nprint ""\nprint "Notepad mode buttons:"\nprint "   Power (red O)"\nprint ""\nprint "Calculator mode buttons:"\nprint "   Power (red O)"\nprint ""')
                </Action>
            </Macro>
        </Folder>
    </Folder>
    <Macro Name="Init" Expanded="True">
        <Event Name="Main.OnInit" />
        <Action>
            EventGhost.EnableExclusive(XmlIdLink(118))
        </Action>
    </Macro>
    <Folder Name="modes" Expanded="True">
        <Folder Name="select" Expanded="True">
            <Macro Name="select menu">
                <Event Name="DesktopRemote.generic.Function" />
                <Action>
                    EventGhost.EnableExclusive(XmlIdLink(102))
                </Action>
                <Action>
                    EventGhost.TriggerEvent(u'ShowMenu', 0.0)
                </Action>
            </Macro>
            <Macro Name="select none">
                <Event Name="OSM.modes.none" />
                <Action>
                    EventGhost.ShowOSD(u'none', u'0;-128;0;0;0;700;0;0;0;255;1;2;1;49;Terminal', (0, 255, 0), (0, 128, 0), 6, (0, 0), 0, 3.0, False)
                </Action>
                <Action>
                    EventGhost.EnableExclusive(XmlIdLink(118))
                </Action>
            </Macro>
            <Macro Name="select system">
                <Event Name="OSM.modes.system" />
                <Action>
                    EventGhost.ShowOSD(u'system', u'0;-128;0;0;0;700;0;0;0;255;1;2;1;49;Terminal', (0, 255, 0), (0, 128, 0), 6, (0, 0), 0, 3.0, False)
                </Action>
                <Action>
                    EventGhost.EnableExclusive(XmlIdLink(119))
                </Action>
            </Macro>
            <Macro Name="select mouse">
                <Event Name="OSM.modes.mouse" />
                <Action>
                    EventGhost.ShowOSD(u'mouse', u'0;-128;0;0;0;700;0;0;0;255;1;2;1;49;Terminal', (0, 255, 0), (0, 128, 0), 6, (0, 0), 0, 3.0, False)
                </Action>
                <Action>
                    EventGhost.EnableExclusive(XmlIdLink(124))
                </Action>
            </Macro>
            <Macro Name="select Notepad">
                <Event Name="OSM.modes.Notepad" />
                <Action>
                    EventGhost.ShowOSD(u'Notepad', u'0;-128;0;0;0;700;0;0;0;255;1;2;1;49;Terminal', (0, 255, 0), (0, 128, 0), 6, (0, 0), 0, 3.0, False)
                </Action>
                <Action>
                    EventGhost.EnableExclusive(XmlIdLink(143))
                </Action>
            </Macro>
            <Macro Name="select Calculator">
                <Event Name="OSM.modes.Calculator" />
                <Action>
                    EventGhost.ShowOSD(u'Calculator', u'0;-128;0;0;0;700;0;0;0;255;1;2;1;49;Terminal', (0, 255, 0), (0, 128, 0), 6, (0, 0), 0, 3.0, False)
                </Action>
                <Action>
                    EventGhost.EnableExclusive(XmlIdLink(156))
                </Action>
            </Macro>
        </Folder>
        <Folder Name="mode" Expanded="True">
            <Folder Name="mode menu" id="102" Enabled="False">
                <Macro Name="Show menu">
                    <Event Name="Main.ShowMenu" />
                    <Action Name="OS Menu: modes">
                        OSM.ShowMenu([(u'none', u'none'), (u'system', u'system'), (u'mouse', u'mouse'), (u'Notepad', u'Notepad'), (u'Calculator', u'Calculator')], (75, 75, 75), (180, 180, 180), u'0;-48;0;0;0;400;0;0;0;0;0;0;0;0;MS Shell Dlg 2', u'OSM.modes', 0, 0, (180, 180, 180), (75, 75, 75), False, False)
                    </Action>
                </Macro>
                <Macro Name="Cursor Up">
                    <Event Name="DesktopRemote.generic.Up" />
                    <Action>
                        OSM.MoveUp()
                    </Action>
                </Macro>
                <Macro Name="Cursor Down">
                    <Event Name="DesktopRemote.generic.Down" />
                    <Action>
                        OSM.MoveDown()
                    </Action>
                </Macro>
                <Macro Name="OK">
                    <Event Name="DesktopRemote.generic.OK" />
                    <Action>
                        OSM.OK_Btn()
                    </Action>
                </Macro>
                <Macro Name="Cancel">
                    <Event Name="DesktopRemote.generic.Cancel" />
                    <Action>
                        OSM.Cancel_Btn()
                    </Action>
                </Macro>
            </Folder>
            <Folder Name="mode none" id="118" />
            <Folder Name="mode system" id="119" Enabled="False">
                <Macro Name="time">
                    <Event Name="DesktopRemote.generic.Info" />
                    <Action>
                        EventGhost.PythonScript(u"import time\nt = time.localtime()\neg.result = '% 2i' %t.tm_hour + ':' + '%02i' %t.tm_min")
                    </Action>
                    <Action>
                        EventGhost.ShowOSD(u'{eg.result}', u'0;-128;0;0;0;700;0;0;0;255;1;2;1;49;Terminal', (0, 255, 0), (0, 128, 0), 0, (80, 40), 0, 3.0, False)
                    </Action>
                </Macro>
            </Folder>
            <Folder Name="mode mouse" id="124" Enabled="False">
                <Macro Name="Mouse Move Up">
                    <Event Name="DesktopRemote.generic.Up" />
                    <Action>
                        Mouse.GoDirection(0)
                    </Action>
                </Macro>
                <Macro Name="Mouse Move Down">
                    <Event Name="DesktopRemote.generic.Down" />
                    <Action>
                        Mouse.GoDirection(u'180')
                    </Action>
                </Macro>
                <Macro Name="Mouse Move Left">
                    <Event Name="DesktopRemote.generic.Left" />
                    <Action>
                        Mouse.GoDirection(270)
                    </Action>
                </Macro>
                <Macro Name="Mouse Move Right">
                    <Event Name="DesktopRemote.generic.Right" />
                    <Action>
                        Mouse.GoDirection(90)
                    </Action>
                </Macro>
                <Macro Name="Left Mouse Button">
                    <Event Name="DesktopRemote.generic.LeftClick" />
                    <Action>
                        Mouse.LeftButton()
                    </Action>
                </Macro>
                <Macro Name="Right Mouse Button">
                    <Event Name="DesktopRemote.generic.RightClick" />
                    <Action>
                        Mouse.RightButton()
                    </Action>
                </Macro>
            </Folder>
            <Folder Name="mode Notepad" id="143" Enabled="False">
                <Folder Name="power">
                    <Macro Name="power">
                        <Event Name="DesktopRemote.generic.Power" />
                        <Action>
                            Window.FindWindow(u'notepad.exe', None, None, None, None, None, False, 0.0, 2)
                        </Action>
                        <Action>
                            EventGhost.NewJumpIf(XmlIdLink(150), 1, False)
                        </Action>
                        <Action>
                            EventGhost.NewJumpIf(XmlIdLink(152), 2, False)
                        </Action>
                    </Macro>
                    <Macro Name="start program" id="150">
                        <Action>
                            System.Execute(u'C:\\WINDOWS\\NOTEPAD.EXE', u'', 0, False, 2, u'', False)
                        </Action>
                    </Macro>
                    <Macro Name="stop program" id="152">
                        <Action>
                            Window.FindWindow(u'notepad.exe', None, None, None, None, None, False, 0.0, 2)
                        </Action>
                        <Action>
                            Window.BringToFront()
                        </Action>
                        <Action>
                            Window.Close()
                        </Action>
                    </Macro>
                </Folder>
            </Folder>
            <Folder Name="mode Calculator" id="156" Enabled="False">
                <Folder Name="power">
                    <Macro Name="power">
                        <Event Name="DesktopRemote.generic.Power" />
                        <Action>
                            Window.FindWindow(u'calc.exe', None, None, None, None, None, False, 0.0, 2)
                        </Action>
                        <Action>
                            EventGhost.NewJumpIf(XmlIdLink(163), 1, False)
                        </Action>
                        <Action>
                            EventGhost.NewJumpIf(XmlIdLink(165), 2, False)
                        </Action>
                    </Macro>
                    <Macro Name="start program" id="163">
                        <Action>
                            System.Execute(u'C:\\WINDOWS\\system32\\calc.exe', u'', 0, False, 2, u'', False)
                        </Action>
                    </Macro>
                    <Macro Name="stop program" id="165">
                        <Action>
                            Window.FindWindow(u'calc.exe', None, None, None, None, None, False, 0.0, 2)
                        </Action>
                        <Action>
                            Window.BringToFront()
                        </Action>
                        <Action>
                            Window.Close()
                        </Action>
                    </Macro>
                </Folder>
            </Folder>
        </Folder>
    </Folder>
</EventGhost>
t_cmp_2b.zip
t_cmp_2b.xml
(2.76 KiB) Downloaded 122 times
Last edited by WharfRat on Wed Feb 12, 2014 8:49 pm, edited 1 time in total.
EventGhost 0.4.1.r1640
PHX01RN plugin v3.0.1
Windows XP 32bit (v5.1 Build 2600 Service Pack 2)
Windows7 64bit (v6.1 Build 7601 Service Pack 1)
User avatar
WharfRat
Experienced User
Posts: 159
Joined: Wed Dec 25, 2013 11:56 am

Re: Techniques: controlling multiple programs

Post by WharfRat »

:oops: :oops: How embarassing, again...

They don't have a smiley icon with a foot in the mouth, so I was awarded a double embarasser instead.

In the first embarassment:
So I quickly set that one up with the menus and added keyboard navigation keys to the menu control for good measure.
Okay, I must admit that I don't know very much about the On Screen Menu, or even anything else.
The On Screen Menu automatically responds to keyboard keys already, so keyboard events must not be added to the menu control actions.
If you do, then the menu control actions are triggered twice, which is why I thought I needed to make my menu control more robust.

So, the original technique 2 was fine, and it is now included in the archive in the first post again.
The later versions of technique 2 are in separate archives in their respective posts.

It seems like we need a separate Techniques: On Screen Menu
Last edited by WharfRat on Wed Feb 12, 2014 8:50 pm, edited 1 time in total.
EventGhost 0.4.1.r1640
PHX01RN plugin v3.0.1
Windows XP 32bit (v5.1 Build 2600 Service Pack 2)
Windows7 64bit (v6.1 Build 7601 Service Pack 1)
User avatar
WharfRat
Experienced User
Posts: 159
Joined: Wed Dec 25, 2013 11:56 am

Re: Techniques: controlling multiple programs

Post by WharfRat »

themaster1 asked:
I fail to see the benefit of your config compared to mine see here perhaps you can enlighten me
I have found one benefit that the original version of technique 2 has.
If you cancel the menu, then you will remain in the previous context.
You can test this by comparing t_cmp_2.xml to t_cmp_2b.xml

To be fair, this is only true if you ignore the technique 4 variation that he uses on technique 2.
EventGhost 0.4.1.r1640
PHX01RN plugin v3.0.1
Windows XP 32bit (v5.1 Build 2600 Service Pack 2)
Windows7 64bit (v6.1 Build 7601 Service Pack 1)
User avatar
WharfRat
Experienced User
Posts: 159
Joined: Wed Dec 25, 2013 11:56 am

Re: Techniques: controlling multiple programs

Post by WharfRat »

This should have been done sooner.

I have rewritten all the examples to use the Desktop Remote instead.
generic desktop remote
generic desktop remote
generic_dr.png (6.69 KiB) Viewed 2956 times
This makes the examples simpler for new users.
Nothing needs to be configured, they work 'straight out of the box'.

There are a couple of annoyances to be aware of however.

1. The Desktop Remote buttons (in this case, Power) sometimes remain stuck in the down position. I have always had this problem; it is not specific to these examples. This is not serious, because the buttons can still be clicked and work as intended.

2. Occasionally, when the examples are loaded, error messages will appear in the Log. You can ignore them, but the instructions in the Log may not be that obvious. Often the Log is still being written to when I try to clear it, and that is what causes the error messages. There are delays scattered in my Log macros to prevent this, although sometimes they are not long enough. Maybe someone else can come up with a better solution.

Otherwise, I am happy with what we have now.
EventGhost 0.4.1.r1640
PHX01RN plugin v3.0.1
Windows XP 32bit (v5.1 Build 2600 Service Pack 2)
Windows7 64bit (v6.1 Build 7601 Service Pack 1)
Post Reply