Hi
when I attach an USB-Device to the PC than the System.DeviceAttached Event is show in the log:
System.DeviceAttached [u'\\\\?\\USB#Vid_03eb&Pid_6124#5&33a95ce&0&8#{a5dcbf10-6530-11d2-901f-00c04fb951ed}']
is there a way to react on a that special USB device (depending on IDs) ? I mean is there a opportunity to add the device VID und PID to the event System.DeviceAttached as it is shown in the log?
thank you
Im using EventGhost 0.3.7.r1462 on Windows XP SP3
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.
Costumize USB Device Attached Event
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Costumize USB Device Attached Event
I'm not sure if I understand correctly your question. Maybe because the solution is trivial:Use Python Command action.
Pako
Pako
Re: Costumize USB Device Attached Event
thank you so far...
im new to EventGhost and also to Phyton
i actually want to run an application when an USB device is plugged in... so my question is if there is a way to run an application when one special USB Device is connected... e.g. if i plug in a mouse, eventghost wont launch the application, but if i plug in a device with e.g. vendor id xyxy & product id yxyx eventghost will launch the application...
At the moment the application starts but it does it for any USB device...
ty
im new to EventGhost and also to Phyton
i actually want to run an application when an USB device is plugged in... so my question is if there is a way to run an application when one special USB Device is connected... e.g. if i plug in a mouse, eventghost wont launch the application, but if i plug in a device with e.g. vendor id xyxy & product id yxyx eventghost will launch the application...
At the moment the application starts but it does it for any USB device...
ty
Re: Costumize USB Device Attached Event
Did you actually try the example that Pako posted? It should allow you to do exactly what you are asking for.
Maybe something like this would be better to pick out only vid and pid value from the string though. (so you dont have to plug the device into the same usb port every time).
Maybe something like this would be better to pick out only vid and pid value from the string though. (so you dont have to plug the device into the same usb port every time).
Code: Select all
eg.TriggerEvent(eg.event.payload[0][8:25], prefix = eg.event.suffix)Re: Costumize USB Device Attached Event
hey there,
i just tried it and hmm actually its very easy
... but im far away from understanding the commands...
you did a great job with eventghost...thank you all very much!
greetz
nico
i just tried it and hmm actually its very easy
you did a great job with eventghost...thank you all very much!
greetz
nico
Re: Costumize USB Device Attached Event
hey its me again 
it now works that eventghost triggers only the specific usb device... but if i plug it into a different USB-Slot it doesnt work anymore..
atm the event looks like this:
DeviceAttached.\\?\USB#Vid_03eb&Pid_6124#5&33a95ce&0&8#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
it seems that the numbers between #5&33a95ce&0&8# correspond to the usb port... is it possible to insert a wildcard or something like that ?
thanks again
it now works that eventghost triggers only the specific usb device... but if i plug it into a different USB-Slot it doesnt work anymore..
atm the event looks like this:
DeviceAttached.\\?\USB#Vid_03eb&Pid_6124#5&33a95ce&0&8#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
it seems that the numbers between #5&33a95ce&0&8# correspond to the usb port... is it possible to insert a wildcard or something like that ?
thanks again
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Costumize USB Device Attached Event
This problem has already resolved the improvements proposed by jinxdone:Pako
Code: Select all
eg.TriggerEvent(eg.event.payload[0][8:25], prefix = eg.event.suffix)Re: Costumize USB Device Attached Event
oh didnt see it... but great anyway...
thank you again...
thank you again...