Jump to content

[1.8.1] [Linux] [WIP] Advanced Input 0.2.0


taniwha

Recommended Posts

NOTE: This mod is currently Linux-only, but only because I do not how to do low-level input programming for Windows or Mac. PRs welcome.

Download: Advanced Input 0.2.0

Source (LGPL): github

Advanced Input (AI)  is a mod to provide finer control over bindings for joysticks and potentially other devices (eg, 3d moused (basic support is there, but untestested)).

WARNING: Unity joystick input on Linux is highly fickle:

  • On KSP 1.3.1, Unity will crash (sometimes) when pressing certain buttons (ie, numbered 20+) on devices with many buttons (eg, Saitek X52 (this took me months to figure out)). Status unknown for later versions.
  • On KSP 1.5.1, Unity crashed at startup just reading the name of my Thrustmaster t16000m (or maybe my Thrustmaster TWCS Throttle, they are separate devices). sStatus unknown for other versions.

It is strongly recommended that Unity be denied access to /dev/input/js*. Advanced Input uses /dev/input/event* so just making the js devices unreadable is sufficient.

Non-features:

  • Bindings are loaded when KSP loads, meaning changes require a restart (this is a bug and pretty much at the top of my list).
  • The user interface currently only shows status of inputs and cooked outputs.
  • No support for Windows or Mac.
  • While bindings can be grouped in sets, the lack of a usable user interface has stalled the development.

Features:

  • Modular bindings: both axis and button bindings use simple modules to do the work. AI searches all loaded assemblies for classes that implement the appropriate interface (axis or button) meaning other mods can provide bindings for their functionality.
  • Bindings are loaded from config files in the standard KSP config format (same as part.cfg, persistent.sfs etc) living in AI's PluginData directory.
  • Input devices are recognized by their device name (this can cause problems if two of the same device are connected).
  • Input device axes and buttons can be named via config files (this is for the user interface).
  • Axes have recipes stating whether they are balanced or unbalanced (-1..1 or 0..1), inverted, their deadzone and "maxzone" (a deadzone near +/- 1 instead of 0).
  • Axis bindings have their own inverted flag (good for when an axis is multiply bound and sometimes needs to go one way and other times needs to go the other), as well as a power curve setting (ie, produce non-linear control).
  • Button bindings for action groups (custom or standard (Brake etc)) support mutiple modes:
    • hold: action group is active while the button is pressed (eg B for the default brake binding)
    • toggle: action group turns on if off or off in one when the button is pressed (eg, T, U, G R for SAS, Lights, Gear and RCS)
    • edgetoggle: action group inverts its status while the button is held (eg F for inverting SAS)
    • off: pressing the button always deactivates the action group
    • on: pressing the button always activates the action group
    • trigger: pulses the action group on then off in a single frame
  • Respects input locks
  • Device hotplug. No need to restart KSP just because you forgot to plug your joystick in.

Currently supported axis bindings:

  • LinearBrake
    • of course, no longer linear with a power curve
    • current control reference is used for determining which wheels are left, right or center, with +/- 5cm leeway for center.
    • supports differential braking
      • left: wheels to the left of center get full braking, center gets average of left and right
      • right: wheels to the right of center get full braking, center gets average of left and right
      • center: all wheels get full braking
    • activates brake line on wheels that have one when braking input is is non-zero
    • supports the brake tweakable
  • MainThrottle
  • Pitch, PitchTrim
  • Roll, RollTrim
  • ThrottleIncrement
  • WheelSteer, WheelSteerTrim
  • WheelThrottle, WheelThrottleTrim
  • X, Y, Z
  • Yaw, YawTrim

Currently supported button bindings:

  • Abort
  • Brake
  • CustomAction
    • which group (1-10 (10 is 0 on the kb) specified by 64 << N (1 = 128, 2=256, 3=512...)
    • should work with action group mods
  • Gear
  • Lights
  • MainThrottleLock
    • allows moving an analog throttle without affecting the game's throttle setting.
  • SAS
  • Stage
  • TranslateBack
  • TranslateDown
  • TranslateForward
  • TranslateLeft
  • TranslateRight
  • TranslateUp
  • WheelThrottleLock
    • allows moving an analog throttle without affecting the game's throttle setting.
Edited by taniwha
Link to comment
Share on other sites

  • 10 months later...

I have released version 0.2.0 of Advanced Input, updated for KSP 1.8 (built and tested against 1.8.1).

Changes from 0.1.0:

  • Updated build etc for KSP 1.8
  • Support for axis groups (feeds directly to the system).
  • Range check axis recipe axis number

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...