Xbox 360 Controller (XInput) plug-in

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
TheRetroPirate
Posts: 2
Joined: Thu Mar 06, 2014 9:32 pm

Xbox 360 Controller (XInput) plug-in

Post by TheRetroPirate » Fri Mar 07, 2014 12:07 am

Because I was not satisfied with the "Joystick" and "Generic HID" plug-ins in combination with my new XBox 360 controller I made an XInput plug-in for eventghost.
I use a wired controller but this plug-in should work with any XInput compatible controller, wireless or not.

To install just execute the script and it should install to your eventghost plug-in folder.

This plug-in requires "Xinput9_1_0" library which is shipped with Vista or newer versions of Windows.

Features:

Code: Select all

 - requires "Xinput9_1_0.dll" shipped with Windows Vista or newer
 - multiple controllers (up to 4)
 - supports buttons, triggers and analog sticks
 - analog inputs can be treated as buttons
 - deadzone handling
 - detects plug/unplug of controllers
 - adjustable polling rate
Best regards,
TheRetroPirate
Attachments
eventghost-xinput.py
(22.91 KiB) Downloaded 389 times

User avatar
zian
Site Admin
Posts: 552
Joined: Wed Jun 24, 2009 3:54 pm

Re: Xbox 360 Controller (XInput) plug-in

Post by zian » Sat Mar 08, 2014 5:17 pm

TheRetroPirate
Posts: 2
Joined: Thu Mar 06, 2014 5:32 pm

Good freakin' god I LOVE it when somebodies first ever post includes a plug in or some code or a killer idea etc.

Welcome to this place Retro.
and Thanks.

Ian
eventghost.net
Be there or be square.

User avatar
aireca
Posts: 14
Joined: Fri Mar 18, 2011 11:45 am

Re: Xbox 360 Controller (XInput) plug-in

Post by aireca » Wed Feb 11, 2015 12:49 am

Thank you very much for the plugin, any chance of getting the "Guide" button working with your plugin?

Here is some useful info:

Code: Select all

http://www.autohotkey.com/board/topic/96738-capturing-guide-button/

https://github.com/hrydgard/ppsspp/blob/master/Windows/XinputDevice.cpp
Thanks again.
./)_/). o O ( ? )
( O.o')
( > < )
^^^^^

themaster1
Experienced User
Posts: 132
Joined: Wed Feb 03, 2010 9:02 pm

Re: Xbox 360 Controller (XInput) plug-in

Post by themaster1 » Mon Apr 06, 2015 8:35 pm

I'd be curious to try this plugin but how do you "execute" this script exactly ? I mean it's a python script.
Please enlighten me

themaster1
Experienced User
Posts: 132
Joined: Wed Feb 03, 2010 9:02 pm

Re: Xbox 360 Controller (XInput) plug-in

Post by themaster1 » Thu Apr 09, 2015 10:57 pm

I've installed Python 3.5 (added to the "Path" aswell) but nothing happen with this script really, someone wake up from deep sleep and enlighten me THANKS

Numbernine
Posts: 1
Joined: Wed Nov 11, 2015 5:27 pm

Guide Button Support!

Post by Numbernine » Wed Nov 11, 2015 5:50 pm

Hello!

This is my first post, so I need to start by saying thanks to TheRetroPirate for their work writing this plugin - it is awesome and I love it. Thanks! :D

I, too, wanted to have access to the 'Guide' button on my XBox 360 controller via EventGhost, and using the links provided by aireca (thanks!) I've created a modified version of TRP's plugin that does just that. You can compare this new version of the script to the old one to see the differences, but they boil down to:
  • Adding a new event type, GUIDE_BUTTON, in the right locations.
  • Changing the DLL being loaded to the xinput1_3 DLL.
The second point is important: if you don't have xinput1_3.dll on your system, this updated version won't work (it should be installed as part of DirectX).

If you haven't installed this plugin previously:
  • Create a new directory under "C:\Program Files (x86)\EventGhost\plugins" named "XInput".
  • Place the script attached to this post in the new XInput directory.
  • Rename the script to "__init__.py" (without the quotes).
Restart EventGhost, add the XInput plugin, and you should be good to go. :-)
Attachments
eventghost_xinput_new.py
(23.35 KiB) Downloaded 230 times

User avatar
aireca
Posts: 14
Joined: Fri Mar 18, 2011 11:45 am

Re: Xbox 360 Controller (XInput) plug-in

Post by aireca » Mon Dec 14, 2015 12:15 pm

Thank you very much Numbernine. :D

Works fine on Win10 x64 and with the xbox one controller. :)
./)_/). o O ( ? )
( O.o')
( > < )
^^^^^

PooFox
Posts: 38
Joined: Sun Feb 14, 2010 6:18 am

If you're having trouble...

Post by PooFox » Sun Dec 20, 2015 8:59 pm

If the new plugin is not showing up for you, it may be that you already have the .py extension registered in windows, so renaming it to "__init__.py" actually results in a file called "__init__.py.py" (the repeated extension is hidden by the OS). Just rename it to __init__ instead, as the ".py" extension already exists (just hidden from view). This is why it wasn't showing up for me at first.

And thanks to the authors for the plug!!

Foune
Experienced User
Posts: 94
Joined: Sun Jul 03, 2011 7:08 pm

Re: Xbox 360 Controller (XInput) plug-in

Post by Foune » Sun Mar 11, 2018 8:46 pm

Thank you for this plugin which is perfectly working. Just one thing, the guide button won't trigger events in Eg by default in the last Windows 10 revisions : there is to disable the "Xbox One GameBar" menu : Clic on the "guide button" --> Game bar Settings -> uncheck "Open Gamebar using Guide button blah" (I don't remember exactly the name of the setting).

If you want to completely remove the microsoft xbox bloatware see https://www.windowscentral.com/how-disa ... ors-update

Then if you use steam you should disable the steam mapping on this button : launch big picture --> remote settings --> uncheck "The guide button opens Steam". You may need to repeat this for each xbox remote you have.

These tricks were tested on wired xbox 360 remote, wireless 360, and wireless One.

Image

Post Reply