Sign in to follow this  
rcbarend

Overriding Keyboard / Joystick input

Recommended Posts

I need to prevent the key/joystick button assigned to (>K:TOGGLE_STARTER1) from taking any action unless (A:Electrical master battery,bool) is 1.Can do it with mouse buttons, but seems that when the keyboard itself is used, it activates the starter regardless of the state of the battery bool.ANy Hints?Also, what is the difference between ( 0 (>K:TOGGLE_STARTER1) )and ( 1 (>K:TOGGLE_STARTER1) ). Seems to me that inpuuting a 1 or a 0 to a K toggle event has the same action.Thanks in advanceSteve

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi Steve,You could have ask me :-)1. The Toggle_starter events do not take a parameter. You can even skip the 0 or 1.The name StarterOn would have been a better name for the event, since it doesn't toggle anything. Moreover, you cannot toggle it Off (it goes Off by itself after one or 2 seconds.2. There no way to disable an event if the user has assigned it to a keyboard/joystick button. The only way you could "block" block keyboard/joystick button events, is:- Detect when the event is given.- Immediately correct the event by giving another.Unfortunately "correction" for Toggle_starter is not possible, since there is no Off event.BUT, you CAN prevent the Starter/Combustion sound to play when the battery is Off. Just add a test for battery before starting the sound.Cheers, Rob Barendregt

Share this post


Link to post
Share on other sites

Hey RobThanks for the reply, but this isn't about the sounds...they work nicely :-))I asssigned a key to starter 1 on/off in the assignments, and the starter runs until that key is released. So it is some form of toggle, as long as the key is deppressed. What I want to do is prevent the starter from functioning if the battery is off. Easy to do if the starter function is assigned an XML button, but can't seem to do it when a keyboard function is assigned.This is more to do with emulating accuracy when using external inputs (keyboards, joystick buttons or even switches)Steve

Share this post


Link to post
Share on other sites

Steve, While there seems to be no way to disable the keyboard/stick inputs into FS, a section in the aircraft.cfg may help.{ELECTRICAL}//starter1 = 0, 20, 17.0 //this is usually stockstarter1 = 2, 20, 17.0 // change to batt busAlso if that doesn't work a "blocker" gauge may be made. While it will not absolutely keep the starter from working it may keep it toggling fast enough from keeping it reaching start RPM.(A:ELECTRICAL BATTERY BUS VOLTAGE, volts) 0 == (A:GENERAL ENG1 STARTER, bool) & if{ (>K:TOGGLE_STARTER1) }Regards,Roman(KGRB)http://home.new.rr.com/spokes2112/images/Image2.gif

Share this post


Link to post
Share on other sites

RomanThanks for the feedback. I tried the .cfg already and the darned starter is always on ( Turboprop engine), regardless of battery state.Steve

Share this post


Link to post
Share on other sites

Hi Steve,Yes, I understand what your problem is :-)But as I explained in my original post (re-read it): there's just NO way you can prevent (AND correct) starter events given from the keyboard/joystick, since (unlike a lot of other functions), the Starter function has no OFF-counterpart event.While you cannot prevent the starter from becoming active via keyboard/joystick, you may be able to prevent that the engine starts running.If you see that:- The starter is ON (starter event)- AND Electrical is OFF (which means that the user is starting from keyboard/joystick)- AND the fuel switch is ON: Command the fuel switch OFF while the starter variable is ON.I assume this will prevent the engine from igniting.Cheers, Rob

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this