Desktop Remote 'Add Button' Event

If you have a question or need help, this is the place to be.
Post Reply
rjzupko
Posts: 2
Joined: Tue Feb 05, 2019 1:44 am

Desktop Remote 'Add Button' Event

Post by rjzupko » Mon Feb 25, 2019 5:17 am

Hello, I'm trying to create a custom remote. I want a remote with buttons that would activate macros, or an event within a macro at the very least. I tried to follow the instructions on: http://www.eventghost.net/mediawiki/ind ... top_Remote, but I cannot seem to figure out what to include for the "Event". Is there any way to have it do what I want?

Thanks

User avatar
topix
Experienced User
Posts: 441
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: Desktop Remote 'Add Button' Event

Post by topix » Sun Mar 03, 2019 11:20 am

When you add a button to the desktopremote you enter a event name. This event will be fired when you press the button on the desktopremote. The generated event can then be used to trigger macros (use drag'n'drop to move the event from log window to macro in config tree).

rjzupko
Posts: 2
Joined: Tue Feb 05, 2019 1:44 am

Re: Desktop Remote 'Add Button' Event

Post by rjzupko » Sun Mar 10, 2019 9:57 pm

Thank you Topix! The remote works perfectly! I had to add an event to activate the Remote Window for the buttons on the remote to send the event to the log window. I kept on right-clicking and selecting Execute Item to open the Remote Window instead of creating an event to open it. Once again, thank you!

dan Edens
Experienced User
Posts: 116
Joined: Mon Sep 24, 2018 7:57 pm

Re: Desktop Remote 'Add Button' Event

Post by dan Edens » Mon Feb 01, 2021 2:39 pm

Hello, reusing old thread because relevance,

when I fire events from my Lcore logitech software it's easy to send it through command line example eventghost.exe -e "job jobname"

which then lets me use

eg.globlas.jobname = eg.event.payload[0]

Nice and easy.

But when I try to do the same with these remote buttons, no go, event has no payload.

How would I get the event trigger text so i can parse it into something like eg.event.trigger[0]?

User avatar
Sem;colon
Plugin Developer
Posts: 813
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Desktop Remote 'Add Button' Event

Post by Sem;colon » Mon Feb 01, 2021 2:45 pm

Hi Dan,
I'm not sure if I understand it correctly, but does

Code: Select all

 eg.event.suffix
do what you like?
If you like my work, Image me a drink :wink:

dan Edens
Experienced User
Posts: 116
Joined: Mon Sep 24, 2018 7:57 pm

Re: Desktop Remote 'Add Button' Event

Post by dan Edens » Mon Feb 01, 2021 2:46 pm

Exactly what I was looking for!!
I knew it existed, just couldn't put my pen on it haha.

Cheers!

dan Edens
Experienced User
Posts: 116
Joined: Mon Sep 24, 2018 7:57 pm

Re: Desktop Remote 'Add Button' Event

Post by dan Edens » Mon Feb 01, 2021 2:54 pm

I might clean this up and post in the share section, but here it is as is atm!

Adds remote buttons for each directory in the {eg.globals.jobs} folder.
Than each button sets jobname to it's name, and everything in my network places files or names photos, etc, into the active job location.
another remote that isn't ready has a ton of other related tools.
Keeps me sane.

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="WIP-2020.05.11-06.47.41">
    <Folder Name="Jobname manager" XML_Guid="{189963C7-A37F-47DF-9C9A-9CC23FCB6192}" Expanded="True">
        <Folder Name="jobname launcer" XML_Guid="{C9BBFD5B-D248-4702-B66C-5530A8B97236}">
            <Folder Name="Remote" XML_Guid="{7BC8DA3D-8C2B-4573-8AA4-F17248F63EB4}">
                <Macro Name="Show job remote" XML_Guid="{77C51295-D1D5-4471-B4F3-47284A7F3153}">
                    <Event Name="*.job?selector?show" XML_Guid="{837DD4E6-BA95-4AA5-8AD7-10057D70B555}" />
                    <Action Name="Show remote at mouse, Offset -220x" XML_Guid="{652CAB7C-46A3-4542-B336-DF8A7F2B6762}">
                        EventGhost.PythonScript(u"import win32api\neg.globals.h_x = 1\neg.globals.h_y = 1\ndef mPos(x, y):\n    win32api.SetCursorPos((x, y))\ndef start():\n    h_x, h_y = win32api.GetCursorPos()\n    return h_x, h_y\neg.globals.h_x, eg.globals.h_y = start()\neg.globals.h_x = int(eg.globals.h_x)-220\neg.globals.h_y = int(eg.globals.h_y)  #eg.plugins.System.SetClipboard(u'{eg.globals.h_x},{eg.globals.h_y}')\neg.plugins.DesktopRemote.Show(eg.globals.h_x, eg.globals.h_y, True)\n")
                    </Action>
                </Macro>
                <Folder Name="Job selector" XML_Guid="{88712582-6AC0-4A30-B671-F3DFE565ABB0}">
                    <Macro Name="job selector" XML_Guid="{5F74ABE4-EC2C-4F80-A0E4-CE6E818CACC4}" Expanded="True">
                        <Event Name="*.job?selector" XML_Guid="{4CA106D7-5D01-4048-BD98-27D98570A95F}" />
                        <Action Name="Job Tools remote" id="2325" XML_Guid="{6A242242-F689-46C7-B8AB-301D6648FC44}">
                            EventGhost.PythonScript(u"import os\nrowCount = 4\n\ntoolrow = [\n            'launcher',\n            'projects',\n            'sorter',\n            'devices',\n            ]\n\nlauncher = [\n            'lab_remo'\n            #'teams',\n            'web_remo',\n            'firefox',\n            'jobs_Board',\n            'self_Board',\n            'vortex',\n#            'Coldata-ex',\n#            'Coldata-shell',\n            ]\n\njob_directories = os.listdir(eg.globals.jobs)\n\nlabs = [\n            'Jobpath',\n            'Python',\n            'Nodejs',\n            'bin',\n            'workspaces',\n            'notes',\n            'logs',\n            'gtree',\n            ]\n\ncontent_rows = [\n            job_directories,\n            toolrow,\n            launcher,\n            labs\n            ]\n            \neg.plugins.DesktopRemote.CreateNew(\n                        70, 30, 4, 4, 4, (88, 48, 49),\n                        (199, 200, 254), (69, 69, 69), \n                        u'0;-13;0;0;0;700;0;0;0;0;3;2;1;34;Arial',\n                        u'Job Tools', \n                        2, True, True, False\n                        )\n\nimport win32api\n\neg.globals.h_x = 1\neg.globals.h_y = 1\n\n\ndef mPos(x, y):\n    win32api.SetCursorPos((x, y))\ndef start():\n    h_x, h_y = win32api.GetCursorPos()\n    return h_x, h_y\n\neg.globals.h_x, eg.globals.h_y = start()\n\n\nfor joblist in content_rows:\n    x=1\n    for job in joblist:\n        if job[:1] == '_':\n            pass\n        else:\n            x += 1\n            job = job[:9]\n            eg.plugins.DesktopRemote.AddButton({'event': u'job '+job, 'label': job})\n            if x &gt; rowCount:                 \n                eg.plugins.DesktopRemote.StartNewLine(1)\n                x = 1\n    eg.plugins.DesktopRemote.StartNewLine(1)\n\n\n\n#  eg.plugins.DesktopRemote.StartNewLine(1)\n\n\neg.globals.h_x = int(eg.globals.h_x)-220\neg.globals.h_y = int(eg.globals.h_y)  #eg.plugins.System.SetClipboard(u'{eg.globals.h_x},{eg.globals.h_y}')\neg.plugins.DesktopRemote.Show(eg.globals.h_x, eg.globals.h_y, True)\n")
                        </Action>
                    </Macro>
                    <Folder Name="remote editor" XML_Guid="{7446871D-F336-4653-9DB3-AC6720F91CFC}" Expanded="True">
                        <Macro Name="edit remote" id="2327" XML_Guid="{BCF4D5E5-EA85-4BBE-BC2A-58EC725E99A3}">
                            <Event Name="*.edit?remote" XML_Guid="{837DD4E6-BA95-4AA5-8AD7-10057D70B555}" />
                            <Action XML_Guid="{75CE3367-6095-4382-9A9B-8618CBE36CF0}">
                                DesktopRemote.Close()
                            </Action>
                            <Action XML_Guid="{F86B5A52-0B8D-44ED-9247-EF14F473602B}">
                                EventGhost.OpenConfig(XmlIdLink(2325))
                            </Action>
                        </Macro>
                    </Folder>
                </Folder>
            </Folder>
        </Folder>
        <Folder Name="Jobname tools" XML_Guid="{038D9064-28E2-4C1F-A5C6-479C168B3504}" Expanded="True">
            <Macro Name="Set jobname" XML_Guid="{B088AB6C-4E4A-46FB-B34A-38107E3A10B3}">
                <Event Name="*.job *" XML_Guid="{516825EB-1374-4B26-9F10-EFC398F26EE0}" />
                <Action Name="Set Jobname Receipt" XML_Guid="{4A169097-3A50-4385-80BA-21B2933B5ADC}">
                    EventGhost.PythonScript(u"print \nx = eg.event.suffix\ny = x.split()\neg.globals.jobname = y[1]\neg.globals.jobpath = eg.globals.jobs + '\\\\' + eg.globals.jobname\neg.plugins.EventGhost.TriggerEvent(u'Input.OK.rain var', 0.0, None, False, False, False)\n")
                </Action>
            </Macro>
            <Macro Name="Display Jobname" XML_Guid="{0ADF1353-94B4-46F5-A453-E65DA2517DB3}">
                <Event Name="*.flash?job" XML_Guid="{6362D2D3-6176-4A9D-A223-EE274B07E52F}" />
                <Event Name="*.flash?jobname" XML_Guid="{837DD4E6-BA95-4AA5-8AD7-10057D70B555}" />
                <Action XML_Guid="{F52EE2FE-F7CF-451A-90EC-F947232679FA}">
                    EventGhost.PythonScript(u"import os\nx= os.getenv('jobname')\neg.plugins.EventGhost.ShowOSD(u' Jobname set to {eg.globals.jobname}', u'0;-24;0;0;0;700;0;0;0;1;0;0;2;32;Arial', (200, 190, 4), (0, 0, 0), 0, (400, 100), 2, 3.0, u'Default')\nprint x\nprint eg.globals.jobname")
                </Action>
            </Macro>
            <Macro Name="copy jobpath" XML_Guid="{44D48D8C-5834-4517-8019-5A2895A8FA0C}">
                <Event Name="*.job?copy" XML_Guid="{0057B84D-9861-47B2-B65B-F2FAB72FDDC7}" />
                <Action XML_Guid="{6858D6F7-2E7A-4E43-9ADF-B32AB9C77B88}">
                    System.SetClipboard(u'{eg.globals.jobpath}')
                </Action>
            </Macro>
            <Macro Name="open jobpath" XML_Guid="{44D48D8C-5834-4517-8019-5A2895A8FA0C}">
                <Event Name="*.job?open" XML_Guid="{0057B84D-9861-47B2-B65B-F2FAB72FDDC7}" />
                <Event Name="*.fileshute.open*" XML_Guid="{8ED1A45D-D143-47CB-9FB0-3E33EC251449}" />
                <Event Name="*.job_Jobpath" XML_Guid="{7C2905D2-8503-43D9-87E7-52BEAAFB74CE}" />
                <Action XML_Guid="{0E4C6695-4E0D-4233-9906-ED8290F4DA1B}">
                    System.Execute(u'"{eg.globals.jobs}\\{eg.globals.jobname}"', u'', 0, False, 2, u'', False, True, u'', False, False, False, False)
                </Action>
            </Macro>
            <Macro Name="Open File: Jobname.txt" XML_Guid="{D6133B0F-8E33-4272-95B0-ECE55EB057EF}">
                <Event Name="*.job?list" XML_Guid="{837DD4E6-BA95-4AA5-8AD7-10057D70B555}" />
                <Action XML_Guid="{0EE681B8-15B2-45A5-A7CE-D8BB1A7581E2}">
                    System.Execute(u'{eg.globals.tree}the_vault\\\\Environments\\\\Variables\\\\Jobname.txt', u'', 0, False, 2, u'', False, False, u'', False, False, False, False)
                </Action>
            </Macro>
        </Folder>
    </Folder>
</EventGhost>

Post Reply