Hello
I am using one of these super cheap USB rollup drum pads to trigger sound clips on a soundboard: http://www.amazon.com/Roll-Drum-Free-Pl ... B000YMNZF6
The Generic HID plugin is used for EG to capture events from the device. The problem is that every time any of the pads are hit, two identical events are created. The result is that two sounds are played back-to-back when you hit the pad just one time.
Is there any way to ignore duplicate events when they come in simultaneously (or within a fraction of a second)?
This is for EventGhost 0.4.1.r1669 (latest release) on Windows 7 Pro SP1. I put this in the General Support forum because I think the plugin is working fine. I am assuming that what I need is a software workaround for a hardware issue on a cheap piece of hardware.
Thank you
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.
Ignoring Duplicate Events
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Ignoring Duplicate Events
This is a quite simple task:
1.) Create a macro as shown below:2.) Into the Python Script action copy the following code:3.) The constant timeout adjust as needed
4.) This macro put in your configuration tree as high as possible.
That's it. Other macros (with some HID events) that you use, you can leave unchanged.
Note: Maybe it will be a glitch, that event payload values ÔÇïÔÇïare ignored. In this case it will be necessary to modify it.
Pako
1.) Create a macro as shown below:2.) Into the Python Script action copy the following code:
Code: Select all
timeout = 0.1
if not "lastEventTime" in eg.globals.__dict__:
eg.globals.lastEventTime = {}
let = eg.globals.lastEventTime
et = eg.event.time
ees = eg.event.string
if ees in let:
if et - let[ees] > timeout:
let[ees] = et # Set variable
else:
#print "Event %s ignored" % ees
eg.event.skipEvent = True # Ignore event (rapid sequence)
else:
let[ees] = et # Set variable
4.) This macro put in your configuration tree as high as possible.
That's it. Other macros (with some HID events) that you use, you can leave unchanged.
Note: Maybe it will be a glitch, that event payload values ÔÇïÔÇïare ignored. In this case it will be necessary to modify it.
Pako
Re: Ignoring Duplicate Events
Pako, any chance you could make this into an Eventghost built-in Action or a plugin?
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
Re: Ignoring Duplicate Events
I don't understand where to put the actual Action in the macro.... 
EDIT: following this at least made more sense to my noob brain and i seem to have made it work:
viewtopic.php?t=9452
EDIT: following this at least made more sense to my noob brain and i seem to have made it work:
viewtopic.php?t=9452
Automation is life.
Win7 64bit
EG: v0.5.0-rc4
Win7 64bit
EG: v0.5.0-rc4