Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Happy Holidays from the GTANet team!

[BETA] xBox GamePad support for .NET scripthook


pedro2555
 Share

Recommended Posts

As of now, I am not able to test this out using neither the xBox 360 controller or GTA IV. And, thus, this stands for beta state for now. (Next week, I will have time for that. Hope you guys can help me finish this) But I do think it is working out of the box.

 

This is for script developers only.

 

This library enables access to multiple xBox 360 controller information, using .NET events. It takes care of all polling for you.

 

For example, the button A press can very easily be subscribed like any other .NET event

 

 

using XInputDotNet;...XboxController.OnAButtonUp += XboxController_OnAButtonUp;...static void XboxController_OnAButtonUp(object sender, EventArgs e){}

 

 

You can subscribe to any controller change (apart from battery level changes, as of now), also you can access button states directly trough boolean variables, trigger axis values can be accessed via properties. All other changes require event subscription.

It is also possible to send a specific motor vibration to the controller.

All members are static, but you must call (and preferably check if it returns true) the LoadController method when your script loads.

 

You can download the required files from here

 

The zip package includes SlimDx.dll and XInputDotNet.dll, in theory you SHOULD only add as a reference to your project XInputDotNet.dll. For running with GTA IV, both SlimDx.dll and XInputDotNet.dll should be placed in GTA root folder, because they are loaded by scripthook. Hopefully this does not require the installation of SlimDx SDK for development. Not sure about 64bit OS, since I am working on 32bit (weird, isn't it?). and SlimDx does make a difference, XInput doesn't, but who knows.

 

No bug report system, but since this is for developers, I think this thread does the job. Hope I can play some more GTA mods with no keyboard at all.

 

When finished, source code will be available.

 

Doing this with 26 hours awake, as of now.

Edited by pedro2555
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.