Jump to content

Keyboard Throttle Solution


DuckyLucky

Recommended Posts

Here is a solution for those who prefer to use the keyboard for throttle control. No need to purchase a hardware joystick/throttle if you don't have one! Note that this solution will require you to download, install and configure a few pieces of free software (see Download and Install the following free Software below). You will also need to modify keyboard assignments in FSX.

Note 1: in order for this solution to work there must be NO HARDWARE JOYSTICK/THROTTLE plugged in.

Note 2: the required modifications to your FSX keyboard assignments will affect ALL aircraft - not only Airbus X. This is not a problem if you run the script every time you fly (recommended) or if you are okay with the new assignments.

Download and Install the following free Software

--------------------------------------------------------------------------------

1. PPJoy (Virtual Joystick Driver) (info)

After you download and install PPJoy, you must run the Configure Joysticks utility to add a virtual joystick. Ensure you choose "Controller 1" .

2. AutoHotkey (Scripting Utility for Controlling Input Devices) (info)

Straightforward - just download and install

3. AutoHotkey-PPJoy Library (Allows AutoHotkey to talk to PPJoy) (info)

After you download the zip file, unzip it to a folder on your desktop then just copy the PPJoy.dll and Lib folder to the same folder that AutoHotkey.exe is installed (eg. C:\Programs Files\AutoHotkey\) .

Create the Script

------------------------------------

Next create the script that will enable the custom keyboard throttle functions within FSX. Copy/cut the following code below then open notepad text editor and paste the code. Save the file anywhere you wish and name it "PPJoy Throttle.ahk". After saving, execute it!



#NoEnv	; Recommended for performance and compatibility with future AutoHotkey releases.

SendMode Input	; Recommended for new scripts due to its superior speed and reliability.

SetWorkingDir %A_ScriptDir% 	; Ensures a consistent starting directory.


#Persistent

#InstallKeybdHook


OnExit, ExitHandler


FullFwd := 0

Idle := 100


Step := 1

ThrottleAxis := 3

Pos := Idle


#IfWinActive, Microsoft Flight


; Keyboard Throttle

PPJ_Init() 	; Grab the Joystick

PPJ_SetAxis(ThrottleAxis, Pos)


$F1::

	if (Pos < Idle)

		return

	Send {F1}

	return


~F2::

	Pos := Idle

	PPJ_SetAxis(ThrottleAxis, Pos)

	return


F3::

	Pos += Step

	if (Pos > Idle)

		Pos := Idle

	PPJ_SetAxis(ThrottleAxis, Pos)

	if (Pos = Idle)

		Send {F2}

	return


$F4::

	Pos -= Step

	if (Pos < FullFwd)

		Pos := FullFwd

	PPJ_SetAxis(ThrottleAxis, Pos)

	if (Pos = FullFwd)

		Send {F4}

	return


ExitHandler:

	PPJ_Term() 	; Release the Joystick

	ExitApp


#IfWinActive

Here are the actions the script assigns to funcction keys F1..F4:

F1 - Throttle reverse thrust (Note that F1 is used only for engaging thrust reversers. It will have no effect unless throttles are first moved to idle)

F2 - Throttle cut (i.e. Idle thrust or disengage reverse thrust)

F3 - Throttle decrease thrust (does not allow you to enter reverse range. Instead, use F1 to engage reverse thrust. See F1 above)

F4 - Throttle increase thrust

You will also need to modify assignments within FSX's controls options. In FSX go to SETTINGS -> CONTROLS -> BUTTONS/KEYS:

F1 - Throttle (decrease quickly)

F2 - Throttle (cut)

F3 - Throttle (decrease)

F4 - Throttle (increase)

Link to comment
Share on other sites

  • 2 months later...

Hi Andrey

Yes the script is working for me. If you can post some screenshots of your setup maybe I can figure out what went wrong. I would need to see screenshots of the following :

1) Your PPJoy configuration - Start Menu -> Programs -> PPJoy Joystick Driver -> Configure Joysticks

2) Your FSX controls settings - In FSX go to SETTINGS -> CONTROLS -> BUTTONS/KEYS

3) Your running AutoHotkey session - double-click the AutoHotkey tray icon

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

Even I tried this but no luck, the F4 key is moving the throttle smoothly, it is stuck . Please Help !!!!!!!

Thanks

Udit Kalia

Hi Udit

I need some more information. If you can post some screenshots of your setup maybe I can figure out what went wrong. I would need to see screenshots of the following :

1) Your PPJoy configuration - Start Menu -> Programs -> PPJoy Joystick Driver -> Configure Joysticks

2) Your FSX controls settings - In FSX go to SETTINGS -> CONTROLS -> BUTTONS/KEYS

3) Your running AutoHotkey session - double-click the AutoHotkey tray icon

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

this evening I'll give the procedure a try. In case it worked, is there any chance to set the F1, F2, F3, F4 to default FSX ones ? .. . therefore F1 cut, F4 full, F2 and F3 decrease and increase respectively.

I am reading here almost no feedbacks, does the above procedure work guys ?

Thx

Link to comment
Share on other sites

I have followed the instructions but when I launch the Configure Joystick my w7 tells me : " Cannot open the PPJoy Device driver, please install PPjoybus.sys first... ???

Any hints please ?

Link to comment
Share on other sites

I have manged to fix the problem above but to no avail, throttle is always stuck.......

How about to release a patch ? I consider the throttle quite important in a plane, like wings and engines, if one of this components does not work, well, the plane becomes difficult to fly...you know what I mean....

Link to comment
Share on other sites

The script where has to be launched ? Within the OS or within another software example Hotkey ?

In case it was Hotkey the correct environment , where are please the instructions on how to use that script within Hotkey software ?

Thanks in advance about the details

Link to comment
Share on other sites

  • Aerosoft

I have manged to fix the problem above but to no avail, throttle is always stuck.......

How about to release a patch ? I consider the throttle quite important in a plane, like wings and engines, if one of this components does not work, well, the plane becomes difficult to fly...you know what I mean....

The problem is that we do not really know what to fix. We created he system to work on a standard FSX where the throttle channel can be intercepted and interpreted differently. Now some people do not let FSX handle the joystick axis (for example using FSUIPC) or have joystick drivers that send multiple channels for the same axis. Some people also do not have a throttle (even though it simply is part of the product requirements).

System requirements:

Microsoft Flight Simulator X (SP2, Acceleration or Gold Edition)

Windows XP / Vista (32Bit or 64Bit) / Windows 7 with the latest Service Packs

Microsoft Visual C 2005 SP1 Redistributable Package

Microsoft Visual C 2008 SP1 Redistributable Package

Intel Core 2 Duo CPU (2x 2666Mhz) or equivalent (Core 2 Quad CPU recommended)

2 GB RAM

DX9 Graphic Card with at least 256 MB (512 MB highly recommended)

Mouse with mouse wheel

Joystick with throttle (The systems expect the default FSX throttle axis to be used)

Download-Size: 240 MB

Installations-Size: 500 MB

Link to comment
Share on other sites

The problem is that we do not really know what to fix. We created he system to work on a standard FSX where the throttle channel can be intercepted and interpreted differently. Now some people do not let FSX handle the joystick axis (for example using FSUIPC) or have joystick drivers that send multiple channels for the same axis. Some people also do not have a throttle (even though it simply is part of the product requirements).

System requirements:

Microsoft Flight Simulator X (SP2, Acceleration or Gold Edition)

Windows XP / Vista (32Bit or 64Bit) / Windows 7 with the latest Service Packs

Microsoft Visual C 2005 SP1 Redistributable Package

Microsoft Visual C 2008 SP1 Redistributable Package

Intel Core 2 Duo CPU (2x 2666Mhz) or equivalent (Core 2 Quad CPU recommended)

2 GB RAM

DX9 Graphic Card with at least 256 MB (512 MB highly recommended)

Mouse with mouse wheel

Joystick with throttle (The systems expect the default FSX throttle axis to be used)

Download-Size: 240 MB

Installations-Size: 500 MB

I suggest to let your products use 100% what FSX uses, if FSX use a keyboard your products must use it as well, if FSX uses a external controller your products must use them as well, if FSX uses a Kinetic controller ( ! ) 3rd party add ons must use them as well.

Diversions from this rule will lead into lot of tech/marketing troubles IMHO.

Link to comment
Share on other sites

The script where has to be launched ? Within the OS or within another software example Hotkey ?

In case it was Hotkey the correct environment , where are please the instructions on how to use that script within Hotkey software ?

Thanks in advance about the details

Hi emmeth

Yes, the script must be run within the AutoHotkey environment. You need to save the script as a text file:

  1. Right-click an empty spot on your desktop or in a folder of your choice.
  2. In the menu that appears, select New -> AutoHotkey Script (this menu will appear only if AutoHotkey is installed). (Alternatively, select New -> Text Document.)
  3. Type a name for the file, ensuring that it ends in .ahk. For example: Test.ahk

Note that renaming file extensions in windows can be tricky. Please follow the procedures here to ensure the file extension was renamed properly.

is there any chance to set the F1, F2, F3, F4 to default FSX ones ? .. . therefore F1 cut, F4 full, F2 and F3 decrease and increase respectively.

Yes. It would require changing the keys in the script to match your FSX configuration. I will make the necessary modifications and post them a bit later.

Link to comment
Share on other sites

Hi,

your explanation is as complete as detailed but still It doesn't work for me.

For example, once everything is up and running ( installations, configurations, script within Hotkey etc etc.. ) do I have to see the virtual joystick under the section " Device and Printers " of W7 64 ? I don't, hence I can't calibrate it and therefore, I suppose, FSX can't recognize there is a ( virtual ) joystick to use and therefore all the stuff doesn't work into FSX. ( I guess )

The script is properly named and properly loaded into the Hotkey software. It took also the icon with the " H " in it.

Only the reverse function is recognized into FSX, using the keyboard.

Any help is really much appreciated.

Thanks in advance

Link to comment
Share on other sites

Hi,

your explanation is as complete as detailed but still It doesn't work for me.

For example, once everything is up and running ( installations, configurations, script within Hotkey etc etc.. ) do I have to see the virtual joystick under the section " Device and Printers " of W7 64 ? I don't, hence I can't calibrate it and therefore, I suppose, FSX can't recognize there is a ( virtual ) joystick to use and therefore all the stuff doesn't work into FSX. ( I guess )

The script is properly named and properly loaded into the Hotkey software. It took also the icon with the " H " in it.

Only the reverse function is recognized into FSX, using the keyboard.

Any help is really much appreciated.

Thanks in advance

emmeth

Try this newer version of PPJoy: PPJoy 0.8.4.6. I recommend also watching this video tutorial on installing the new PPJoy as it is a bit involved on 64-bit windows.

The modified script is below. Let me know if it works out. Note that I am unable to test it myself (I am currently abroad and no longer have access to my FSX computer.)



#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.

SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.

SetWorkingDir %A_ScriptDir% 	; Ensures a consistent starting directory.


#Persistent

#InstallKeybdHook


OnExit, ExitHandler


FullFwd := 0

Idle := 100


Step := 1

ThrottleAxis := 3

Pos := Idle


#IfWinActive, Microsoft Flight


; Keyboard Throttle

PPJ_Init()      ; Grab the Joystick

PPJ_SetAxis(ThrottleAxis, Pos)


$F1::

        Pos := Idle

        PPJ_SetAxis(ThrottleAxis, Pos)

        return


~F2::

        Pos += Step

        if (Pos > Idle) {

                Pos := Idle

                Send {F2}

                return

        }

        PPJ_SetAxis(ThrottleAxis, Pos)

        return


$F3::

        Pos -= Step

        if (Pos < FullFwd)

                Pos := FullFwd

        PPJ_SetAxis(ThrottleAxis, Pos)

        if (Pos = FullFwd)

                Send {F4}

        return


 $F4::

        Pos := FullFwd

        PPJ_SetAxis(ThrottleAxis, Pos)

        return


ExitHandler:

        PPJ_Term()      ; Release the Joystick

        ExitApp


#IfWinActive

Link to comment
Share on other sites

Hello and thanks for your help on this issue.

I followed your instruction carefully and used your latest script, but I get the attached error message when I run it!

Your advice will be much appreciated.

Regards,

Ross

post-42299-0-33101600-1305954497_thumb.j

Link to comment
Share on other sites

Hello and thanks for your help on this issue.

I followed your instruction carefully and used your latest script, but I get the attached error message when I run it!

Your advice will be much appreciated.

Regards,

Ross

Ensure that PPJoy.dll and the Lib folder are present in the same folder that AutoHotkey.exe is installed in (eg. C:\Program Files\AutoHotkey\). These files are in the AutoHotkey-PPJoy Library (Allows AutoHotkey to talk to PPJoy) which you need to download. After you download the zip file, unzip it to a folder on your desktop then just copy the PPJoy.dll and Lib folder to the same folder that AutoHotkey.exe is installed (eg. C:\Program Files\AutoHotkey\) .

Link to comment
Share on other sites

Hi and thanks for your reply.

I have done exactly as instructed and have attached a snap shot of the folder containing the files, yet, the problem persists.

It seems something is not right about the PPJ_Init() function!

Again, thanks for your help.

Regards,

post-42299-0-62102500-1306043915_thumb.j

Link to comment
Share on other sites

  • 4 months later...

Hey there.

Thank you very much for the solution.

I have managed to get the throttle to work, only thing is, hoe do I get the throttle to stay there?

I have to hold the F4 button in for the throttle to apply power, as soon as I have to rotate the throttle goes down, and looses power.

Can you help me with this?

Kind regards

Link to comment
Share on other sites

  • 7 months later...
  • 6 months later...

i cannot download the script file for the ppjoy and auto key to work together as there is no link to it no more can someone give me another solution or give me a new link to the file that works please

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 3 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy & Terms of Use