Board index FlightGear Development

Keyboard binding

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

Keyboard binding

Postby MIG29pilot » Tue Sep 15, 2015 10:37 pm

A. How does one assign a keyboard button to a certain task;
B. How does one change a keyboard button for a task;
C. How on earth does one figure which button one is telling the sim to use;
D. For instance, how do I make a command that uses "Ctrl-j" use "j" instead?
User avatar
Posts: 1463
Joined: Tue May 19, 2015 4:03 pm
Location: 6 feet under Snow
Callsign: MIG29pilot
Version: 3.7nightly
OS: Windows 10

Re: Keyboard binding

Postby legoboyvdlp » Tue Sep 15, 2015 10:47 pm

A. You assign the key to a property such as /gear/gear/spray/
User avatar
Posts: 7561
Joined: Sat Jul 26, 2014 1:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Keyboard binding

Postby Thorsten » Wed Sep 16, 2015 6:12 am

Code snipped calling a Nasal script when a key is used:

Code: Select all
       <key n="5">
        <desc>Cutoff switch engine 3</desc>

Code snipped adjusting a property every time the key is pressed:
Code: Select all
          <key n="91">
                <desc>Move rudder left</desc>
                <repeatable type="bool">true</repeatable>
                    <step type="double">-0.05</step>

These go under /input/keyboard in the aircraft-set.xml file).

All the keys have codes - so have shift+key and ctrl+key - there's probably a table somewhere, but so far I've just looked at keyboard.xml and counted the free spaces (ctrl+f would be '6' for instance, knowing the above).
Posts: 11577
Joined: Mon Nov 02, 2009 8:33 am

Re: Keyboard binding

Postby Johan G » Wed Sep 16, 2015 2:57 pm

This wiki article may be of help: Howto:Reassign keyboard bindings (perm) ;)
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Posts: 5691
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Return to Development

Who is online

Users browsing this forum: No registered users and 8 guests