libghostty
Loading...
Searching...
No Matches
mouse/event.h
Go to the documentation of this file.
1
6
7#ifndef GHOSTTY_VT_MOUSE_EVENT_H
8#define GHOSTTY_VT_MOUSE_EVENT_H
9
10#include <stdbool.h>
13#include <ghostty/vt/types.h>
14
23typedef struct GhosttyMouseEventImpl *GhosttyMouseEvent;
24
30typedef enum GHOSTTY_ENUM_TYPED {
33
36
39 GHOSTTY_MOUSE_ACTION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
41
47typedef enum GHOSTTY_ENUM_TYPED {
48 GHOSTTY_MOUSE_BUTTON_UNKNOWN = 0,
49 GHOSTTY_MOUSE_BUTTON_LEFT = 1,
50 GHOSTTY_MOUSE_BUTTON_RIGHT = 2,
51 GHOSTTY_MOUSE_BUTTON_MIDDLE = 3,
52 GHOSTTY_MOUSE_BUTTON_FOUR = 4,
53 GHOSTTY_MOUSE_BUTTON_FIVE = 5,
54 GHOSTTY_MOUSE_BUTTON_SIX = 6,
55 GHOSTTY_MOUSE_BUTTON_SEVEN = 7,
56 GHOSTTY_MOUSE_BUTTON_EIGHT = 8,
57 GHOSTTY_MOUSE_BUTTON_NINE = 9,
58 GHOSTTY_MOUSE_BUTTON_TEN = 10,
59 GHOSTTY_MOUSE_BUTTON_ELEVEN = 11,
60 GHOSTTY_MOUSE_BUTTON_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
62
68typedef struct {
69 float x;
70 float y;
72
83 GhosttyMouseEvent *event);
84
93
103 GhosttyMouseAction action);
104
114
128 GhosttyMouseButton button);
129
140
151 GhosttyMouseButton *out_button);
152
162 GhosttyMods mods);
163
173
183 GhosttyMousePosition position);
184
194
195#endif /* GHOSTTY_VT_MOUSE_EVENT_H */
uint16_t GhosttyMods
Definition key/event.h:57
GHOSTTY_API void ghostty_mouse_event_set_position(GhosttyMouseEvent event, GhosttyMousePosition position)
GHOSTTY_API void ghostty_mouse_event_set_button(GhosttyMouseEvent event, GhosttyMouseButton button)
GHOSTTY_API void ghostty_mouse_event_set_mods(GhosttyMouseEvent event, GhosttyMods mods)
GHOSTTY_API bool ghostty_mouse_event_get_button(GhosttyMouseEvent event, GhosttyMouseButton *out_button)
GHOSTTY_API void ghostty_mouse_event_set_action(GhosttyMouseEvent event, GhosttyMouseAction action)
GHOSTTY_API void ghostty_mouse_event_free(GhosttyMouseEvent event)
GhosttyMouseButton
Definition mouse/event.h:47
struct GhosttyMouseEventImpl * GhosttyMouseEvent
Definition mouse/event.h:23
GHOSTTY_API GhosttyMods ghostty_mouse_event_get_mods(GhosttyMouseEvent event)
GHOSTTY_API GhosttyResult ghostty_mouse_event_new(const GhosttyAllocator *allocator, GhosttyMouseEvent *event)
GHOSTTY_API GhosttyMouseAction ghostty_mouse_event_get_action(GhosttyMouseEvent event)
GhosttyMouseAction
Definition mouse/event.h:30
GHOSTTY_API GhosttyMousePosition ghostty_mouse_event_get_position(GhosttyMouseEvent event)
GHOSTTY_API void ghostty_mouse_event_clear_button(GhosttyMouseEvent event)
@ GHOSTTY_MOUSE_ACTION_PRESS
Definition mouse/event.h:32
@ GHOSTTY_MOUSE_ACTION_RELEASE
Definition mouse/event.h:35
@ GHOSTTY_MOUSE_ACTION_MOTION
Definition mouse/event.h:38
GhosttyResult
Definition types.h:74
#define GHOSTTY_ENUM_TYPED
Definition types.h:67