Page 7 of 11
Re: Generic HID
Posted: Fri Mar 05, 2010 7:29 pm
by defender013
Hi Bartman,
I have some general questions about the HID plugin, I hope you can shed some light on it.
This is what I understand of the HID plug-in, correct me if I am wrong.
1. when an HID function is asserted by a peripheral device, EG will try (if the device is registered) to log the raw data/event name of this function.
2. Even if this HID function is used as a trigger event to some EG marco, EG does NOT intercept it (stop it from being sent to other programs running concurrently), it just allows the ability to bind other desired functions to this key.
My second point is what I believe is killing me right now. I can detect all buttons on my HID remote just fine, it's just some specific buttons (HID.button7 HID.button9) seem to trigger a reaction for my media player (KMPlayer) even if EG catches the event and issues its' command.
Based on my reading and research, there is no way for me to get around this problem. If I disable HID service, then EG won't even detect it. If I enable it, there is no way to tell EG to NOT let other programs see it, so thus my only option should be to somehow find a way to stop KMPlayer from responding to it. Does this sound about right to you?
I have also been looking into autoHotKey, but it seems to fall in line with what EG does, parallel recognition but no interception.
Re: Generic HID
Posted: Sat Mar 06, 2010 6:24 am
by Bartman
The HID plugin cannot block keys.
The inUSB driver started in the 0.4. branch can do that.
Re: Generic HID
Posted: Sat Mar 06, 2010 9:16 am
by defender013
Hi Bartman,
thanks for the reply, but sorry, I'm not familiar with what you are referring to.
Do you mean i have to override the windows drivers? Or is this an alternate plugin? I don't remember seeing this with the default installation.
many thanks for your help.
Re: Generic HID
Posted: Sat Mar 06, 2010 2:23 pm
by Bartman
In 0.4 EG installs a generic driver for certain devices which complete removes all generic functionality of HID device and lets EG take complete control over the actions.
This is however not generic like HID but relativly easy to do.
Re: Generic HID
Posted: Sat Mar 06, 2010 9:48 pm
by defender013
Hi Bartman,
thanks I'll have a look into that. just curious, is 0.4 the experimental release? Because I don't see it in the official download list.
thanks,
Re: Generic HID
Posted: Mon Mar 08, 2010 3:46 pm
by farbox
A polite re-request, for a kind knowladgebale person, for a sample script as per my previous question, whereby I can detect an HID payload, and use it to assign actions, please?
If somone can also show how the script can detect if the value is rising or falling (as per my example on the previous post) it would be wonderful!
Re: Generic HID
Posted: Mon Mar 08, 2010 4:55 pm
by Bartman
Here is a script triggering a new event Main.Up or Main.Down
Code: Select all
newValue = eg.event.payload
if hasattr(eg.globals, 'prevValue'):
prevValue = eg.globals.prevValue
eg.globals.prevValue = newValue
if prevValue < newValue:
eg.TriggerEvent("Up")
elif prevValue > newValue:
eg.TriggerEvent("Down")
else:
eg.globals.prevValue = newValue
Re: Generic HID
Posted: Mon Mar 08, 2010 11:26 pm
by farbox
Thank you Bartman, you ROCK!
SO I took your script above, and created the following folder structure:
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1436">
<Macro Name="Jog wheel/Volume" Expanded="True">
<Event Name="Shuttle.Value.1" />
<Action>
EventGhost.PythonScript(u'newValue = eg.event.payload\nif hasattr(eg.globals, \'prevValue\'):\n prevValue = eg.globals.prevValue\n eg.globals.prevValue = newValue\n if prevValue < newValue:\n eg.TriggerEvent("Winamp: Volume Up")\n elif prevValue > newValue:\n eg.TriggerEvent("Winamp: Volume Down")\nelse:\n eg.globals.prevValue = newValue')
</Action>
</Macro>
</EventGhost>
And in the script modified your script as below:
Code: Select all
newValue = eg.event.payload
if hasattr(eg.globals, 'prevValue'):
prevValue = eg.globals.prevValue
eg.globals.prevValue = newValue
if prevValue < newValue:
eg.TriggerEvent("Winamp: Volume Up")
elif prevValue > newValue:
eg.TriggerEvent("Winamp: Volume Down")
else:
eg.globals.prevValue = newValue
However in the left hand EG screen, for my jog wheel input I get the following triggers:
Shuttle.Value.1 124
Jog wheel/Volume
Python Script
Main.Winamp: Volume Up
Shuttle.Value.1 125
Jog wheel/Volume
Python Script
Main.Winamp: Volume Up
Shuttle.Value.1 124
Jog wheel/Volume
Python Script
Main.Winamp: Volume Down
Shuttle.Value.1 123
Jog wheel/Volume
Python Script
Main.Winamp: Volume Down
SO its reading the input as I want it, but dont know where the Main.Winamp action signifies (the MAIN part being the determining factor!), and obviously its not changing the winamp volume.
I tried referencing the macro folders of Volume up and down, and also actions themselves, no joy. What am i doing wrong?
Thank you very very much for your script Bartman, I have my system, setup just as I like it now (almost)! Well, until the next modification that is!
PS after playing around a bit i got it working by the mimicking a key input (corresponding to the key triggers in the respective vol up/down folders) form the script as below:
Code: Select all
eg.TriggerEvent("MceRemote.3737")
elif prevValue > newValue:
eg.TriggerEvent("MceRemote.3734")
else:
ANd now get the following responses:
Shuttle.Value.1 140
Jog wheel/Volume
Python Script
Main.MceRemote.3737
Volume Up
Winamp: Volume Up
Shuttle.Value.1 139
Jog wheel/Volume
Python Script
Main.MceRemote.3734
Volume Down
Winamp: Volume Down
But have a feeling (in my not at all knowledgable opinion!) that there must be a cleaner way to reference the action directly instead of cross-referencing so many folders/actions?
Re: Generic HID
Posted: Tue Mar 09, 2010 6:16 am
by Bartman
What is the Main.MceRemote.??? event for?
You can assign multiple events to a macro.
Re: Generic HID
Posted: Tue Mar 09, 2010 12:01 pm
by farbox
Its the trigger from the remote (ie the reading from the IR receiver for that button) for "normal" use; in my winamp context folder, i have volume control assigned to that MCE remote button as a macro below:
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1436">
<Macro Name="Volume Up" Expanded="True">
<Event Name="MceRemote.3737" />
<Action>
Winamp.VolumeUp()
</Action>
<Action>
EventGhost.AutoRepeat(0.33000000000000002, 0.050000000000000003, 0.050000000000000003, 2.0)
</Action>
</Macro>
</EventGhost>
And when I was playing around with the script, and couldnt get it to work directly, I referenced the MCE remote keystroke.
My question was, whether I was doing something wrong, not being able to reference the vol up/down action directly from your script, rather than having to reference it to the above keystroke to make it work?
Re: Generic HID
Posted: Sun Mar 14, 2010 11:42 pm
by batagy
Hi Bartman,
I just want to thank for the development for EventGhost and for this Generic HID plugin.
I have this USB device:
Conceptronic "Multimedia remote control" model CMMRC
Order code : C08-039
http://www.conceptronic.net/site/deskto ... &pid=CMMRC
I just want to confirm that this device is working perfectly with EventGhost, with the Generic HID plugin. When I tried to add the Generic HID plugin, it offered two device option to select:
- Generic USB K/B, Manufacturer: unknow non-english character
- Formosa RC102-809 USB Remot, Formosa Indrustrial Computin
I selected the "Formosa RC102-809 USB Remot, Formosa Indrustrial Computin". By default it doesn't recognise button presses, gives "HID.Button.None" in Log.
But when I turn on the option "Use Raw Data as event name", then I get the raw values, so I can configure it properly. It works perfectly.
I just wanted to post here my raw codes, helping the development of this application. You maybe could include this device in next build, so it will be supported.
So here are the details:
Conceptronic "Multimedia remote control" model CMMRC
Order code : C08-039
http://www.conceptronic.net/site/deskto ... &pid=CMMRC
When I install the official driver 1.3, a program is installed in Start Menu creating a "Formosa21" folder, inside another folder "Remote Master for RC105 v1.3". So this USB device is
Formosa21 RC105 in fact.
EventGhost 0.3.7.r1436
Using Windows XP SP3 Hungarian
Plugin: HID: Formosa Industrial Computin Formosa RC102-809 USB Remot
With setting "Use Raw Data as event name" turned on
HID.0000F717E8 = DVD
HID.0000F716E9 = MUSIC
HID.0000F715EA = PRESENT
HID.0000F714EB = EXIT
HID.0000F713EC = Previous track
HID.0000F712ED = Play
HID.0000F711EE = Next track
HID.0000F710EF = SCREEN
HID.0000F70FF0 = Reward
HID.0000F70EF1 = Pause
HID.0000F70DF2 = Forward
HID.0000F70CF3 = CH+
HID.0000F70BF4 = ESC
HID.0000F70AF5 = Up
HID.0000F709F6 = Stop
HID.0000F708F7 = CH-
HID.0000F707F8 = Left
HID.0000F706F9 = OK
HID.0000F705FA = Right
HID.0000F704FB = Volume Up
HID.0000F703FC = Menu
HID.0000F702FD = Down
HID.0000F701FE = Mute
HID.0000F700FF = Volume Down
When removed from USB port, then reattached, maybe it helps to identify this device:
Error reading HID device: Formosa Industrial Computin Formosa RC102-809 USB Remot
HID.746F726500
HID.Stopped
System.DeviceRemoved [u'\\\\?\\HID#Vid_147a&Pid_e019#6&4291489&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}']
System.DeviceRemoved [u'\\\\?\\USB#Vid_147a&Pid_e019#5&25a083c0&0&2#{a5dcbf10-6530-11d2-901f-00c04fb951ed}']
System.DeviceAttached [u'\\\\?\\USB#Vid_147a&Pid_e019#5&25a083c0&0&2#{a5dcbf10-6530-11d2-901f-00c04fb951ed}']
System.DeviceAttached [u'\\\\?\\HID#Vid_147a&Pid_e019#6&4291489&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}']
Regards
batagy
Re: Generic HID
Posted: Tue Mar 16, 2010 4:11 pm
by Bartman
Mapping the raw codes to specific names should be done in seperate plugins.
The additional event with random data when unplugging will no longer occur in the next build.
Re: Generic HID
Posted: Wed Mar 17, 2010 10:22 am
by batagy
Bartman wrote:Mapping the raw codes to specific names should be done in seperate plugins.
Hi!
Thanks for clarification. I thought your plugin can include it, because it recognises it as "Formosa RC102-809 USB Remot".
So why not recognise it properly as Formosa21 RC105?
Thanks
batagy
Re: Generic HID
Posted: Wed Mar 17, 2010 10:24 am
by Bartman
batagy wrote:So why not recognise it properly as Formosa21 RC105?
Because the device tells that it is named
"Formosa RC102-809 USB Remot". ALthough still better than some devices which don't give a name at all.
Re: Generic HID
Posted: Wed Mar 17, 2010 6:42 pm
by batagy
Ok, so it is in fact "Formosa RC102-809 USB Remot", as it says itself.
Hmm ok, nice to know.
Thanks for clarification!
Keep up your good work!
