GithubHelp home page GithubHelp logo

josipnizetic / altinput Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pbatard/altinput

0.0 0.0 0.0 917 KB

Alternate Input module for Kerbal Space Program

License: GNU General Public License v3.0

C# 100.00%

altinput's Introduction

AltInput โ€” Alternate Input plugin for Kerbal Space Program

Note: Pre-compiled binaries for this plugin can be found at http://ksp.akeo.ie/downloads/AltInput

Description

This module provides an alternate input method for Kerbal Space Program.

Currently it only does so for DirectInput Joysticks, and as such will only work on Windows. But it could be extended to support any other kind of input.

IMPORTANT: This module provides its OWN version of the SharpDX DLLs, due to a BUG in the Unity engine. If you try to deploy with the standard version of SharpDX, it WILL NOT WORK!

Compilation

  • Open AltInput.csproj with a text editor and update the following section according to your path:
  <PropertyGroup>
    <KSPPath>E:\Program Files (x86)\Steam\SteamApps\common\Kerbal Space Program</KSPPath>
  </PropertyGroup>
  • Open the project and compile. If you edited the KSPPath variable above, all the required module files will be copied automatically.

Usage

  • If needed, copy AltInput.dll, SharpDX.dll and SharpDX.DirectInput.dll into the KSP Plugins directory (typically C:\Program Files (x86)\Steam\SteamApps\common\Kerbal Space Program\Plugins)
  • Copy the whole PluginData directory to the same directory where you copied the DLL files and if needed, edit PluginData\AltInput\config.ini according to your settings.
  • Play. ;) If your joystick is properly configured, you will get a notification (in the upper left corner) and you should be able to use it to control the ship. Or, if you need to create a new entry, you will also be able to find the name you should use to create a new controller section.

Configuration

All configuration is done in PluginData\AltInput\config.ini

The following DirectInput controls, if present, can be assigned to Vessel Control. These are the names you should use for Control when adding a Control = Mapping line in your config file:

  • AxisX
  • AxisY
  • AxisZ
  • RotationX
  • RotationY
  • RotationZ
  • Slider[1-2]
  • Button[1-128]
  • POV[1-4]

Anything that isn't in the list above is not handled.

The following KSP actions can be mapped to an input. These are the names you should use for Mapping when adding a Control = Mapping line in your config file:

  • yaw
  • pitch
  • roll
  • mainThrottle
  • wheelSteer
  • wheelThrottle
  • X - Translation X
  • Y - Translation Y
  • Z - Translation Z
  • toggleAbort
  • switchMode - switch input mode(Flight/AltFlight/Ground). This effectively means that the relevant [input#.] section is used for the controls. Note: 'Ground' mode only becomes available if the craft is landed or splashed.
  • activateBrakes
  • toggleBrakes
  • activateCustom[01-10]
  • toggleCustom[01-10]
  • toggleGears
  • toggleLights
  • overrideRCS
  • toggleRCS
  • overrideSAS
  • toggleSAS
  • activateStaging
  • switchView - Switch camera view (auto/free/orbital/chase)
  • toggleMapView - Switch between Map view and Staging/Docking view
  • toggleNavBall
  • increaseWarp
  • decreaseWarp
  • killThrottle
  • fullThrottle

Anything that isn't in the list above is not handled.

How do I find the names I should use for my controls?

The control names should follow what Windows report when checking your game controller properties. For instance, using Windows 8, if you go to Device and Printers you should be able to access the Game controller settings menu by right clicking on your device. Then, if you select Properties, you will be presented with a dialog where all the buttons and axes your controller provides are labelled. Matching these names with the ones from the first list above is then a trivial matter.

Hint: You can also easily identify which button is which in this dialog by pressing them and writing down the number that gets highlighted then.

FAQ

Why don't you use use Unity's Input, instead of reinventing the wheel?

Unity's Input doesn't support POV (Point of View) hats. At all. Also it uses DirectRaw to access controllers, which is super sucky. And you can also forget about using a slider to control a throttle with Unity's Input.

The Unity developers have repeatedly indicated that they have NO INTENTION of addressing these serious shortcomings, so this leaves very little choice...

altinput's People

Contributors

pbatard avatar enodatio avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.