Skip to content

Alternate Input module for Kerbal Space Program

License

Notifications You must be signed in to change notification settings

jason-cech/AltInput

 
 

Repository files navigation

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...

About

Alternate Input module for Kerbal Space Program

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%