Penguin

SDL_!MouseMotionEvent?

SDL_!MouseMotionEvent?

NAME STRUCTURE DEFINITION STRUCTURE DATA DESCRIPTION SEE ALSO


NAME

SDL_!MouseMotionEvent?- Mouse motion event structure

STRUCTURE DEFINITION

typedef struct{ Uint8 type; Uint8 state; Uint16 x, y; Sint16 xrel, yrel; } SDL_!MouseMotionEvent?;

STRUCTURE DATA

type SDL_MOUSEMOTION

state The current button state

x, y The X/Y coordinates of the mouse

xrel, yrel Relative motion in the X/Y direction

DESCRIPTION

SDL_!MouseMotionEvent? is a member of the SDL_Event union and is used when an event of type SDL_MOUSEMOTION is reported.

Simply put, a SDL_MOUSEMOTION type event occurs when a user moves the mouse within the application window or when SDL_!WarpMouse? is called. Both the absolute (x and y) and relative (xrel and yrel) coordinates are reported along with the current button states (state). The button state can be interpreted using the SDL_BUTTON macro (see SDL_!GetMouseState?).

If the cursor is hidden (SDL_!ShowCursor?(0)) and the input is grabbed (SDL_WM_!GrabInput?(SDL_GRAB_ON)), then the mouse will give relative motion events even when the cursor reaches the edge fo the screen. This is currently only implemented on Windows and Linux/Unix-a-likes.

SEE ALSO

SDL_Event, SDL_!MouseButtonEvent?


This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.