|
Size: 1782
Comment: Updated types to match SDL_events.h.
|
Size: 2043
Comment: Updated structure.
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 11: | Line 11: |
| ||Uint32||'''timestamp'''||timestamp of the event|| | |
| Line 15: | Line 16: |
| ||<style="color: #808080;">Uint8||<style="color: #808080;">'''padding1'''||<style="color: #808080;">|| ||<style="color: #808080;">Uint8||<style="color: #808080;">'''padding2'''||<style="color: #808080;">|| |
SDL_MouseButtonEvent
A structure that contains mouse button event information.
Contents
Data Fields
Uint32 |
type |
the event type; SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP |
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 |
Uint8 |
button |
the button that changed; see Remarks for details |
Uint8 |
state |
the state of the button; SDL_PRESSED or SDL_RELEASED |
Uint8 |
padding1 |
|
Uint8 |
padding2 |
|
Sint32 |
x |
X coordinate, relative to window |
Sint32 |
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 |
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.
Related Enumerations
Related Structures
