how to swap the up & down key functions?

General discussion about Celestia that doesn't fit into other forums.
Topic author
einstein_1961
Posts: 3
Joined: 09.01.2008
With us: 16 years 10 months
Location: Iraq

how to swap the up & down key functions?

Post #1by einstein_1961 » 14.01.2008, 10:33

Hi to all,

Is there a possibility or an easy way to reverse the up & down navigation key functions??

I am loosing all the fun and thrill in chasing commets or asteroids in free flight (my favorite) because of this, I tryed alot to adapt but it seems I can't get used to it, hence I give up and quit.
Can anyone help with a script or something to acheive this? I am sure that many share the same difficulty.

Thanks in advance,
Raffi

vibes
Posts: 2
Joined: 15.01.2008
With us: 16 years 10 months

Post #2by vibes » 15.01.2008, 09:23

Hello out there,

I also have problems changing directions. Up and down follow the arrows as shown on the keyboard, left and right move the other way. This is really annoying when commanding the spaceship, it is not possible to move intuitively, and I regularly end up crashing into Jupiter or so. I checked the config file but could not find anything to change the attributions.

is there a solution?

thanks, Tommy

Brendan
Posts: 296
Joined: 15.07.2003
With us: 21 years 4 months
Location: Bellows Falls, VT
Contact:

Re: how to swap the up & down key functions?

Post #3by Brendan » 15.01.2008, 12:01

einstein_1961 wrote:Hi to all,

Is there a possibility or an easy way to reverse the up & down navigation key functions??

I am loosing all the fun and thrill in chasing commets or asteroids in free flight (my favorite) because of this, I tryed alot to adapt but it seems I can't get used to it, hence I give up and quit.
Can anyone help with a script or something to acheive this? I am sure that many share the same difficulty.

Thanks in advance,
Raffi


It works something like a flight simulator with the up and down arrows. The up arrow could be seen as pushing the control stick making the craft tilt down and the down arrow pulling the stick back, making it tilt up.

Another way of looking at it is the arrows controlling which direction the objects you are looking at appear to move in instead of a spacecraft because there really is no spacecraft in the program.

A way to reverse the up and down arrows is to open the celestia.cfg file, find the value RotateAcceleration and make it negative. But that would reverse the left and right arrows too.

In the CelestiaCore:tick() function, I found the keyboard bindings for the up and down arrows.

Code: Select all

 2303                 if (keysPressed[Key_Down])
 2304                     av += Vec3f((float) (dt * fov * -KeyRotationAccel), 0.0f, 0.0f);
 2305                 if (keysPressed[Key_Up])
 2306                     av += Vec3f((float) (dt * fov * KeyRotationAccel), 0.0f, 0.0f);


All it would take to reverse the up and down arrows without affecting the left and right arrows would be changing the signs and recompiling. It shouldn't be too hard to make an configuration file option that controls these signs if there isn't already one. I'm only set up to compile in Linux and have nothing set up for Windows right now.
Specs: 3500 AMD 64, 1GB RAM, PCI Express GeForce 7600 GS with 256MB, Debian Lenny on 250 GB drive, Windows XP Media Center on 250 GB drive

Brendan
Posts: 296
Joined: 15.07.2003
With us: 21 years 4 months
Location: Bellows Falls, VT
Contact:

Post #4by Brendan » 15.01.2008, 12:11

vibes wrote:Hello out there,

I also have problems changing directions. Up and down follow the arrows as shown on the keyboard, left and right move the other way. This is really annoying when commanding the spaceship, it is not possible to move intuitively, and I regularly end up crashing into Jupiter or so. I checked the config file but could not find anything to change the attributions.

is there a solution?

thanks, Tommy


Which arrows are you using? The keyboard and keypad arrows commands are listed in controls.txt and given below.

Code: Select all

Left/Right Arrows : Roll Camera
Up / Down Arrows  : Change Camera Pitch
Shift+Arrows      : Orbit object


Code: Select all

Number pad:
4  : Yaw left
6  : Yaw right
8  : Pitch down
2  : Pitch up
7  : Roll left
9  : Roll right
5  : Stop rotation


If you want to reverse the behavior of both the yawing and pitching commands, opening the celestia.cfg file and making the RotateAcceleration value negative.

If you want to reverse the yaw and pitch behaviors separately, it shouldn't be too hard for me to add options for that. I think I may have added some option to an extended version of Celestia a long time ago, but I don't remember exactly what I did.
Specs: 3500 AMD 64, 1GB RAM, PCI Express GeForce 7600 GS with 256MB, Debian Lenny on 250 GB drive, Windows XP Media Center on 250 GB drive

vibes
Posts: 2
Joined: 15.01.2008
With us: 16 years 10 months

Post #5by vibes » 15.01.2008, 14:04

hello dear Brendan,

thank you for your kind reply!

Let me be more concise about the problem: Using 8 the Earth shown on the screen moves up, using 2 the Earth moves down. Using 4 it moves to the right, using 6 it moves to the left.

That means up/down moves to the same direction as the numbers are placed on the keyboard, left/right to the opposite direction. So if you command the spaceship by the numbers, its hard to remember you have to press the right button (6) to put the earth to the left, but the upper button (8) to put it upwards.

So left button puts the earth right, right button left, but upper button puts it up, lower button puts it down. Very annoying!

But, ahaaa! Like a flight simulator! When i try to imagine a joy stick on the numbers pad it seems intelligible to me. Well, I never sat in a cockpit, but thats a very good suggestion. I think I get it right now.

thank you very much!

Tommy

PS: I dont know how the smiley came in, i just wrote 8...


Return to “Celestia Users”