Mouse control

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5414
Joined: Wed Feb 28, 2007 7:54 am

Re: Mouse control

Post by another_commander » Fri May 27, 2011 3:26 pm

The change to invert the mouse y-axis is a trivial one to code, but since we are in feature freeze, I cannot push it in the repository right now. However, if anyone is interested in building from source as per instructions here, adding the feature is as simple as opening up the file PlayerEntityControls.m in src/Core/Entities, finding the method named - (void) pollFlightArrowKeyControls:(double)delta_t, which on my copy of the source starts around line 2616, scrolling down where it shows

Code: Select all

if(mouse_control_on || (numSticks && !keyboardPitchOverride))
	{
		double stick_pitch = max_flight_pitch * virtualStick.y; // <<<<<<<<<<  - Change this line
		if (flightPitch < stick_pitch)
		{
			[self increase_flight_pitch:delta_t*roll_delta];
			if (flightPitch > stick_pitch)
				flightPitch = stick_pitch;
		}
		if (flightPitch > stick_pitch)
		{
			[self decrease_flight_pitch:delta_t*roll_delta];
			if (flightPitch < stick_pitch)
				flightPitch = stick_pitch;
		}
		pitching = (fabs(virtualStick.y) >= deadzone);
	}
around line 2758 and changing

Code: Select all

double stick_pitch = max_flight_pitch * virtualStick.y;
to

Code: Select all

double stick_pitch =  - max_flight_pitch * virtualStick.y;
i.e. just adding a minus sign after the equals. This will invert the mouse y axis. Recompile and play.

Ideally, this would be a game option or a defaults file setting to YES/NO, but the above should be good enough for those who can't stand the standard flight-sim way of mouse handling.

pc2099
Mostly Harmless
Mostly Harmless
Posts: 2
Joined: Fri May 27, 2011 1:17 pm

Re: Mouse control

Post by pc2099 » Sat May 28, 2011 2:33 am

Thanks for the warm welcome. When it comes to Elite I was born and raised on a stick but that was a good 20 years ago and I haven't played a flight sim since. Im going to try playing with the inverted mouse and see how I like it but I also like the idea of playing with an xbox 360 controller. Can this be done easily on a PC running XP?

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Mouse control

Post by JensAyton » Sat May 28, 2011 1:06 pm

pc2099 wrote:Thanks for the warm welcome. When it comes to Elite I was born and raised on a stick but that was a good 20 years ago and I haven't played a flight sim since. Im going to try playing with the inverted mouse and see how I like it but I also like the idea of playing with an xbox 360 controller. Can this be done easily on a PC running XP?
Microsoft has software for using the controller with Windows XP. After setting that up, it should just work like any other joystick.

Post Reply