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.

Generic HID

Questions and comments specific to a particular plugin should go here.
CollinR
Experienced User
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma
Contact:

Re: Generic HID

Post by CollinR »

I would first try renaming the event and adding the .1 .2 .3 or .4 on the end and see if it works. Otherwise you'll need to pull that (payload) from a script.
Windows XP Pro sp3 - Several Machines usually latest beta but who knows.
Inputs: TCP / IR (USBUIRT) / RF(X10 Remote) / CLI-Batch / CCTV Motion / Ocelot
Outputs: TCP / IR (USBUIRT) / SageTV / SageTV Clients / YAC CallerID / HAL v3.7.3 / Ocelot
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Generic HID

Post by Bartman »

You can trigger a new event using some simple python coding
add a new trigger event action and enter the following in the textbox

Code: Select all

{eg.event.suffix + "." + str(eg.event.payload)}
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Generic HID

Post by Bitmonster »

Bartman wrote:You can trigger a new event using some simple python coding
add a new trigger event action and enter the following in the textbox

Code: Select all

{eg.event.suffix + "." + str(eg.event.payload)}
But this way he would loose the enduring feature of the event. Or can't HID generate enduring events for value events? Possibly it would be better to always include the value in value events as a dotted part instead of payload.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Generic HID

Post by Bartman »

The values are not enduring events. Since the axis always has a value the plugin would always have an event or even multiple enduring events for every axis. So this is not possible.
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Generic HID

Post by Bitmonster »

Bartman wrote:The values are not enduring events. Since the axis always has a value the plugin would always have an event or even multiple enduring events for every axis. So this is not possible.
Ok, but it would be possible to include the value in the event string like HID.Value1.127 as a short-event? Since they are generated anyhow on every value change, it would not mess the log more then the current events with payload. And if someone wants to compute something with the value, he could use HID.Value1.* as trigger and eg.event.suffix.split(".")[-1] to get the value.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Generic HID

Post by Bartman »

adding them to the event string would be just changing a line.
I just thought that what payloads are for and expected a script would be neccessary to use analog values anyway.
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Generic HID

Post by Bitmonster »

Bartman wrote:adding them to the event string would be just changing a line.
I just thought that what payloads are for and expected a script would be neccessary to use analog values anyway.
That's what I would have thought also at first. But I tried it with some pad here and this one also generates value events for the D-pad.

So actually some slightly more complex script would be needed to make it really useful (making them enduring and taking the mid-position into account to stop the event).
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
TheLexus
Posts: 8
Joined: Wed Oct 29, 2008 9:16 am

Re: Generic HID

Post by TheLexus »

Hi,

thanks for your suggestions. I'm a little confused (its my first touch with eg and phyton), but I will try bartmans code.

For the analog sticks i assume i have to do something like

Code: Select all

{eg.event.payload>xxxxx}
to make them usefull for simple up/down/left/right actions (digital)???
TheLexus
Posts: 8
Joined: Wed Oct 29, 2008 9:16 am

Re: Generic HID

Post by TheLexus »

Bartman wrote:You can trigger a new event using some simple python coding
add a new trigger event action and enter the following in the textbox

Code: Select all

{eg.event.suffix + "." + str(eg.event.payload)}
Ok, that does half of the trick :)

One little Problem remains. For one Press of the gamepad i've got 4 Events... like
xbox.Value.15 5
xbox.Value.15 5
xbox.Value.15 0
xbox.Value.15 0

How can i filter the second "xbox.Value.15 5" event? (at the moment i got 2 keypresses in mediaportal...).

Thank you!
TheLexus
Posts: 8
Joined: Wed Oct 29, 2008 9:16 am

Re: Generic HID

Post by TheLexus »

Ok, i found a solution. I added a "Clear pending events" in front of the "Trigger event" code above....

Many thanks. Can you give me a hint for the analog sticks....
Roamin
Posts: 6
Joined: Sat Dec 27, 2008 5:19 am

HID Device / Remapping / etc

Post by Roamin »

Hi,

first of all, Eventghost is great!

Second i am using 0.3.5c build 908 on windows XP SP2 on a dv5 hp notebook with a ENE CIR HID integrated device with a MCE remote.

Because this remote is limited, i am mainly using EG to monitor HID activity in order to figure out what is happening. First thing, this notebook came with vista pre-installed with the remote and vista's MCE, which i downgraded to xp. When i first install xp, my remote has almost fully operational keys, which are keyboard key presses. Also at this moment, my xbox 360 remote works all buttons but 4 keys (both remotes share the RC6 protocol according to logo under battery compartment). When i install the drivers, a few HID devices get installed and then if i add each device with HID plugin, i can now read all the keys in hid.button format, but response to my 360 remote is gone. There is 1 HID compliant device thats seems to be tied only to play/pause button. While every key press of the remote returns a value of hid.button.180 or raw data of : 03B400 Every button reads a value of 1 byte maximum, except the play/pause key. The key reported is hid.button.6+15+4+110+145 or raw data of : 0506000F046E9100 . Now i have been able to locate where in the registry resides the Ir Code table for my remote. I have been able to remap every key except the play/pause key, because the ircodetable maps keys that are 1 byte large at the most.

My questions are, first of all is EG really receiving 5 key presses at the same time from 1 device? That data is definitely not in the ircodetable, but something must interpret the key press and send this data over HID. Is there any way to trace whats happens when i press a key? Before i installed the drivers, the play/pause key was seen as a keyboard key, i dont remember which though. Could it be there is 2 actions when i press play/pause? But that would show up as a keyboard key at the same time as a hid button right? Im just really wondering if the data received is the correct data , i know HID data size can vary, and since this is a HID device that seems to only handle that button, i'm guessing its the correct data. I would really love to remap that button in the registry, or the driver if need be.

I'm really looking for any help on the subject,and also as to why my 360 remote produced key presses before drivers , and is no longer seen, if you HID gurus can help me i'd really appreciate.
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Generic HID

Post by Bartman »

The function determinating which buttons are pressed is actually a windows function which parses the data based on information given by the device.
To change this someone would need to write a special plugin parsing the data differently.
I also heard of devices with kind of senseless output.
Roamin
Posts: 6
Joined: Sat Dec 27, 2008 5:19 am

Re: Generic HID

Post by Roamin »

Turns out someone found newer drivers and now the play/pause button is assigned to a normal hid button so now i can remap all keys successfully.
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Generic HID

Post by Bartman »

Roamin wrote:Turns out someone found newer drivers and now the play/pause button is assigned to a normal hid button so now i can remap all keys successfully.
Just wondering what the device manager show up as drivers. One advantage of HID devices is that the developer doesn't need to write drivers.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Generic HID

Post by krambriw »

I have a very cheap remote (Remotec) that worked at once with the HID plugin. However, I had the same wish as some users wrote above. With the change below, it works fine to copy/paste events from log to tree. And the payload is still there...Hope I did not crash something else :)

Best regards, Walter
"adding them to the event string would be just changing a line."
On line 569; I changed to the following:

Code: Select all

                            self.plugin.TriggerEvent(
                                "Value." + str(tmpIndex) + "." + str(newValue),
                                payload = newValue
                            )

Post Reply