Kore 3
Loading...
Searching...
No Matches
mouse.h File Reference

Provides mouse-support. More...

#include <kore3/global.h>
#include <stdbool.h>

Go to the source code of this file.

Macros

#define KORE_MOUSE_LEFT   0
#define KORE_MOUSE_RIGHT   1
#define KORE_MOUSE_MIDDLE   2
#define KORE_MOUSE_EXTRA1   3
#define KORE_MOUSE_EXTRA2   4

Functions

KORE_FUNC void kore_mouse_set_press_callback (void(*value)(int, int, int, int, void *), void *data)
 Sets the mouse-press-callback which is called when a mouse-button is pressed. The button callback argument will usually contain one of the KORE_MOUSE_* values, but can contain higher values on certain platforms when mice with a lot of buttons are used.
KORE_FUNC void kore_mouse_set_release_callback (void(*value)(int, int, int, int, void *), void *data)
 Sets the mouse-release-callback which is called when a mouse-button is released. The button callback argument will usually contain one of the KORE_MOUSE_* values, but can contain higher values on certain platforms when mice with a lot of buttons are used.
KORE_FUNC void kore_mouse_set_move_callback (void(*value)(int, int, int, int, int, void *), void *data)
 Sets the mouse-move-callback which is called when the mouse is moved.
KORE_FUNC void kore_mouse_set_scroll_callback (void(*value)(int, int, void *), void *data)
 Sets the mouse-scroll-callback which is called when the mouse wheel is spinning.
KORE_FUNC void kore_mouse_set_enter_window_callback (void(*value)(int, void *), void *data)
 Sets the mouse-enter-window-callback which is called when the mouse-cursor enters the application-window.
KORE_FUNC void kore_mouse_set_leave_window_callback (void(*value)(int, void *), void *data)
 Sets the mouse-leave-window-callback which is called when the mouse-cursor leaves the application-window.
KORE_FUNC bool kore_mouse_can_lock (void)
 Figures out whether mouse-locking is supported.
KORE_FUNC bool kore_mouse_is_locked (void)
 Figures out whether the mouse is currently locked.
KORE_FUNC void kore_mouse_lock (int window)
 Locks the mouse to a window.
KORE_FUNC void kore_mouse_unlock (void)
 Unlocks the mouse.
KORE_FUNC void kore_mouse_set_cursor (int cursor)
 Change the cursor-image to something that's semi-randomly based on the provided int.
KORE_FUNC void kore_mouse_show (void)
 Shows the mouse-cursor.
KORE_FUNC void kore_mouse_hide (void)
 Hides the mouse-cursor.
KORE_FUNC void kore_mouse_set_position (int window, int x, int y)
 Manually sets the mouse-cursor-position.
KORE_FUNC void kore_mouse_get_position (int window, int *x, int *y)
 Gets the current mouse-position relative to a window.

Detailed Description

Provides mouse-support.

Function Documentation

◆ kore_mouse_can_lock()

KORE_FUNC bool kore_mouse_can_lock ( void )

Figures out whether mouse-locking is supported.

Returns
Whether mouse-locking is supported

◆ kore_mouse_get_position()

KORE_FUNC void kore_mouse_get_position ( int window,
int * x,
int * y )

Gets the current mouse-position relative to a window.

Parameters
windowThe window to base the returned position on
xA pointer where the cursor's x-position is put into
yA pointer where the cursor's y-position is put into

◆ kore_mouse_is_locked()

KORE_FUNC bool kore_mouse_is_locked ( void )

Figures out whether the mouse is currently locked.

Returns
Whether the mouse is currently locked

◆ kore_mouse_lock()

KORE_FUNC void kore_mouse_lock ( int window)

Locks the mouse to a window.

Parameters
windowThe window to lock the mouse to

◆ kore_mouse_set_cursor()

KORE_FUNC void kore_mouse_set_cursor ( int cursor)

Change the cursor-image to something that's semi-randomly based on the provided int.

Parameters
cursorDefines what the cursor is changed to - somehow

◆ kore_mouse_set_enter_window_callback()

KORE_FUNC void kore_mouse_set_enter_window_callback ( void(* value )(int, void *),
void * data )

Sets the mouse-enter-window-callback which is called when the mouse-cursor enters the application-window.

Parameters
valueThe callback

◆ kore_mouse_set_leave_window_callback()

KORE_FUNC void kore_mouse_set_leave_window_callback ( void(* value )(int, void *),
void * data )

Sets the mouse-leave-window-callback which is called when the mouse-cursor leaves the application-window.

Parameters
valueThe callback

◆ kore_mouse_set_move_callback()

KORE_FUNC void kore_mouse_set_move_callback ( void(* value )(int, int, int, int, int, void *),
void * data )

Sets the mouse-move-callback which is called when the mouse is moved.

Parameters
valueThe callback

◆ kore_mouse_set_position()

KORE_FUNC void kore_mouse_set_position ( int window,
int x,
int y )

Manually sets the mouse-cursor-position.

Parameters
windowThe window to place the cursor in
xThe x-position inside the window to place the cursor at
yThe y-position inside the window to place the cursor at

◆ kore_mouse_set_press_callback()

KORE_FUNC void kore_mouse_set_press_callback ( void(* value )(int, int, int, int, void *),
void * data )

Sets the mouse-press-callback which is called when a mouse-button is pressed. The button callback argument will usually contain one of the KORE_MOUSE_* values, but can contain higher values on certain platforms when mice with a lot of buttons are used.

Parameters
valueThe callback

◆ kore_mouse_set_release_callback()

KORE_FUNC void kore_mouse_set_release_callback ( void(* value )(int, int, int, int, void *),
void * data )

Sets the mouse-release-callback which is called when a mouse-button is released. The button callback argument will usually contain one of the KORE_MOUSE_* values, but can contain higher values on certain platforms when mice with a lot of buttons are used.

Parameters
valueThe callback

◆ kore_mouse_set_scroll_callback()

KORE_FUNC void kore_mouse_set_scroll_callback ( void(* value )(int, int, void *),
void * data )

Sets the mouse-scroll-callback which is called when the mouse wheel is spinning.

Parameters
valueThe callback

◆ kore_mouse_unlock()

KORE_FUNC void kore_mouse_unlock ( void )

Unlocks the mouse.

Returns