Kore 3
Loading...
Searching...
No Matches
mouse.h
Go to the documentation of this file.
1#ifndef KORE_INPUT_MOUSE_HEADER
2#define KORE_INPUT_MOUSE_HEADER
3
4#include <kore3/global.h>
5
6#include <stdbool.h>
7
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#define KORE_MOUSE_LEFT 0
17#define KORE_MOUSE_RIGHT 1
18#define KORE_MOUSE_MIDDLE 2
19// eg backward sidebutton
20#define KORE_MOUSE_EXTRA1 3
21// eg forward sidebutton
22#define KORE_MOUSE_EXTRA2 4
23
30KORE_FUNC void kore_mouse_set_press_callback(void (*value)(int /*window*/, int /*button*/, int /*x*/, int /*y*/, void * /*data*/), void *data);
31
38KORE_FUNC void kore_mouse_set_release_callback(void (*value)(int /*window*/, int /*button*/, int /*x*/, int /*y*/, void * /*data*/), void *data);
39
44KORE_FUNC void kore_mouse_set_move_callback(void (*value)(int /*window*/, int /*x*/, int /*y*/, int /*movement_x*/, int /*movement_y*/, void * /*data*/),
45 void *data);
46
51KORE_FUNC void kore_mouse_set_scroll_callback(void (*value)(int /*window*/, int /*delta*/, void * /*data*/), void *data);
52
57KORE_FUNC void kore_mouse_set_enter_window_callback(void (*value)(int /*window*/, void * /*data*/), void *data);
58
63KORE_FUNC void kore_mouse_set_leave_window_callback(void (*value)(int /*window*/, void * /*data*/), void *data);
64
69KORE_FUNC bool kore_mouse_can_lock(void);
70
75KORE_FUNC bool kore_mouse_is_locked(void);
76
81KORE_FUNC void kore_mouse_lock(int window);
82
88KORE_FUNC void kore_mouse_unlock(void);
89
94KORE_FUNC void kore_mouse_set_cursor(int cursor);
95
99KORE_FUNC void kore_mouse_show(void);
100
104KORE_FUNC void kore_mouse_hide(void);
105
112KORE_FUNC void kore_mouse_set_position(int window, int x, int y);
113
120KORE_FUNC void kore_mouse_get_position(int window, int *x, int *y);
121
122void kore_internal_mouse_trigger_press(int window, int button, int x, int y);
123void kore_internal_mouse_trigger_release(int window, int button, int x, int y);
124void kore_internal_mouse_trigger_move(int window, int x, int y);
125void kore_internal_mouse_trigger_scroll(int window, int delta);
126void kore_internal_mouse_trigger_enter_window(int window);
127void kore_internal_mouse_trigger_leave_window(int window);
128void kore_internal_mouse_lock(int window);
129void kore_internal_mouse_unlock(void);
130void kore_internal_mouse_window_activated(int window);
131void kore_internal_mouse_window_deactivated(int window);
132
133#ifdef __cplusplus
134}
135#endif
136
137#endif
Provides basic functionality that's used all over the place. There's usually no need to manually incl...
KORE_FUNC void kore_mouse_show(void)
Shows the mouse-cursor.
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 arg...
KORE_FUNC void kore_mouse_hide(void)
Hides the mouse-cursor.
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_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_cursor(int cursor)
Change the cursor-image to something that's semi-randomly based on the provided int.
KORE_FUNC bool kore_mouse_can_lock(void)
Figures out whether mouse-locking is supported.
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 ...
KORE_FUNC void kore_mouse_unlock(void)
Unlocks the mouse.
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-win...
KORE_FUNC bool kore_mouse_is_locked(void)
Figures out whether the mouse is currently locked.
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.
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-win...
KORE_FUNC void kore_mouse_lock(int window)
Locks the mouse to a window.