TSDL_MouseButtonEvent

Name

   TSDL_MouseButtonEvent -- Mouse button event structure

Structure Definition

  TSDL_MouseButtonEvent = record
type_: UInt8; // SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP
which: UInt8; // The mouse device index
state: UInt8; // The mouse button index
button: UInt8; // SDL_PRESSED or SDL_RELEASED
x: UInt16; // The X coordinates of the mouse at press time
y: UInt16; // The Y coordinates of the mouse at press time
end;

Structure Data

type SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP
button The mouse button index (SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT)
state SDL_PRESSED or SDL_RELEASED
x , y The X/Y coordinates of the mouse at press/release time

Description

TSDL_MouseButtonEvent is a member of the TSDL_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 then 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 TSDL_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.

See Also

TSDL_EventTSDL_MouseMotionEvent