Board index FlightGear Development Documentation

Live key documentation dialog

Discussion of the FlightGear documentation, how it can be improved and coordination of people working on it.

Live key documentation dialog

Postby jam007 » Thu May 02, 2013 8:12 am

Maybe it would be possible to create a Nasal script that reads the key bindings currently used and displays it in a list like the "common aircraft keys" in the help menu.
jam007
 
Posts: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04

Re: EC130 startup problem

Postby Hooray » Thu May 02, 2013 12:22 pm

that would definitely be possible - you would just need to add some meta information to the tags - or just take what the tooltips use.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11163
Joined: Tue Mar 25, 2008 8:40 am

Re: EC130 startup problem

Postby Johan G » Thu May 02, 2013 8:41 pm

jam007 wrote in Thu May 02, 2013 8:12 am:Maybe it would be possible to create a Nasal script that reads the key bindings currently used and displays it in a list like the "common aircraft keys" in the help menu.

Press "?" to get what the author of an aircraft though was needed. :wink: I believe common aircraft key should be common (as in not specific) aircraft keys.

Maybe there could be a key mapping dialogue.
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
Moderator
 
Posts: 5292
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

Re: EC130 startup problem

Postby Thorsten » Fri May 03, 2013 6:09 am

Well, taking into account that we need to be able to fly anything from a hangglider to a rocket - can anyone come up with a complete scheme how to assign keys rather than isolated ideas? Because that'd be the only thing that has a chance of being discussed and implemented.
Thorsten
 
Posts: 9899
Joined: Mon Nov 02, 2009 8:33 am

Re: EC130 startup problem

Postby jam007 » Fri May 03, 2013 9:34 am

Johan G wrote in Thu May 02, 2013 8:41 pm:Maybe there could be a key mapping dialogue.

Reading the property tree and displaying key and desc in a dialog would be a aircraft designer / current set up independent way to in-sim show all current keybindings for the user. Actually it probably easy to implement based on already existing Nasal-gui metods.
jam007
 
Posts: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04

Re: EC130 startup problem

Postby Johan G » Fri May 03, 2013 10:26 am

I had first posted a rather boring "can't do" post, but thought a bit more after that.

If the aircraft author have done a good job, in essence have been using <desc> tags and a good description, that will probably work, and even work well at that. :D
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
Moderator
 
Posts: 5292
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

Re: EC130 startup problem

Postby Gijs » Fri May 03, 2013 10:56 am

jam007 wrote in Thu May 02, 2013 8:12 am:Maybe it would be possible to create a Nasal script that reads the key bindings currently used and displays it in a list like the "common aircraft keys" in the help menu.

Displaying all keys is easy, but hard to fit nicely in some logical groups; especially on smaller screens. Just displaying a giant list of keys isn't very nice IMO (see image). They'd have to be grouped like "flight controls", "autopilot", "simulator" etc. Basically what we do manually now with the various dialogs.

Just displaying the custom aircraft keys is also difficult (as far as my Nasal skills go), because the sim does not make any distinction on that. There's just one big list of keys under /input/keyboard. We could look at just the keys in -set.xml, but some developers like to nest them in seperate files etc....

EDIT: Thinking out loud: we can tag the default keys with something like <default>true</default> (that only involves editing the keyboard.xml file). We can then probably have that set to false whenever it is overwritten. That way we don't need to edit all the aircraft... Or we can leave the editing completely out and compare the /input/keyboard tree with the keyboard.xml file...

EDIT2: Here's some ugly code that does the latter: http://pastebin.com/hnFQ3aEk Overwrite the contents of $FG_ROOT/Nasal/gui.nas with this (make a backup first!) and launch FlightGear with an aircraft that has some custom keys (eg. UFO, C172P, 747-400). Nasal experts, feel free to improve. You'll find the interesting stuff from line 1187 onwards.
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9300
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: EC130 startup problem

Postby jam007 » Fri May 03, 2013 2:19 pm

Just wondering how useful it is for the user to differentiate between default and custom keys. When flying your main question is witch key to push rather than is it default or custom. Would it be better to show all keys but mark the custom in some way?
Is it possible to add a category tag in the keyboard .xml. And use that to list the keys under different headings/tabs?
jam007
 
Posts: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04

Live key documentation dialog

Postby Hooray » Fri May 03, 2013 4:52 pm

yes, you can add pretty much arbitrary tags or attributes to differentiate keybindings and introduce classes or categories.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11163
Joined: Tue Mar 25, 2008 8:40 am

Re: EC130 startup problem

Postby mhab » Sat May 04, 2013 8:04 pm

Something useful related to this discussion (quite recent):
http://wiki.flightgear.org/Keyboard_fun ... ority_list

B.T.W. I am reworking the whole keyboard bindings now so that I can use the keys I am used to from other sims.
I'm progressing slowly, but a work for which I need 8+h could be done in 1/2h or less if there was something like a configuration dialog available, basically like the new "Joystick configuration" in FG 2.10
It is quite troublesome to learn
1) the keycodes
2) the functions available
3) the syntax used for bindings
4) avoiding XML inconsistencies
...
, but I learn a lot :)

and FG is like a new-born baby for me with the key-bindings I am used to !!!
mhab
 
Posts: 404
Joined: Thu Apr 18, 2013 10:59 pm
Callsign: D-MIKE
Version: 2017.1.2
OS: Win7

Re: EC130 startup problem

Postby Hooray » Sat May 04, 2013 8:57 pm

yes, that was started by David Megginson and Stuart a long time ago ... the issue itself is regularly raised again on the devel list, so no surprise there :D
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11163
Joined: Tue Mar 25, 2008 8:40 am

Re: EC130 startup problem

Postby jam007 » Sun May 05, 2013 8:25 am

Created categories for keyboard.xml and made a function that could be added to giu.nas that shows all keys by category.
It adds a (c) after keys changed from default based on Gijs code.
The result:
Image
jam007
 
Posts: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04

Re: EC130 startup problem

Postby Gijs » Sun May 05, 2013 8:57 am

Excellent! It may need some more styling though, I'll have a look at it when I'm at my FG computer.
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9300
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Live key documentation dialog

Postby jam007 » Sun May 05, 2013 2:34 pm

Yes. (I tried using tabs \t to get a better table but it did not work.) Gladly leaves this to someone who understands fg-dialogs.
Also there is some mistakes in the code that I just saw. Line 39-41 is unnecessary and line 43 should be: foreach (key; node.getChildren("key")) {
jam007
 
Posts: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04

Re: Live key documentation dialog

Postby Hooray » Sun May 05, 2013 2:37 pm

you can check the multiplayer pilot list/system monitor dialogs for examples on creating a simple table-driven layout.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11163
Joined: Tue Mar 25, 2008 8:40 am

Next

Return to Documentation

Who is online

Users browsing this forum: No registered users and 2 guests