I've been playing around with EG for a few days now and have managed to accomplish much of what I intend to do with it. Now I've come to a point in my configuration which has me scratching my head regarding the best way to go about handling it.
I'm trying to automate the task of using multiple joystick devices, some of which are the same model. Since I can never be sure of what joystick is going to be picked up as joystick 1, 2, 3, etc., I've devised the following strategy using EG, GlovePE, and PPJoy.
I have 4 virtual joysticks configured with PPJoy.
I have my emulators configured to use these virtual devices.
I have GlovePIE scripts and supporting glue to translate my various real joystick devices to corresponding PPJoy virtual devices.
This works very well. What I'm looking for is a way within EG to detect a key combo based on the real joystick model and initiate a virtual Port Swap of game controllers using a PythonScript action.
I've looked into Generic HID, but it does not do what I need.
I would like to generate an event if any device of the same model pressed the hotkey combo. Not attempt to focus, for instance, on a single XBox 360 controller, but onto all the XBox 360 controllers which may be plugged into any USB port. I would also like to have the deviceIndex exposed to PythonScript.
I haven't coded in a few years and I was never really into Python, but I have looked into the HID plugin source and it's not obvious to me that I can accomplish this with a simple modification to the plugin. It appears to be, more or less, an interface to the core EG HID class. Would I need to make modifications to the core class to enable watching multiple devices from a single plugin instance?
Or am I over complicating this problem?
Thanks!
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.
Multi Joystick PNP
Re: Multi Joystick PNP
You could create multiple HID plugins with different event prefixes (e.g. HID0, HID1, HID2, ...) and each with another device Index.
Then bind your macro to different events in the Form HID0.Buttons.1+3+5, HID1.Buttons.1+3+5, HID2.Buttons.1+3+5, ...
You can get the eventIndex by evaluating the event prefix in the script.
Then bind your macro to different events in the Form HID0.Buttons.1+3+5, HID1.Buttons.1+3+5, HID2.Buttons.1+3+5, ...
You can get the eventIndex by evaluating the event prefix in the script.
Re: Multi Joystick PNP
Thanks! I considered this approach after I posted the question. I guess I'll just have a bunch of HID plugins running!
Re: Multi Joystick PNP
Okay, so that didn't go so well.
I addedd two Generic HID plugins to watch for XBox 360 controllers. One I set to device index 0 and event prefix "xbox.1", the other is set to device index 1 and event prefix "xbox.2". There is only one XBox 360 controller plugged in. When pressing button 1 on the controller I get two events, "xbox.1.Button.1" and "xbox.2.Button.1".
I checked the settings for each HID plugin and they are each set to device index 0. Changing this value does not stick. If I set the device index to anything other than 0, apply the settings, click OK, then re-enter the plugin settings, it shows the device index as 0 again.
I'm running XP Pro SP3, and EG 0.3.7.r1194.
I addedd two Generic HID plugins to watch for XBox 360 controllers. One I set to device index 0 and event prefix "xbox.1", the other is set to device index 1 and event prefix "xbox.2". There is only one XBox 360 controller plugged in. When pressing button 1 on the controller I get two events, "xbox.1.Button.1" and "xbox.2.Button.1".
I checked the settings for each HID plugin and they are each set to device index 0. Changing this value does not stick. If I set the device index to anything other than 0, apply the settings, click OK, then re-enter the plugin settings, it shows the device index as 0 again.
I'm running XP Pro SP3, and EG 0.3.7.r1194.
Re: Multi Joystick PNP
Seems to be a bug. I will look into it the next days.deega wrote:I checked the settings for each HID plugin and they are each set to device index 0. Changing this value does not stick. If I set the device index to anything other than 0, apply the settings, click OK, then re-enter the plugin settings, it shows the device index as 0 again.