Guide / Tutorial Relative KB&Mouse FAOFF Toggle - The Guide

Before starting, an big shoutout for the true MVP's who first develop, guided though and improved the script for FAOFF with KB'n Mouse, @CMDR Spadino (Big hug from Portugal) and @Vandaahl, and the other CMDR's who shared their questions/ideas ;3 o7

This guide will used an alter version of this script, Modified by me.
The thread can by found Here

Greetings CMDR's! Looking forward to start your career as an Professional FAOFF Racer / 藤原とうふ店 Boy / BEBOP without having to buy an EXPENSIVE HOTAS? Well today its your luck day, my friend!

I'm @jackblack_2001 and im going to teach you, step by step, how to do so.

In title of curiosity, i've started to play around with this in middle 2019, 2 years after the original Guide, and a few months before this Helli'sh Nightmare we're all living though, having to stop because of the studies, later on having completly FORGOR💀 about the subject :/

I hope this Guide Help'ya!

Post Production​

Don't ya forget to visit the "Trouble Shooting" area, where you can find pratical advise to any problem you may encounter ;3

Introduction​

The method im about to share with you is the culmination of several months of testing, bugfixing and, as said above, although this "project" was stored in an jar for a very long time, im glad i have finally made it work, and put it to practice! Since november 2021 until now, more than 3 months and more than 200 Hours, i have FAOFF'ed my way into the suberb Imperial Cutter, the imposing Federal Corvet, and the colossal Fleet Carrier, using only my Keyboard and Mouse.

2022, and this ANCIENT problem is still yet to be solved, we have two flight modes, but cant have different mouse configurations for each one..., but in other hand, hotas make soo much money for those in the industry, its a shame taking all of that away with an simple fix, given that your one of most hotas played and supported game, isn't it?

But lets cut right into the guide, cuz as you can see, i have a little of an burning passion for writing xD

Ingredients​

For this sweet sweet recipe, your going to need:
  • vJoy, an virtualJoystick. What? I never told ya we weren't going to use a HOTAS, but not an real one ;3
  • freePie, humm some delicious Pie to cover it up 🤤, this is the program that will be used to control the joystick.
  • The Script, its the "heart" of this recipe, without it, the cake is a lie.
Now that you have acquired the ingredients, lets bake them up

Start by installing the vJoy, after that open the "Configure vJoy" and set your joystick like this:

vJoy​

Config_vjoy.png

After configure the 1-5, apply the changes, then check the 6'th one.
  1. This program allows you to have up to 16 fully customisable virtual Joysticks! But for this guide, 1 is enough thanks.
  2. Here is where you configure the Axis you what to use, in the original guide, they used both Relative and Non-Relative X & Y axis, for us, X and Y, this is the way.
  3. Buttons, who doesn't like buttons? Go ahead, you can have 128 of them, that can be assigned to your actual kb, mouse, gamepad keys! Isn't that awesome?
  4. The digital joystick within the joystick, like the D-pad on Gamepads, not used at all in this situation.
  5. Like the sprinkles on top of an cupcake, this program allows you to add several effects to the Axis, although we ain't gonna use any of it, you got to admit, its pretty cool!
  6. The most important checkbox of all! If not checked, the virtual joysticks wont be "plugged".
Now its the time to configure the freePie program, and puting the script to good work:

freePie​

Once installed, you just have to load the script in the File > Open and then select the script
or
Just open it directly from the script, and them tell Windows to Open the ".py" file with freePie

To run the script just press the F5 key.

Now, although the script is well commented, we will see section by section what you most certainly want to change, always remembering that you are more than welcome to modify, add or remove anything from the script, and, "if you are feeling especially fantastic", you can even post here some of the updates/flaws/bugfixes you may discover ;3

The Script​

This section will adress mainly the different parts of the script itself, if you allready understand the code pass on GO and grab 200M

Set Globals​

In this first lines of code we declare your Globals, variables that are initialized first and dont change (with exeption of IsEnabled and mouseX, mouseY, mouseXcurved, mouseYcurved)
Python:
from System import Int16

#imported time library to use on headlook hotkey section down below (makes possible the use of sleep method)
import time

# set globals
if starting:
    isEnabled = True
    mouseX    = mouseY = mouseXcurved = mouseYcurved = 0
    MAX =  Int16.MaxValue * 0.5 + 0.5  #  16384
    MIN = -Int16.MaxValue *0.5 - 0.5   # -16384
 
    # Timer, for auto-centering
    system.setThreadTiming(TimingTypes.HighresSystemTimer)
    system.threadExecutionInterval = 1 # loop delay - controls how often the script updates -- 5 is fine, lower for more updates (1 = 1000 times per second, 2 = 500, etc.)
    device = vJoy[0] #Your divice, you have to change this according to your device index (the number of the device on the vJoy Config -1)
The only ones worth change are the device and system.threadExecutionInterval

Main Variables​

This is were you want to absolutely change something, this are the variables who will directly influence your "joystick" sensibility, and if it will have mouse acceleration(auto-centering) or not
Python:
    #-----------------------------------------------------------------------------------------------
    ABSOLUTE_SENSITIVITY = 28    # absolute mouse mode overall sensitivity.  Default: 28
    ABSOLUTE_CURVE = 1.0           # NON-ALTERNATE: The exponent for mouse acceleration.  Default: 1.0 = no acceleration.
    #-----------------------------------------------------------------------------------------------
    # Essentially, this acts as a "soft" deadzone while also helping you make precise movements for aiming.
    CENTERING_RADIUS = 1000   # Centering radius.  The actual radius will be less than this if ABSOLUTE_CURVE is greater than 1.0.  Default: 100
    CENTERING_SPEED = 1       # Linear centering speed.  MUST be less than ABSOLUTE_DEADZONE.  0 to this feature completely disable.  Default: 1
    #-----------------------------------------------------------------------------------------------
    # Essentially, this is mouse acceleration for the absolute mouse mode.
    USE_ALTERNATE_ABSOLUTE_CURVE = False         # The most important difference is that the non-alternate version can be configured to have no mouse acceleration at all.
    ALTERNATE_ABSOLUTE_CURVE_FACTOR1 = 0.5       # ALTERNATE: Essentially mouse acceleration.  Higher = faster movement. Default: 0.5
    ALTERNATE_ABSOLUTE_CURVE_FACTOR2 = 0.015625  # ALTERNATE: Essentially mouse acceleration.  Higher = faster movement. Default: 0.015625
    #-----------------------------------------------------------------------------------------------
    ABSOLUTE_DEADZONE = 2        # Recommended to not go below 2
    #-----------------------------------------------------------------------------------------------
    # Some idiot checks
    # Idiotic, but rather functional... ;3
    if (ABSOLUTE_DEADZONE < 2): ABSOLUTE_DEADZONE = 2
    if (CENTERING_SPEED >= ABSOLUTE_DEADZONE) or (CENTERING_SPEED < 0): CENTERING_SPEED = ABSOLUTE_DEADZONE - 1
    ABSOLUTE_CURVE_RATIO = (MAX ** ABSOLUTE_CURVE ) / MAX   # NON-ALTERNATE: not intended to be modified
    flip = True

Code that do all the hard work​

Then you have the main code, who will make everything work properly, we will pass that
Python:
def getClamped(val):
    if (val > MAX): val = MAX
    elif (val < MIN): val = MIN
    return val
 
def getCentering(val):
    if (val < CENTERING_RADIUS) and (val > 0): val -= CENTERING_SPEED
    elif (val > -(CENTERING_RADIUS)) and (val < 0): val += CENTERING_SPEED
    return val
 
def getAbsoluteCurve(val):
    val2 = 0
    if (val > 0):
        val2 = math.floor((val ** ABSOLUTE_CURVE) / ABSOLUTE_CURVE_RATIO)
    elif (val < 0):
        val = -(val)
        val2 = -(math.floor((val ** ABSOLUTE_CURVE) / ABSOLUTE_CURVE_RATIO))
    return val2
 
def getAlternativeAbsoluteCurve(val):
    val2 = 0
    if (val > 0): val2 = math.floor((math.sqrt(val ** 3) * ALTERNATE_ABSOLUTE_CURVE_FACTOR1) * ALTERNATE_ABSOLUTE_CURVE_FACTOR2)
    elif (val < 0): val2 = math.floor(-abs(math.sqrt(abs(mouseX ** 3)) * ALTERNATE_ABSOLUTE_CURVE_FACTOR1 ) * ALTERNATE_ABSOLUTE_CURVE_FACTOR2)
    return val2
 
if (isEnabled):
    # get change in mouse position, multiply by sensitivity setting, and then clamp the values to those supported by the joystick device
    mouseX  += mouse.deltaX * ABSOLUTE_SENSITIVITY   # absolute mouse
    mouseX  = getClamped(mouseX)
    mouseY  += mouse.deltaY * ABSOLUTE_SENSITIVITY
    mouseY  = getClamped(mouseY)
 
    ############################ Absolute Mouse
 
    mouseX = getCentering(mouseX)
    mouseY = getCentering(mouseY)
 
    if (USE_ALTERNATE_ABSOLUTE_CURVE):
        mouseXcurved = getAlternativeAbsoluteCurve(mouseX)
        mouseYcurved = getAlternativeAbsoluteCurve(mouseY)
    else:
        mouseXcurved = getAbsoluteCurve(mouseX)
        mouseYcurved = getAbsoluteCurve(mouseY)
 
    device.x = filters.deadband(mouseXcurved, ABSOLUTE_DEADZONE)
    device.y = filters.deadband(mouseYcurved, ABSOLUTE_DEADZONE)
 
 
    ################################ Watch (debug)
    diagnostics.watch(device.x)
    diagnostics.watch(device.y)

Utility Mounts​

This is another portion of code you have to change, in this section, we set some helpers to freeze the joystick for routine tasks, you certainly will not like to go to you galaxy map, and then find your beloved Beluga doing circles in the middle of an busy station... I swear it only have happened once, or twice...
Python:
# Fixes drifting when using headlook key (my headlook key is: The middle mouse Button)
if mouse.middleButton: #if you're using an keyboard key, use --> keyboard.getPressed(Key."Your key here (Ex: NumberPad1)")

    #if you are using an KB Key delete the "time.sleep" line (this comments are useless to :3)
    #This timer is for the script "accept" my key, cuz for some reason its triggered every ms when pressed
    #The optimal is 0.4
    time.sleep(0.4)
 
    if isEnabled:
        isEnabled = False
   
    else:
        isEnabled = True
        #If you want to center your ship after using headlook, uncomment this line
        #mouseX = mouseXcurved = mouseY = mouseYcurved = 0
 
        mouseX  -= mouse.deltaX
        mouseY  -= mouse.deltaY
 
#diagnostics.watch(isEnabled)
 
#Same as the headlook HotKey, for -->
#Steam Overlay
if keyboard.getPressed(Key.F9):
 
    if isEnabled:
        isEnabled = False
    else:
        isEnabled = True

#Discord Overlay
if keyboard.getPressed(Key.F10):
 
    if isEnabled:
        isEnabled = False
    else:
        isEnabled = True

#Galaxy Map
if keyboard.getPressed(Key.NumberPadEnter):
 
    if isEnabled:
        isEnabled = False
    else:
        isEnabled = True

#System Map
if keyboard.getPressed(Key.NumberPadPlus):
 
    if isEnabled:
        isEnabled = False
    else:
        isEnabled = True
 
# When leaving the station, press this key to center. Does the same as above, but doesnt mess up with the Flight Assist key
if keyboard.getPressed(Key.V):
    if not isEnabled:
        isEnabled = True
    mouseX = mouseXcurved = mouseY = mouseYcurved = 0
 
# Centers mouse when switching to FA-On from FA-Off (my FA-on/off key is: CapsLock)
if keyboard.getPressed(Key.CapsLock):
    mouseX = mouseXcurved = mouseY = mouseYcurved = 0
    # This line is an Auto-AlternateFlight-Changer, so when you press the FA key, automaticly it changes to the right one
    # **Disclaimer** You will have to manualy switch to absolute mode upon reopening the game, using your in game key
    keyboard.setPressed(Key.Tab)
The last two if's are the most important ones, the first is a safety reset that will center your joystick when pressed, and the 2nd one will automatically change flight modes when the FAOFF key is pressed!

Thats it, your mouse is now an joystick!

Final conclusions (for The Script Section)​

As once said by one of the smarter persons on Earth:
"It just works" - Todd Howard
this meaning that although this script can do his job by itself, its far from perfect, which means that anyone can improve it.

One example, for all those who like PvP'ing, you can make so when managing your Pips, you only have to press one button for the most efficient pip config. There are many, many more.

Let's jam​

Everything is taking care of, its finally the time to make this work.

First we have to start the script, get used to it, because for now on, this Is your joystick, without it you wont be able to play properly.

Now lets open the game shall we?

Now go to options, and before continuing let's discuss the plan:
We have, as said before, 2 flight controls, the "normal one", basically mouse'n Keyboard config, and the "Alternate Flight Controls", for the configuration of an joystick, i think you know where this is going :D
We will Uno reverse card the two controls! making your actual mouse configuration be the FAOFF one, and transforming our "joystick" in the FAON controller.
To do so, i recommend the creation of an new custom preset, just copy and rename the preset you're already using, if you don't know how watch This video.

Now back into the game, and starting with our actual mouse:
Mouse_Controls.png

Change both relative mouse X and Y axis, adjust the RM rate, and voilà, you are Green for FAOFF!

Now lets focus on the Alternate one:
Alternate_Flight_controls.png

Here we just have to assign an key to toggle between the controls, and assign to the Pitch and Yaw axis (Y and X) the corresponding joystick axis, moving your mouse up/down for the X axis and left/right for the Y axis

Enter an tutorial mission and test it out, you will most certainly have to adjust some of the parameters until you feel comfortable with the result.

And that's it! Congratulations my fellow CMDR, you have successfully made the impossible happen! You have now the confort of the FAON Driving, with the precision of the FAOFF Flight ;3

Keep in mind, as mention above, that for this to work you will now depend on the vJoy + freePie symbiosis, you will have to add one more task to your routine, but gad dang'it if isn't worth it xD

Time for some Polish​

Lets discuss some little details that make a huge diference on the long run...

That little square in the middle of the screen​

This one had catch me too, i never cared about this little friend, but, when things go wrong, is when we missed them
little_square.png

Given that the FAON Driving is made with an "joystick", but we are still using the mouse to do so, this creates an disturbing vision, as we move the mouse, in wich we still see the arrow, that is constantly centering, causing confusion to the pilot, even now, after more than 200 Hours of play testing, i find my self looking to the ship position in the right to guide myself in time to time.

You can deactivate this in the settings, but doing so, you lost the center of your ship, it's an tough decision...

What about the SRV attack on the Settlement?​

We cant forget to talk about our little space buggy!
There isn't much to talk actually, he have his own key binding map, lucky guy...

I sincerely don't have much more to say, so it's up to you, yes you who are wasting your time reading this, to discover new holes in the jacket, so we can patch them up together!
Next topic

Trouble Shooting​

Its time to solve our problems in the American way, throwing hight velocity lead projectiles into our problems face's 🤠

The game doesn't recognize the joystick (
sadness.png
)​

I myself had struggled a lot with this problem, and the solution is easer than you think. If you, just like me, happened to be an Steam User, congrats here is your Lead
Basically the steam was a built in "emulator" for all kinds of gamepads, joysticks, etc, also know as Steam Input, just go to Library > Elite Dangerous > Settings > Properties > Gamepad/Controller and then disable the Steam Input. ⚠️Task Failed Successfully!⚠️

Humm, The ship does't move :mad:

First of all, see if you have switch to the Alternate Flight Mode, if your answer has yes, well, its time to shoot some troubles ;3:
  • First of all, see if the vJoy Most Important Checkbox of all™ is checked;
  • If is indeed checked, see if you have the freePie program open(sometimes even i tink its minimized and then i realize that i have FORGOR💀 to open it);
  • Start the script, see if you ear any alarm sounds from the Programmer's Venerator Class Star Destroyer, also know as Destroyer of Dreams AKA Exeption Listener (⚠️Error)
  • If all signals Green, next you want to check you script's parameters of the joystick sensitivity, for that you have the "👓Watch" tab on the bottom (go to Views tab if there is none), if there are updating, it means the problem is not from neither one of them.
  • Last Resource, use if nothing else worked, go to the folder where your keybinding is located
    C:\Users\YourUser\AppData\Local\Frontier Developments\Elite Dangerous\Options\Bindings
    and check for any error, if there is none, go back to the game and check the Controls, see if your keybindings are correct, if so, its time to use the Ultra Secret Only-In-Despair, The Last of the LAST Resources!Click Apply and see it was fixed... That was depressing, but it actually works...
Im out of bullets here private, you will have to save you own butt.

The joystick as gone RNG crazy Man!​

This is actually not an Trouble Shooter, is a real concern, and you are right to feel Fear of it...
As you should probably know, the freePie is an program like any one else. And you probably also know what the Windows garbage Collector is, if you don't, i will resume for you:
As you use the computer, the existing programs, also know as processes, fight for an space in the Ram, and like "The hunger Games", the windows is the Referee who can literally decide who lives, and who is Killed, as well decide the priority of any given process, and there you find the problem, and also the solution:​
  1. Open an empty .txt file and write this line of code --> Start "Yourscript.py" /high C:\Users\User\TheLocationOfYourScript;
  2. Save as .Bat;
  3. From now on, that's what you are going to use to run the script :3;
What you have just done was telling Windows to Start this process an VIP Lvl 4 Pass, witch will need an SU(Admin) authorization, but in this way the OS cant downgrade your process Level :3. Because the User has always control over the OS... For now...

Conclusion​

I hope this guide help's you, as a pilot, and as an CMDR, to give you the Keys to a whole new sea of possibilities, but remember, my fellow commander, that Practice leads to Perfection. There is no other way to succeed in life, you have to take a beaten, stand up, and try again, doesn't matter who or what are you fighting. But something you must never forget, don't let others change who you really are...

Wow, how time flies! It's been an entire day fo me writing this guide... Get this man a job XD

Nevertheless, it was a pleasure, this is in fact my first, none native language guide ever! And i really hope this guide helps any CMDR who, just like me, want to genuinely earn their Wings, as a pilot.

Fly safe commanders,​
See you in space Cowboy...​
 
Last edited:
very nice. i had been messing with the info in the original post over the past week.

strange coincidence to run have you post this now and for me to actually see it.
 
DOwnlaoded and isntalled vjoy but the step 6 button (enable) is not showing and my config window is different (64 bit).
Hello @Hangerhead, thank you for seeing this guide in the first place!

So, is the "enable" checkbox grayed out, or simply is not there?
And for the program architecture mine is also x64 bit, the x86 folder exists, but inside there are only dll's, also mentioning that vJoy was more than one tool (4 to be exact):
- "JoyMonitor.exe" → An tool to see all the axis/bottons inputs;
- "vJoyConf.exe && vJoyConfig.exe" → what you are looking for, bouth exe are the same, the only difference is that one is the compiled exe, and the other opens it via cmd... Strange 🤔;
- "vJoyFeeder.exe" → allows you to send input to the vJoy, testing purposes only.
- "vJoyList.exe" → is in the name, it lists all you vJoy's in one place;

Ps: i didn't have mentioned in guide, but upon the fist time installing the vJoy, you will have to add an new vjoystick, clicking in the "Add Device" button, if you don't do that the program will not let you modify the parameters.

Hope it was helped!

If ya have any other questions feel free to share ;3
 
Last edited:
it's also not saving any of the changes I'm making to try to match with yours. I'll do a restart and check.
You're totally right, they have updated the program, i wasn't aware of this :/

I have now tried to install it, but every time, at the end of the installation it says that "installation failed", when i open the program, it seems to be completely broken (i was able to make it spit out an internal error log, just for pressing enter in an input box xD).

But dont worry, i found the problem, im Updating the vJoy Link, apparently there are 2 versions of the software, i will put the direct link to the Sourceforge.

Im sorry for this mess, it really caught me of guard :/

I will ps after changing the link
 
Ps: link updated, just download and install;

The other software, in my experience at least, does not have an entry on the Windows uninstalling list, you'ill have to uninstall it from the program files :/, also, seek in the Device Manager for the Driver itself, under the "Human interface Devices", it is called "vJoy Device". If nothing is there i think you're good to go!

Glad to help ;3
 
Sorry to revive an old forum. I have searched and searched but cannot find an fix for my issue. It was working great yesterday. But when I tried today if I turn on alternate flight controls to use the vJoystick, it registers as if the stick is stuck imputting a direction. If that does not make sense please let me know and I can try to better explain.
 
Hi @Ahckerman, im sorry for the late reply, i havent been in the forums for quite some time now :)

So, you're saying that is like the vjoy is "Stuck", that can happen for a number of reasons:
  • If for some reason the script crashes/freezes, it can assume the last known value, leading to it beeing stuck;
  • If you by mistack "switched" the modes, like, if you exit the game in faoff, and then reenter, but the script is set to normal, when you switch to faon, naturaly, the modes will be wrong, and the ship wont move, and vice-versa, that can happen a lot when you are in stations and carriers o_O;
  • Im aware that some times the vjoy driver can also go nuts, but fortunaly never happend to me :D;
hope this can help, and once more, sorry for the late reply.
Hope this finds you well, and remeber, fly safe Cmdr o7
 
Back
Top Bottom