pygame2.sdl.mouse – SDL mouse I/O wrapper module

SDL mouse I/O wrapper module

Module Functions

pygame2.sdl.mouse.get_position() → x, y
Gets the current mouse position on the main screen.
pygame2.sdl.mouse.get_rel_position() → x, y

Gets the relative mouse movement.

Gets the relative mouse movement since the last call to this function.

pygame2.sdl.mouse.get_rel_state() → buttons, x, y

Gets the relative mouse state.

Gets the relative mouse state since the last call to this function.

pygame2.sdl.mouse.get_state() → buttons, x, y

Gets the current mouse state.

Gets the current mouse state. The returned buttons value represents a bitmask with the pressed buttons.

pygame2.sdl.mouse.set_cursor(cursor) → None

Sets the mouse cursor to be shown.

Sets the mouse cursor to be displayed. The change will be visible immediately.

pygame2.sdl.mouse.set_position(x, y) → None
pygame2.sdl.mouse.set_position(point) → None

Sets the position of the mouse cursor.

Sets the position of the mouse cursor on the main screen. This behaves exactly as the warp() method.

pygame2.sdl.mouse.set_visible(show) → state

Toggles whether the cursor is shown on the screen.

Toggles whether the cursor is shown on the screen. This behaves exactly as the show_cursor() method.

pygame2.sdl.mouse.show_cursor(show) → state

Toggles whether the cursor is shown on the screen.

Toggles whether the cursor is shown on the screen. show can be a boolean or one a value of ENABLE, DISABLE and QUERY. QUERY will not change the visibility state but query, if the cursor is currently shown or not.

The state returned is a value of ENABLE and DISABLE, indicating, whether the cursor is currently shown or not.

pygame2.sdl.mouse.warp(x, y) → None
pygame2.sdl.mouse.warp(point) → None

Sets the position of the mouse cursor.

Sets the position of the mouse cursor on the main screen. This also will generate a mouse motion event.

Cursor

class pygame2.sdl.mouse.Cursor(data, mask, width, height[, hotx, hoty]) → Cursor
class pygame2.sdl.mouse.Cursor(data, mask, size[, point]) → Cursor

Creates a new mouse cursor pointer.

Creates a new mouse cursor pointer from the specified pixel data and pixel mask. The mask is used for applying transparency to the data defining the mouse cursor.

Table Of Contents

Previous topic

pygame2.sdl.keyboard – SDL keyboard I/O wrapper module

Next topic

pygame2.sdl.rwops – SDL RWops wrapper module

This Page