Wiki Page Content

Differences between revisions 1 and 2
Revision 1 as of 2010-03-23 17:52:36
Size: 857
Editor: SheenaSmith
Comment: create page, add content (Rev 5540)
Revision 2 as of 2010-07-15 22:43:29
Size: 1887
Editor: SheenaSmith
Comment: add content from old wiki
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
A structure that contains mouse button event ,,structure,, ^information^ (event.button.*). A structure that contains mouse button event ,,structure,, ^information^ ,,(event.button.*),,.
Line 25: Line 25:
''You can add useful comments here'' *[[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.

When a mouse button press or release is detected the number of the button pressed (from 1 to 255, with 1 usually being the left button and 2 the right) is placed into '''button''', the position of the mouse when this event occured is stored in the '''x''' and the '''y''' fields. ,,Like [[SDL_KeyboardEvent]], ,,information on whether the event was a press or a release event is stored in both the '''type''' and '''state''' fields, ,,but this should be obvious,,.

Mouse wheel events are reported as buttons 4 (up) and 5 (down). Two events are generated i.e. you get an SDL_MOUSEBUTTONDOWN followed by an SDL_MOUSEBUTTONUP event.*
<<Color2(green,Should it read 4 (forward) and 5 (backward) instead of up and down or is a mouse wheel event a click on the wheel like a center button instead of a roll action?)>>

== Related Structures ==
 .[[SDL_MouseMotionEvent]] *???
 .[[SDL_MouseWheelEvent]] ???

DRAFT

SDL_MouseButtonEvent

A structure that contains mouse button event structure information (event.button.*).

Data Fields

Uint8

type

SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP

Uint32

windowID

the window with mouse focus, if any

Uint8

which

the mouse device index

Uint8

button

the mouse button index

Uint8

state

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.

When a mouse button press or release is detected the number of the button pressed (from 1 to 255, with 1 usually being the left button and 2 the right) is placed into button, the position of the mouse when this event occured is stored in the x and the y fields. Like [[SDL_KeyboardEvent]], information on whether the event was a press or a release event is stored in both the type and state fields, but this should be obvious.

Mouse wheel events are reported as buttons 4 (up) and 5 (down). Two events are generated i.e. you get an SDL_MOUSEBUTTONDOWN followed by an SDL_MOUSEBUTTONUP event.* green


CategoryStruct

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