Jump to content

How to modify settings.cfg for PPJoy in 1.0.2?


Recommended Posts

I'm trying to use PPJoy joystick remixer to force KSP to use a calibrated version of my joystick. I've done this long ago in a previous version, and this required editing settings.cfg to manually select the virtual stick. However, settings.cfg now uses a different format than was explained in the original thread on this matter ( http://forum.kerbalspaceprogram.com/threads/42683-How-to-fix-horribly-calibrated-Joysticks-in-KSP-(Workaround) ).

My settings.cfg now looks like this:


AXIS_PITCH
{
PRIMARY
{
name = Logitech Extreme 3D Pro
axis = 1
inv = False
sensitivity = 1
deadzone = 0.05
scale = 1
group = 0
modeMask = 7
}
SECONDARY
{
name = None
axis = -1
inv = False
sensitivity = 1
deadzone = 0.05
scale = 1
group = 0
modeMask = -1
}
}

I tried changing "Logitech Extreme 3D Pro" to "PPJoy Virtual Joystick 1" to match what it's called in Windows game controller configuration, but that just caused KSP to hang when I entered the settings page to look at it.

My settings.cfg from an older version of KSP looks like this:


AXIS_PITCH
{
name = VirY
id = joy0.1
inv = False
sensitivity = 1
deadzone = 0.05
scale = 1
group = 0
switchState = Any
}

As you can see, the joystick selection is done via the id setting, which doesn't seem to exist in 1.0.2.

As an aside... Why on Earth does Unity seem indifferent to calibration? To me that seems like a pretty glaring flaw...

e: There is also this, at the beginning of the control settings:


INPUT_DEVICES
{
Logitech Extreme 3D Pro = 0
}

I tried changing two things here. (1) I changed the 0 to a 1. (2) I changed it back to a 0, changed the name here and under the axis to the PPJoy name. Neither of these attempts panned out.

Edited by taylornate
Link to comment
Share on other sites

To give a bit of background, the problem is that Unity ignores the joystick calibration for some reason, making some joysticks unusable. I can't be the only one trying to work around it in 1.0. An official work-around would be lovely. It's really frustrating to not be able to use my joystick.

Link to comment
Share on other sites

This is a serious issue with Unity and it makes using certain joysticks a pain.

Along with proper dual screen support, I feel these are the last two things really holding back KSP.

Anyhow, I personally switched from PPJoy and GlovePIE to using vJoy and FreePIE for my Microsoft Sidewinder Force Feedback 2 and Saitek X-52 (throttle only).

I also use a small program called simFFB to keep my stick centered as there is no centering force present otherwise.

Uninstall PPJoy, get vJoy instead (no need to disable driver signing in Windows for vJoy), then create a virtual joystick.

You can set up your virtual stick with whatever physical input you want in FreePIE (in my case: X-Y-Z axes on the MSFFB2, throttle and small slider on the X-52 throttle) and bind axes directly in the KSP Input screen.

Sometimes KSP will pick up the physical axis instead of the virtual axis when you're binding it (e.g. "Microsoft Sidewinder JoystickAxis 1" instead of "vJoy Virtual JoystickAxis 1").

Just keep rebinding till it shows you the virtual axis (shouldn't take you more than one or two tries, otherwise something is wrong).

As for joystick buttons and POV hats, try to bind as few of them as possible within KSP. Instead, bind keyboard keys for default functions to buttons directly in FreePIE or some other programming software.

For example, the big button on my X-52 throttle "joystick[2].getDown(29)" is bound to "Key.M" and brings up map view. Much easier than getting KSP to recognise the joystick button in the Input screen.

The POV hat on my MSFFB2 directly triggers the up, down, left and right keyboard keys (for changing the camera angle in external views -- I use TrackIR for internal views).

vjoy

http://vjoystick.sourceforge.net/site/

FreePIE

http://andersmalmgren.github.io/FreePIE/

simFFB (for those using a stick with Force Feedback)

http://forums.eagle.ru/showpost.php?p=1394206&postcount=18

And here's the FreePIE code which I use (joystick[1] is the MSFFB2, joystick[2] is the Saitek X-52):

# KERBAL virtual joystick

from System import Int16

if starting:
system.setThreadTiming(TimingTypes.HighresSystemTimer)
system.threadExecutionInterval = 5
joystick[1].setRange(Int16.MinValue / 2.001, Int16.MaxValue / 2.001)
joystick[2].setRange(Int16.MinValue / 2.001, Int16.MaxValue / 2.001)

# map analogue
vJoy[0].x = joystick[1].x
vJoy[0].y = joystick[1].y
vJoy[0].z = -1 * joystick[2].z
vJoy[0].rz = joystick[1].zRotation
vJoy[0].slider = -1 * joystick[1].sliders[0]
vJoy[0].dial = joystick[2].sliders[0]

# map keys to buttons
keyboard.setKey(Key.NumberPadMinus, joystick[2].getDown(19))
keyboard.setKey(Key.NumberPadPlus, joystick[2].getDown(21))
keyboard.setKey(Key.M, joystick[2].getDown(29))

# map pov hats
keyboard.setKey(Key.UpArrow, joystick[1].pov[0] == 0)
keyboard.setKey(Key.RightArrow, joystick[1].pov[0] == 9000)
keyboard.setKey(Key.DownArrow, joystick[1].pov[0] == 18000)
keyboard.setKey(Key.LeftArrow, joystick[1].pov[0] == 27000)

# end of script

Edited by hellbender
Link to comment
Share on other sites

  • 4 months later...

So for those of us that don't program regularly or write scripts, would you suggest a tutorial or walk through explaining how to write and implement scripts like this in FreePIE?

I think your example has all I need to map what I need to map (for the X-55) but would also be interested in understanding what syntax etc. this script uses so I can write it properly.

Thanks!

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