Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mousewheel handling #294

Merged
merged 5 commits into from Jun 16, 2018

Conversation

Projects
None yet
2 participants
@AnotherCommander
Copy link
Member

commented May 2, 2018

I would like to incorporate the new mousewheel handling into master, but I need some help with testing on Linux and Mac. @OoliteProject/developers Please let me know if this implementation is deemed satisfactory. The request is not expected to be merged, unless both Linux and Mac positive reports have been received.

@AnotherCommander

This comment has been minimized.

Copy link
Member Author

commented on src/SDL/MyOpenGLView.m in a553a67 Apr 25, 2018

Attention! It is because of this line that a specially built SDL.dll is required. In the normal SDL 1.2.13 the SDL_MouseButtonEvent structure does not contain the wheelDelta member. The SDL headers included in the Oolite Dev Envrionment for Windows do not contain this member either. Therefore, you will most likely get a build error on this line. To fix it, go ito the folder Msys_x2\1.0\Devlibs\include\SDL, open the SDL_events.h header and add the following after line 142, in the declaration of SDL_MouseButtonEvent:

short wheelDelta;

so that the entire declaration looks like this:

/* Mouse button event structure */
typedef struct SDL_MouseButtonEvent {
	Uint8 type;	/* SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */
	Uint8 which;	/* The mouse device index */
	Uint8 button;	/* The mouse button index */
	Uint8 state;	/* SDL_PRESSED or SDL_RELEASED */
	Uint16 x, y;	/* The X/Y coordinates of the mouse at press time */
	short wheelDelta; /* The delta of the mousewheel movement */
} SDL_MouseButtonEvent;

Edit 20180502: Alternatively, use the new Dev Environment for Windows, available from https://drive.google.com/open?id=12xoD3sT1D9yDmOBPp0DKJ0HXWD4-dJjd

@KonstantinosSykas

This comment has been minimized.

Copy link
Contributor

commented Jun 16, 2018

Linux 64bit and Mac basic testing seems fine. I think it's a GO!

Noticed that, in Mac, rolling the mouse-wheel towards the player increases the speed, while for Windows and Linux it decreases it. Nothing to do with your changes. The same behavior is in master branch too.

@AnotherCommander

This comment has been minimized.

Copy link
Member Author

commented Jun 16, 2018

Cool, thanks. It's going in.

@AnotherCommander AnotherCommander merged commit 25fc20f into master Jun 16, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@AnotherCommander AnotherCommander deleted the mousewheel-handling branch Oct 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.