Generic HID

Questions and comments specific to a particular plugin should go here.

Re: Generic HID

Postby CollinR » Tue Nov 11, 2008 4:09 pm

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
CollinR
Experienced User
 
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma

Re: Generic HID

Postby Bartman » Wed Nov 12, 2008 8:04 pm

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)}
Bartman
Plugin Developer
 
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Generic HID

Postby Bitmonster » Wed Nov 12, 2008 8:19 pm

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!
User avatar
Bitmonster
Site Admin
 
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Generic HID

Postby Bartman » Wed Nov 12, 2008 8:25 pm

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.
Bartman
Plugin Developer
 
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Generic HID

Postby Bitmonster » Wed Nov 12, 2008 8:30 pm

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!
User avatar
Bitmonster
Site Admin
 
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Generic HID

Postby Bartman » Wed Nov 12, 2008 8:34 pm

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.
Bartman
Plugin Developer
 
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Generic HID

Postby Bitmonster » Wed Nov 12, 2008 8:42 pm

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!
User avatar
Bitmonster
Site Admin
 
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Generic HID

Postby TheLexus » Thu Nov 13, 2008 8:16 am

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

Postby TheLexus » Fri Nov 14, 2008 3:56 pm

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

Postby TheLexus » Fri Nov 14, 2008 4:14 pm

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....
TheLexus
 
Posts: 8
Joined: Wed Oct 29, 2008 9:16 am

HID Device / Remapping / etc

Postby Roamin » Sat Dec 27, 2008 6:26 am

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.
Roamin
 
Posts: 6
Joined: Sat Dec 27, 2008 5:19 am

Re: Generic HID

Postby Bartman » Mon Dec 29, 2008 4:29 pm

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.
Bartman
Plugin Developer
 
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Generic HID

Postby Roamin » Mon Jan 26, 2009 4:18 am

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.
Roamin
 
Posts: 6
Joined: Sat Dec 27, 2008 5:19 am

Re: Generic HID

Postby Bartman » Wed Jan 28, 2009 9:50 pm

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.
Bartman
Plugin Developer
 
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Generic HID

Postby krambriw » Thu Feb 05, 2009 7:08 pm

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
                            )

krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

PreviousNext

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 1 guest