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.

Enable Exclusivity Rotation using the same key!.

If you have a question or need help, this is the place to be.
Post Reply
IceGothic
Posts: 33
Joined: Tue Oct 20, 2009 2:47 pm

Enable Exclusivity Rotation using the same key!.

Post by IceGothic »

I want to enable exclusively to A and B and C groups so pressing the same key would allow to cycle between them:

Ex:
ParentGroup
- GroupA
- GroupB
- GroupC

Python script could look like this:

if KeyPressed:
if eg.global.var = 0:
GroupA.EnableExclusive
eg.global.var = 1
elif eg.global.var = 1.
GroupA.EnableExclusive
eg.global.var = 2
else:
GroupA.EnableExclusive
eg.global.var = 0

Anyone knows how to enable exclusivity in python code? Is the an other way to do this not using python scripts?
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Enable Exclusivity Rotation using the same key!.

Post by Pako »

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1194">
    <Folder Name="Enable exclusive" Expanded="True">
        <Folder Name="Groups A,B,C">
            <Folder Name="Group A" id="2064" Expanded="True">
                <Macro Name="Group A" id="1994" Expanded="True">
                    <Action Name="Some actions">
                        EventGhost.Comment()
                    </Action>
                </Macro>
            </Folder>
            <Folder Name="Group B" id="2065" Enabled="False" Expanded="True">
                <Macro Name="Group B" id="1996" Expanded="True">
                    <Action Name="Some actions">
                        EventGhost.Comment()
                    </Action>
                </Macro>
            </Folder>
            <Folder Name="Group C" id="2066" Enabled="False" Expanded="True">
                <Macro Name="Group C" id="1998" Expanded="True">
                    <Action Name="Some actions">
                        EventGhost.Comment()
                    </Action>
                </Macro>
            </Folder>
        </Folder>
        <Folder Name="Switch">
            <Macro Name="Switch to A" id="1979" Enabled="False" Expanded="True">
                <Event Name="Some.Event" />
                <Action>
                    EventGhost.EnableExclusive(XmlIdLink(2064))
                </Action>
                <Action>
                    EventGhost.EnableExclusive(XmlIdLink(1981))
                </Action>
            </Macro>
            <Macro Name="Switch to B" id="1981" Expanded="True">
                <Event Name="Some.Event" />
                <Action>
                    EventGhost.EnableExclusive(XmlIdLink(2065))
                </Action>
                <Action>
                    EventGhost.EnableExclusive(XmlIdLink(1983))
                </Action>
            </Macro>
            <Macro Name="Switch to C" id="1983" Enabled="False" Expanded="True">
                <Event Name="Some.Event" />
                <Action>
                    EventGhost.EnableExclusive(XmlIdLink(2066))
                </Action>
                <Action>
                    EventGhost.EnableExclusive(XmlIdLink(1979))
                </Action>
            </Macro>
        </Folder>
    </Folder>
</EventGhost>
You only need to replace the event "Some.Event" any of your events.
Pako

EDIT:
I forgot to add something.
Better might be to use Multitap in SingleKey mode.
Pako
IceGothic
Posts: 33
Joined: Tue Oct 20, 2009 2:47 pm

Re: Enable Exclusivity Rotation using the same key!.

Post by IceGothic »

Of course!! Why did'nt I think of that? lol

Thanx! :o)
Post Reply