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
24
30typedef enum {
33
36
40
46typedef enum {
47 GHOSTTY_MOUSE_BUTTON_UNKNOWN = 0,
48 GHOSTTY_MOUSE_BUTTON_LEFT = 1,
49 GHOSTTY_MOUSE_BUTTON_RIGHT = 2,
50 GHOSTTY_MOUSE_BUTTON_MIDDLE = 3,
51 GHOSTTY_MOUSE_BUTTON_FOUR = 4,
52 GHOSTTY_MOUSE_BUTTON_FIVE = 5,
53 GHOSTTY_MOUSE_BUTTON_SIX = 6,
54 GHOSTTY_MOUSE_BUTTON_SEVEN = 7,
55 GHOSTTY_MOUSE_BUTTON_EIGHT = 8,
56 GHOSTTY_MOUSE_BUTTON_NINE = 9,
57 GHOSTTY_MOUSE_BUTTON_TEN = 10,
58 GHOSTTY_MOUSE_BUTTON_ELEVEN = 11,
60
66typedef struct {
67 float x;
68 float y;
70
81 GhosttyMouseEvent *event);
82
91
101 GhosttyMouseAction action);
102
112
126 GhosttyMouseButton button);
127
138
149 GhosttyMouseButton *out_button);
150
160 GhosttyMods mods);
161
171
181 GhosttyMousePosition position);
182
192
193#endif /* GHOSTTY_VT_MOUSE_EVENT_H */
uint16_t GhosttyMods
Definition key/event.h:56
GhosttyMouseAction ghostty_mouse_event_get_action(GhosttyMouseEvent event)
GhosttyResult ghostty_mouse_event_new(const GhosttyAllocator *allocator, GhosttyMouseEvent *event)
void ghostty_mouse_event_free(GhosttyMouseEvent event)
GhosttyMods ghostty_mouse_event_get_mods(GhosttyMouseEvent event)
void ghostty_mouse_event_clear_button(GhosttyMouseEvent event)
void ghostty_mouse_event_set_action(GhosttyMouseEvent event, GhosttyMouseAction action)
GhosttyMousePosition ghostty_mouse_event_get_position(GhosttyMouseEvent event)
GhosttyMouseButton
Definition mouse/event.h:46
bool ghostty_mouse_event_get_button(GhosttyMouseEvent event, GhosttyMouseButton *out_button)
struct GhosttyMouseEvent * GhosttyMouseEvent
Definition mouse/event.h:23
void ghostty_mouse_event_set_position(GhosttyMouseEvent event, GhosttyMousePosition position)
void ghostty_mouse_event_set_mods(GhosttyMouseEvent event, GhosttyMods mods)
GhosttyMouseAction
Definition mouse/event.h:30
void ghostty_mouse_event_set_button(GhosttyMouseEvent event, GhosttyMouseButton button)
@ 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:13