2024-01-04 12:09:49 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2024-05-28 18:00:39 +03:00
|
|
|
namespace LibInput
|
2024-01-04 12:09:49 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
enum class MouseButton
|
|
|
|
{
|
|
|
|
Left, Right, Middle, Extra1, Extra2
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MouseButtonEvent
|
|
|
|
{
|
|
|
|
MouseButton button;
|
|
|
|
bool pressed;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MouseMoveEvent
|
|
|
|
{
|
|
|
|
int32_t rel_x;
|
|
|
|
int32_t rel_y;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MouseScrollEvent
|
|
|
|
{
|
|
|
|
int32_t scroll;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class MouseEventType
|
|
|
|
{
|
|
|
|
MouseButtonEvent,
|
|
|
|
MouseMoveEvent,
|
|
|
|
MouseScrollEvent,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MouseEvent
|
|
|
|
{
|
|
|
|
MouseEventType type;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
MouseButtonEvent button_event;
|
|
|
|
MouseMoveEvent move_event;
|
|
|
|
MouseScrollEvent scroll_event;
|
2024-01-24 14:43:46 +02:00
|
|
|
};
|
2024-01-04 12:09:49 +02:00
|
|
|
};
|
|
|
|
|
2024-01-24 14:43:46 +02:00
|
|
|
}
|