Wiki Page Content

Differences between revisions 15 and 16
Revision 15 as of 2013-09-05 20:23:09
Size: 1566
Comment: Updated structure.
Revision 16 as of 2014-02-22 23:00:51
Size: 1672
Editor: Sam Lantinga
Comment: Explained the meaning of x and y in the mousewheel event.
Deletions are marked like this. Additions are marked like this.
Line 14: Line 14:
||Sint32||'''x'''||the amount scrolled horizontally||
||Sint32||'''y'''||the amount scrolled vertically||
||Sint32||'''x'''||the amount scrolled horizontally, positive to the right and negative to the left||
||Sint32||'''y'''||the amount scrolled vertically, positive away from the user and negative toward the user||

SDL_MouseWheelEvent

A structure that contains mouse wheel event information.

Data Fields

Uint32

type

SDL_MOUSEWHEEL

Uint32

timestamp

timestamp of the event

Uint32

windowID

the window with mouse focus, if any

Uint32

which

the mouse instance id, or SDL_TOUCH_MOUSEID; see Remarks for details

Sint32

x

the amount scrolled horizontally, positive to the right and negative to the left

Sint32

y

the amount scrolled vertically, positive away from the user and negative toward the user

Code Examples

You can add your code example here

Remarks

SDL_MouseWheelEvent is a member of the SDL_Event union and is used when an event of type SDL_MOUSEWHEEL is reported. You would access it through the event's wheel field.

An SDL_MOUSEWHEEL event occurs whenever a user moves the mouse wheel.

Movements to the right generate negative x values and to the left generate positive x values. Movements down (scroll backward) generate negative y values and up (scroll forward) generate positive y values.

which may be SDL_TOUCH_MOUSEID, for events that were generated by a touch input device, and not a real mouse. You might want to ignore such events, if your application already handles SDL_TouchFingerEvent.


CategoryStruct, CategoryEvents

None: SDL_MouseWheelEvent (last edited 2019-05-17 22:32:07 by DanielG)

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