Wiki Page Content

Differences between revisions 9 and 10
Revision 9 as of 2011-01-17 18:17:23
Size: 1342
Editor: SheenaSmith
Comment: update content - w/ Sam; remove draft
Revision 10 as of 2011-04-30 18:05:26
Size: 1449
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_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP|| ||Uint32||'''type'''||the event type; SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP||
Line 13: Line 13:
||Uint8||'''state'''||SDL_PRESSED or SDL_RELEASED|| ||Uint8||'''state'''||the state of the button; SDL_PRESSED or SDL_RELEASED||
Line 23: Line 23:
[[SDL_MouseButtonEvent]] is a member of the [[SDL_Event]] structure and is used when an event of type SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP is reported. [[SDL_MouseButtonEvent]] is a member of the [[SDL_Event]] union and is used when an event of type SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP is reported.  You would access it through the event's `button` field.
Line 38: Line 38:
 .[[SDL_Event]]

SDL_MouseButtonEvent

A structure that contains mouse button event information.

Data Fields

Uint32

type

the event type; SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP

Uint32

windowID

the window with mouse focus, if any

Uint8

button

the button that changed; see Remarks for details

Uint8

state

the state of the button; SDL_PRESSED or SDL_RELEASED

int

x

X coordinate, relative to window

int

y

Y coordinate, relative to window

Code Examples

You can add your code example here

Remarks

SDL_MouseButtonEvent is a member of the SDL_Event union and is used when an event of type SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP is reported. You would access it through the event's button field.

An SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP event occurs whenever a user presses or releases a button on a mouse.

button may be one of:

SDL_BUTTON_LEFT

SDL_BUTTON_MIDDLE

SDL_BUTTON_RIGHT

SDL_BUTTON_X1

SDL_BUTTON_X2


CategoryStruct, CategoryEvents

None: SDL_MouseButtonEvent (last edited 2014-01-18 19:23:56 by PhilippWiesemann)

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