Wiki Page Content

Differences between revisions 14 and 15
Revision 14 as of 2011-01-17 18:55:24
Size: 1858
Editor: SheenaSmith
Comment: add RF; remove Draft
Revision 15 as of 2011-05-01 04:21:35
Size: 1943
Editor: SheenaSmith
Comment: update content - event remarks re: union (for consistency); camelcase; button params
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
#pragma disable-camelcase #pragma camelcase off
Line 10: Line 10:
||Uint32||'''type'''||SDL_MOUSEMOTION|| ||Uint32||'''type'''||the event type; SDL_MOUSEMOTION||
Line 12: Line 12:
||Uint8||'''state'''||the current button state; see [[#Remarks|Remarks]] for details|| ||Uint8||'''state'''||the state of the button; see [[#Remarks|Remarks]] for details||
Line 25: Line 25:
[[SDL_MouseMotionEvent]] is a member of the [[SDL_Event]] structure and is used when an event of type SDL_MOUSEMOTION is reported. [[SDL_MouseMotionEvent]] is a member of the [[SDL_Event]] structure and is used when an event of type SDL_MOUSEMOTION is reported.  You would access it through the event's `motion` field.
Line 42: Line 42:
 .[[SDL_Event]]

SDL_MouseMotionEvent

A structure that contains mouse motion event information.

Data Fields

Uint32

type

the event type; SDL_MOUSEMOTION

Uint32

windowID

the window with mouse focus, if any

Uint8

state

the state of the button; see Remarks for details

int

x

X coordinate, relative to window

int

y

Y coordinate, relative to window

int

xrel

relative motion in the X direction

int

yrel

relative motion in the Y direction

Code Examples

You can add your code example here

Remarks

SDL_MouseMotionEvent is a member of the SDL_Event structure and is used when an event of type SDL_MOUSEMOTION is reported. You would access it through the event's motion field.

An SDL_MOUSEMOTION event occurs whenever a user moves the mouse within the application window or when SDL_WarpMouseInWindow() is called.

state is an 8-bit button bitmask of the current button state and is the same as that returned by SDL_GetMouseState(). You can test different buttons by using the following masks:

SDL_BUTTON_LMASK

SDL_BUTTON_MMASK

SDL_BUTTON_RMASK

SDL_BUTTON_X1MASK

SDL_BUTTON_X2MASK

Relative motion is stored in xrel and yrel and is relative to the last motion event. If relative mouse mode is enabled with SDL_SetRelativeMouseMode(), then the mouse will give relative motion events even when the cursor reaches the edge of the screen.


CategoryStruct, CategoryEvents

None: SDL_MouseMotionEvent (last edited 2013-09-05 20:20:21 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit