mirror of
https://github.com/slendidev/lunar.git
synced 2026-01-30 16:28:58 +02:00
libinput for keyboard input :3
Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
@@ -8,6 +8,11 @@
|
||||
|
||||
#include <imgui.h>
|
||||
|
||||
struct libinput;
|
||||
struct libinput_event_keyboard;
|
||||
struct libinput_event_pointer;
|
||||
struct udev;
|
||||
|
||||
namespace Lunar {
|
||||
|
||||
struct VulkanRenderer;
|
||||
@@ -23,13 +28,26 @@ struct Application {
|
||||
auto toggle_mouse_captured() -> void { mouse_captured(!m_mouse_captured); }
|
||||
|
||||
private:
|
||||
auto init_input() -> void;
|
||||
auto shutdown_input() -> void;
|
||||
auto process_libinput_events() -> void;
|
||||
auto handle_keyboard_event(libinput_event_keyboard *event) -> void;
|
||||
auto clamp_mouse_to_window(int width, int height) -> void;
|
||||
|
||||
SDL_Window *m_window { nullptr };
|
||||
Logger m_logger { "Lunar" };
|
||||
std::unique_ptr<VulkanRenderer> m_renderer;
|
||||
|
||||
udev *m_udev { nullptr };
|
||||
libinput *m_libinput { nullptr };
|
||||
|
||||
bool m_running { true };
|
||||
bool m_mouse_captured { false };
|
||||
bool m_show_imgui { false };
|
||||
int m_ctrl_pressed_count { 0 };
|
||||
|
||||
double m_mouse_x { 0.0 };
|
||||
double m_mouse_y { 0.0 };
|
||||
};
|
||||
|
||||
} // namespace Lunar
|
||||
|
||||
Reference in New Issue
Block a user