How embarassing...
While technique 2 (menu control) originally worked as intended for demonstration, in practice it was not well implemented.
I have modified the code to be more robust.
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1640" Guid="{FE0AE956-386C-4DAC-BC22-9850CFFACDD8}" Time="1392181923.86">
<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 2a"\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(122))
</Action>
</Macro>
<Folder Name="modes" Expanded="True">
<Folder Name="mode menu" Expanded="True">
<Macro Name="Show menu">
<Event Name="DesktopRemote.generic.Function" />
<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>
<Action>
EventGhost.EnableItem(XmlIdLink(106))
</Action>
</Macro>
<Folder Name="menu control" id="106" Enabled="False">
<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>
EventGhost.DisableItem(XmlIdLink(106))
</Action>
<Action>
OSM.OK_Btn()
</Action>
</Macro>
<Macro Name="Cancel">
<Event Name="DesktopRemote.generic.Cancel" />
<Action>
EventGhost.DisableItem(XmlIdLink(106))
</Action>
<Action>
OSM.Cancel_Btn()
</Action>
</Macro>
</Folder>
</Folder>
<Folder Name="select" Expanded="True">
<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(122))
</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(123))
</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(128))
</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(147))
</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(160))
</Action>
</Macro>
</Folder>
<Folder Name="mode" Expanded="True">
<Folder Name="mode none" id="122" />
<Folder Name="mode system" id="123" 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="128" 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="147" 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(154), 1, False)
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(156), 2, False)
</Action>
</Macro>
<Macro Name="start program" id="154">
<Action>
System.Execute(u'C:\\WINDOWS\\NOTEPAD.EXE', u'', 0, False, 2, u'', False)
</Action>
</Macro>
<Macro Name="stop program" id="156">
<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="160" 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(167), 1, False)
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(169), 2, False)
</Action>
</Macro>
<Macro Name="start program" id="167">
<Action>
System.Execute(u'C:\\WINDOWS\\system32\\calc.exe', u'', 0, False, 2, u'', False)
</Action>
</Macro>
<Macro Name="stop program" id="169">
<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>
As a backgrounder, I usually prefer technique 3. Someone else here, who usually uses another computer, prefers technique 2. So I quickly set that one up with the menus and added keyboard navigation keys to the menu control for good measure.
Everything seemed fine, but eventually IrfanView refused to respond to some keyboard keys. Since you cannot reconfigure the IrfanView keys, I was slightly confused. After a while I saw the problem.
The victims were cursor up/down, Enter, and Escape.
The culprit was the menu control keys for the On Screen Menu. It was stealing them from IrfanView, and everything else as well.
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.
Open both versions of technique 2 to see what they do and how they do it.