Page 1 of 2

Keyboard Short-Cuts For Orbit Lines

Posted: 25.06.2005, 22:45
by BlindedByTheLight
Hey there... I know it's possible to turn the entire orbit-line rendering on and off via the O key. But as far as I can tell, there is no keyboard shortcut to do it for specific orbit lines (planets, moons, etc.) which is kinda a buzz kill because, while flying through Celestia, in order to turn on, say, comet orbits for a moment - I have to toggle out of full screen mode and use the mouse and menu. Anyone know of a workaround? If not, consider this a feature request for keyboard short-cuts for specific orbit lines - maybe something simple like shift-comman-p for planets... shift-command-m for moons... and so one..

Thanks,
Steve

Posted: 26.06.2005, 17:40
by hank
Steven,

It should be easy for you to add this to your version of Celestia. Just do the following: Start Xcode and open your Celestia project. Double-click on MainMenu.nib to open it in Interface Builder. You'll see a window with the Celestia main menu in it. Click successively on Display>Orbits>Comets to select that menu item. Choose 'Show Info' from the Interface Builder 'Tools' menu to open the 'NSMenuItem Info' window for the 'Comets' menu item. Use the 'Attributes' panel in the info window to specify a 'Keyboard Equivalent' (shortcut) and modifiers. Do this for each of the menu items you want to add keyboard shortcuts for. Then save the nib file, quit Interface Builder, rebuild the project in Xcode (no need to clean), and you should be in business.

- Hank

Posted: 27.06.2005, 04:19
by BlindedByTheLight
Thanks, Hank! Way cool!

Posted: 30.06.2005, 20:43
by BlindedByTheLight
NOTE TO ALL: my new Mac OS X build does include keyboard short-cuts for toggling specifc orbit lines (thanks again, Hank). It's a very cool way to stay in the program's reality...

http://www.celestiaproject.net/forum/viewtopic.php?t=7561

Posted: 05.08.2005, 02:44
by buggs_moran
Any way to do this in Windows?

Posted: 05.08.2005, 13:12
by ElChristou
buggs_moran wrote:Any way to do this in Windows?


It would be cool that someone using Windows try to learn how to compile to give to the Windows users community this kind of "service"...

No one can help????

Posted: 05.08.2005, 17:35
by ElChristou
BlindedByTheLight wrote:NOTE TO ALL: my new Mac OS X build does include keyboard short-cuts for toggling specifc orbit lines (thanks again, Hank). It's a very cool way to stay in the program's reality...

http://www.celestiaproject.net/forum/viewtopic.php?t=7561


Hello Steven,

On your download center, the last available is the Dirkpitt built... This one also have the shortcuts?

Posted: 05.08.2005, 19:33
by BlindedByTheLight
Yeah, Dirkpitt put them in himself. It does not have ANY orbit line fixes or the GOTO spacecraft time start patch, though.

Thanks

Posted: 05.08.2005, 20:46
by Brendan
I know where in the sources the keyboard commands are handled, so I'll look into it. I'll need to find how to set and clear specific orbits or sets of orbits.

Posted: 12.08.2005, 17:13
by phoenix
well, after hours of searching and probing the celestia-code i made a patch for the w32 and linux-source (not tested with linux yet).

the shortcuts are very easy and the complement to ther label-keys:

SHIFT+P - toggle planet-orbits
SHIFT+M - toggle moon-orbits
SHIFT+N - toggle spacecraft-orbits

i moved comet-labels and orbits to 'z' and 'SHIFT+Z'

SHIFT+W - toggle asteroid-orbits
SHIFT+Z - toggle comet-orbits

remember that you cannot turn off orbits on currently selected objects.
there is also a display-bug when you:
- turn off planet-orbits
- turn on moon-orbits
- deselect the planet

but thats not my fault ;)

grab the .patch or w32-bin here:
http://www.purebytes.de/stuff/celestia/patches/

Posted: 13.08.2005, 23:52
by ANDREA
phoenix wrote:well, after hours of searching and probing the celestia-code i made a patch for the w32 and linux-source (not tested with linux yet).... grab the .patch or w32-bin here:
http://www.purebytes.de/stuff/celestia/patches/

Thanks a lot, Phoenix, it works correctly and is very nice-looking. :D
It's very useful for teaching and show needs, thanks again! :wink:

Andrea :D

New Keyboard Commands Altogether?

Posted: 14.08.2005, 00:26
by BlindedByTheLight
phoenix wrote:the shortcuts are very easy and the complement to ther label-keys:

SHIFT+P - toggle planet-orbits
SHIFT+M - toggle moon-orbits
SHIFT+N - toggle spacecraft-orbits

i moved comet-labels and orbits to 'z' and 'SHIFT+Z'

SHIFT+W - toggle asteroid-orbits
SHIFT+Z - toggle comet-orbits



I couldn't help but chuckle when I read this... as I'm sure you went through the same line of reasoning I did when deciding which keys to use to toggle orbit lines. I am, curious, however, what led you to your scheme.

Having not been with Celestia from the beginning, I get the sense that a lot of the keyboard short-cuts were not "Master Planned" out - but resulted from a growing hodge-podge of new feature additions. Which would explain why "P" toggles planet-labels but "A" does not toggle asteroid-labels (instead which is toggled by a small "w").

It seems like a lot of short-cuts have been shoe-horned in - with the ATTEMPT to make them logical but failing when other commands have "gotten to the key" first.

Like it seems as you did, I, too, had first contemplated following the established (though inconsistent) keyboard assignments and setting the new orbit lines keyboard short-cuts to match the already established keyboard shortcuts for the labels - but just adding a shift-key.

The problem with this is that making the shift key a mandatory part of the orbit-toggling process, that precludes the use of the small "w" and capital "W" convention for asteroids and comets - hence your solution to move to "z" and shift-"z" (though you quoted just a "w" above so I was a bit confused).

In any case, I chose a different tact. If I could have followed PRECISELY the previous established Turn-On-Labels Convention, I might have. Just might, however - for reasons I will eventually get to. Since I couldn't follow that convention, however, I thought...

"Rather than having to now jump to yet ANOTHER illogical and arbitrary assignment - namely moving comets now to shift-z - that will still require a novel memorization of a new short-cut, why not take this opportunity to wipe the slate clean and go back to a LOGICAL assignment?"...

shift-p for p-lanet orbits
shift-s for s-paceship orbits
shift-a for a-steroid orbits
shift-c for c-omet orbits
shift-m for m-oon oribts

Aside from the benefit of drawing a line in the sand and not moving further and further away from a logical keyboard assignment (and potentially making things yet MORE difficult for future additions), it had the ease-of-GUI benefit of requiring only ONE memorization...

shift+ the first letter of the orbit-name you are toggling

I mention all this because I would like to draw attention to the issue of keyboard short-cuts in general. Yes, we have all grown accustomed to the particular keyboard short-cuts. They are muscle memory to those of us who use the program a lot (including me).

But they are inconsistent and difficult to learn for new users. It is bad GUI design. For example, using Mac terminology (for the sake of convenience, namely mine) it seems that the convention of this could be better:

1) reserving keys WITHOUT modifiers for navigation and time controls

2) moving LABELS to "control + a key" (p for planets, s for spacecraft, etc) that is always the first letter of the item to be toggled (no more "n" for spacecraft, etc)

3) doing the same thing for toggling orbits but say, using shift + the first letter of the item to be toggled

This is not a comprehensive analysis and might not be the best way to go... but right now there is no robust system at all. Starting with the use of modifiers - which should be as consistent as possible. I could work something out more comprehensive than this... but I wanted to throw it out there to see if the community is receptive to changing the keyboard layout before I put the effort in.

I know we're all used to it the way it is... but I have no doubt, with a better system in place, we will all get quickly used to that as well. Even more so.

Thanks, Steve

Posted: 14.08.2005, 00:58
by symaski62
:oops: Galaxies color RIEN ?!?!?!?!?

:roll: ctrl+V je fait :)

BYE

Posted: 14.08.2005, 01:55
by ElChristou
I agree with Steven... What about a poll to see if people are agree for a new keyboard definition?

Posted: 14.08.2005, 01:58
by julesstoop
Oh yes! I agree completely (and too tired right now to explain why)

Posted: 14.08.2005, 02:32
by phoenix
at the moment i'm too tired for a full quoted answer so yes in user -and dev-view the keyboard shortcuts need to be reassigned and perhaps somehow "code-united"
at the moment we have several locations and functions where keyboard-input is processed and therefore a bit hard to locate in the code ;)

i used SHIFT+X because they were mostly "unused"... first tried that with CTRL+ but that didn't work so well.

currently celestia converts all input to UPPER case and then applies the compare-functions, thats why most normal key-bindings are DUPs.
so what did was simply take all current shortcuts for labeling and "split" them up into lower and upper-case.

"c" is already given to center location, so no-go here for comet-labels/orbits
"w" and "W" were already assigned to cometlabels and asteroid-labels so i had to move either one of them.
"Z" was unused and i just realized that i double-assigned "z" with decelerate... shame on me! (but it still works)

the "a" assignmend is somehow broken (couldn't find out why) so that CRTL+a seems to be the normal "a" for accelerate but also for toggling planet-haze ... BUT the correct key-assignment for haze is CTRL+SHIFT+a which works just fine...
maybe because (a and z) are controlled by a completly different function which i couldn't locate yet.

ok bedtime now...

PS: who the heck came up with octal comparison of special-key-bindings? :p

Posted: 14.08.2005, 02:42
by BlindedByTheLight
Thanks Phoenix... and I see now this is more than an organizational issue... and very much a "now where did I put that code to control that keyboard short-cut issue". I had not realized the mechanics of things before. Thanks for the clarification, however. Guess we'll add it to the feature list...? :)

Posted: 14.08.2005, 05:57
by ANDREA
ElChristou wrote:I agree with Steven... What about a poll to see if people are agree for a new keyboard definition?

I agree too, as I agree with Steve on a more logical (first letter) short-cut sequence. :wink:
And moreover I would like to know if there is a possibility to add these commands to the .cel scripting features.
I'm not a programmer, but I think it could be a bit more difficult than adding keybord commands, or not? 8O
Thank you.

Andrea :D

Posted: 15.08.2005, 02:44
by Brendan
Thanks for the patch. I didn't get around to making one because I didn't know how to make patch files. I can use diff, but the diff files don't look like patch files. :?

Posted: 15.08.2005, 08:09
by t00fri
phoenix wrote:at the moment i'm too tired for a full quoted answer so yes in user -and dev-view the keyboard shortcuts need to be reassigned and perhaps somehow "code-united"
at the moment we have several locations and functions where keyboard-input is processed and therefore a bit hard to locate in the code ;)

Effectively /all/ key shortcuts are processed in celestia/celestiacore.cpp
if I remember correctly. At least that's the idea.

Some time ago we had extensive discussions among the developers about a completely new two-key assignment, with the first key labelling the "action group" and the second one, memnonically, the specific action in that group.

Nothing came out of it so far...


i used SHIFT+X because they were mostly "unused"... first tried that with CTRL+ but that didn't work so well.

currently celestia converts all input to UPPER case and then applies the compare-functions, thats why most normal key-bindings are DUPs.
so what did was simply take all current shortcuts for labeling and "split" them up into lower and upper-case.

The uppercase conversion is only done for /letter/ codes!
NOT for ;:'",<.>/?9(0)[{]}...

the "a" assignmend is somehow broken (couldn't find out why) so that CRTL+a seems to be the normal "a" for accelerate but also for toggling planet-haze ... BUT the correct key-assignment for haze is CTRL+SHIFT+a which works just fine...
maybe because (a and z) are controlled by a completly different function which i couldn't locate yet.

Hmm,..do you have a problem with your CTRL key? Things work just fine for me under Linux and (most probably in) Windows. CTRL+a =atmosphere ON|OFF while a|A is 'accelerate'

PS: who the heck came up with octal comparison of special-key-bindings? :p


To use octal keycodes instead of the key strings has been a popular way since > 20 years in professional coding... ;-)

Bye Fridger