examples/vtouchpad/mouse_win.c file

Mouse windows implementation.

Contents

Classes

struct mouse

Functions

auto mouse_new(void) -> mouse_t*
Do nothing, stub.
auto mouse_free(mouse_t* mouse) -> void*
Do nothing, stub.
auto mouse_move_relative(mouse_t* mouse, int x_off, int y_off) -> int
Moves the mouse pointed by mouse to the offsets x_off and y_off.
auto mouse_down(mouse_t* mouse, int button) -> int
Makes a 'button press' event according to the mouse pointer and the button (left or right).
auto mouse_up(mouse_t* mouse, int button) -> int
Makes a 'button release' event according to the mouse pointer and the button (left or right).

Function documentation

mouse_t* mouse_new(void)

Do nothing, stub.

Returns Returns always 0.

void* mouse_free(mouse_t* mouse)

Do nothing, stub.

Parameters
mouse Mouse structure pointer.
Returns Returns always NULL.

int mouse_move_relative(mouse_t* mouse, int x_off, int y_off)

Moves the mouse pointed by mouse to the offsets x_off and y_off.

Parameters
mouse Mouse structure pointer.
x_off X-coordinate offset.
y_off Y-coordinate offset.
Returns Returns 0 if success, 1 otherwise.

int mouse_down(mouse_t* mouse, int button)

Makes a 'button press' event according to the mouse pointer and the button (left or right).

Parameters
mouse Mouse structure pointer.
button Which button was pressed (either MOUSE_BTN_LEFT or MOUSE_BTN_RIGHT).
Returns Returns 0 if success, 1 otherwise.

int mouse_up(mouse_t* mouse, int button)

Makes a 'button release' event according to the mouse pointer and the button (left or right).

Parameters
mouse Mouse structure pointer.
button Which button was released (either MOUSE_BTN_LEFT or MOUSE_BTN_RIGHT).
Returns Returns 0 if success, 1 otherwise.