libtcoddocumentation

8. Mouse support

Display and hide the mouse cursor

By default, the mouse cursor in visible in windowed mode, hidden in fullscreen mode. You can change it with:

static void TCODMouse::showCursor (bool visible)

void TCOD_mouse_show_cursor (bool visible)

mouse_show_cursor (visible)

ParameterDescription
visibleIf true, this function turns the mouse cursor on. Else it turns the mouse cursor off.

Getting the cursor status

You can get the current cursor status (hidden or visible) with:

static bool TCODMouse::isCursorVisible (void)

bool TCOD_mouse_is_cursor_visible (void)

mouse_is_cursor_visible ()

Setting the mouse cursor's position

You can set the cursor position (in pixel coordinates, where [0,0] is the window's top left corner) with:

static void TCODMouse::move (int x, int y)

void TCOD_mouse_move (int x, int y)

mouse_move (x, y)

ParameterDescription
x,yNew coordinates of the mouse cursor in pixels.