|
Size: 2206
Comment: minor change
|
Size: 1929
Comment: update content - w/ Sam (in progress)
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 6: | Line 6: |
| A structure that contains mouse motion event ,,structure,, ^information^ (event.motion.*). | A structure that contains mouse motion event information. |
| Line 14: | Line 14: |
| ||Uint8||'''padding1'''||^8 empty bits to total 32^???|| ||Uint8||'''padding2'''||^8 empty bits to total 32^???|| ||Uint8||'''padding3'''||^8 empty bits to total 32^???|| |
|
| Line 19: | Line 16: |
| ||int||'''xrel'''||the relative motion in the X direction|| ||int||'''yrel'''||the relative motion in the Y direction|| |
||int||'''xrel'''||relative motion in the X direction|| ||int||'''yrel'''||relative motion in the Y direction|| |
| Line 31: | Line 28: |
| [[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^InWindow^???]]() 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]]()). |
[[SDL_MouseMotionEvent]] is a member of the [[SDL_Event]] structure and is used when an event of type SDL_MOUSEMOTION is reported. An SDL_MOUSEMOTION event occurs whenever a user moves the mouse within the application window or when [[SDL_WarpMouseInWindow]]() is called. The button state can be interpreted using the SDL_BUTTON macro (see [[SDL_GetMouseState]]()). |
| Line 38: | Line 38: |
| == Related Enumerations == .[[SDL_EventType]] == Related Structures == .[[SDL_MouseButtonEvent]] .[[SDL_MouseWheelEvent]] |
|
| Line 39: | Line 46: |
| .[[SDL_MouseButtonEvent]] |
DRAFT |
SDL_MouseMotionEvent
A structure that contains mouse motion event information.
Contents
Data Fields
Uint32 |
type |
SDL_MOUSEMOTION |
Uint32 |
windowID |
the window with mouse focus, if any |
Uint8 |
state |
the current button state |
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
green
SDL_MouseMotionEvent is a member of the SDL_Event structure and is used when an event of type SDL_MOUSEMOTION is reported.
An SDL_MOUSEMOTION event occurs whenever a user moves the mouse within the application window or when SDL_WarpMouseInWindow() is called.
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 of the screen. This is currently only implemented on Windows and Linux/Unix-alikes.
green
Related Enumerations
Related Structures
