Tao.Sdl SDK Documentation

Sdl.SDL_GetMouseState Method 

Retrieve the current state of the mouse.

[Visual Basic]
Public Shared Function SDL_GetMouseState( _
   ByRef x As Integer, _
   ByRef y As Integer _
) As Byte
[C#]
public static byte SDL_GetMouseState(
   out int x,
   out int y
);

Parameters

x
y

Return Value

Remarks

The current button state is returned as a button bitmask, w hich can be tested using the SDL_BUTTON(X) macros, and x and y are set to the current mouse cursor position. You can pass NULL for either x or y.

Binds to C-function call in SDL_mouse.h:

            Uint8 SDL_GetMouseState(int *x, int *y)
            

Example

            SDL_PumpEvents();
                    if(SDL_GetMouseState(NULL, NULL)&SDL_BUTTON(1))
                    printf("Mouse Button 1(left) is pressed.\n");
            

See Also

Sdl Class | Tao.Sdl Namespace | SDL_GetRelativeMouseState | SDL_PumpEvents