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.
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.
Define mask in Event name
Define mask in Event name
I use an Apple remote that gives events like:
Up Key : HID.2587EE090B
The 09 value is variable between remotes, because it can be changed by a special remote function and serve as pairing.
Is there a way to define mask, so Eventghost will not look at this value.
Ex something like : HID.2587EEXX0B
Up Key : HID.2587EE090B
The 09 value is variable between remotes, because it can be changed by a special remote function and serve as pairing.
Is there a way to define mask, so Eventghost will not look at this value.
Ex something like : HID.2587EEXX0B
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Define mask in Event name
Here's one possibility:Caution: The event with mask must have a different prefix (in the example HID#2).
Pako
Pako
You know flattr ? You can 

-
m19brandon
- Experienced User
- Posts: 177
- Joined: Mon Feb 03, 2014 10:36 pm
Re: Define mask in Event name
Pako, that is great. I never know suffix existed. 
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Define mask in Event name
ya know i just did something pretty cool with events also,
i am running 2 plugins and they exchange some data, but what i wanted is for en event to fire just the one and be able to do some tree stuff with it but at the same time have that same transport mechanism talk to the other plugin.
i just set up a thread to monitor the eg.EventString variable for the particular event.
idk i was bored, and it worked!!
K
i am running 2 plugins and they exchange some data, but what i wanted is for en event to fire just the one and be able to do some tree stuff with it but at the same time have that same transport mechanism talk to the other plugin.
i just set up a thread to monitor the eg.EventString variable for the particular event.
idk i was bored, and it worked!!
K
Re: Define mask in Event name
Make these changes to eg/Classes/EventGhostEvent.py (or wait for v0.5.0) and use "HID.2587EE??0B".
/bw
Re: Define mask in Event name
Hi Blackwind,blackwind wrote:Make these changes to eg/Classes/EventGhostEvent.py (or wait for v0.5.0) and use "HID.2587EE??0B".
that's definitely something that's missing in EventGhost.
But I also have concerns, I don't know how fast eg.eventTable.get is to be honest, but comparing each event with every single item of the eventTable sounds a bit slow to me - is it still as fast as before?
(I'm not at home this week and can't test it)
Re: Define mask in Event name
get() needs to iterate through each item as well to find the match. Performance is actually better than it was previously because it's no longer "getting" six times. Just be wary of using a lot of wildcards in your config, as fnmatchcase() isn't especially fast.
/bw
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Define mask in Event name
since you all pointed out exactly where the event stuff was, and since i really didn't have to go poking around for it..
I decided to do this and to be rid of all of that crazy key +'.*' stuff
and make it all simple like and actually have it so that every event level can be triggered by a wildcard
and i understand as to why it was orignally done skipping levels
but, i know not to wile card a wild carded item unless i explicitly account for it's ability to get triggered when the event might not be for it.
but that's really easy to handle to cut down on making a billion tree items when 1 would suffice for a device that has 150 events for it.
here is the code if anyone is interedted, it's in the eg/classes/EventGhostEvent.py file.
just after here
and just before here
all the code between those can be replaced with
idk, that little piece there just looks good
K
I decided to do this and to be rid of all of that crazy key +'.*' stuff
and make it all simple like and actually have it so that every event level can be triggered by a wildcard
and i understand as to why it was orignally done skipping levels
but, i know not to wile card a wild carded item unless i explicitly account for it's ability to get triggered when the event might not be for it.
but that's really easy to handle to cut down on making a billion tree items when 1 would suffice for a device that has 150 events for it.
here is the code if anyone is interedted, it's in the eg/classes/EventGhostEvent.py file.
just after here
Code: Select all
eg.event = self
eg.eventString = eventString
eg.EventString = eventString
Code: Select all
activeHandlers = set()
for eventHandler in eventHandlerList:
obj = eventHandler
Code: Select all
get = eg.eventTable.get
eventHandlerList = get(eventString, [])
for i in range(len(eventString.split('.'))):
eventHandlerList += get('.'.join(eventString.split('.')[:-i])+'.*', [])
K
Re: Define mask in Event name
Thanks to all for these replies.
Re: Define mask in Event name
Hi kgschlosser,
I'm sorry, I didn't get your explanation, can you give an example about what should work better with your code compared to the one from blackwind?
I'm sorry, I didn't get your explanation, can you give an example about what should work better with your code compared to the one from blackwind?

