2022-03-17 15:53:45 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../defines.hpp"
|
2022-03-18 23:25:26 +01:00
|
|
|
#include <list>
|
2022-03-17 20:55:04 +01:00
|
|
|
#include "../helpers/WLClasses.hpp"
|
2022-03-20 11:14:24 +01:00
|
|
|
#include "../Window.hpp"
|
2022-03-17 15:53:45 +01:00
|
|
|
|
|
|
|
class CInputManager {
|
|
|
|
public:
|
|
|
|
|
2022-03-24 15:57:46 +01:00
|
|
|
void onMouseMoved(wlr_pointer_motion_event*);
|
|
|
|
void onMouseWarp(wlr_pointer_motion_absolute_event*);
|
|
|
|
void onMouseButton(wlr_pointer_button_event*);
|
|
|
|
void onKeyboardKey(wlr_keyboard_key_event*, SKeyboard*);
|
2022-03-18 23:06:45 +01:00
|
|
|
void onKeyboardMod(void*, SKeyboard*);
|
2022-03-17 15:53:45 +01:00
|
|
|
|
2022-03-17 20:55:04 +01:00
|
|
|
void newKeyboard(wlr_input_device*);
|
2022-03-18 22:53:27 +01:00
|
|
|
void newMouse(wlr_input_device*);
|
2022-03-18 23:25:26 +01:00
|
|
|
void destroyKeyboard(SKeyboard*);
|
|
|
|
void destroyMouse(wlr_input_device*);
|
2022-03-17 19:03:15 +01:00
|
|
|
|
|
|
|
Vector2D getMouseCoordsInternal();
|
2022-03-21 19:28:43 +01:00
|
|
|
void refocus();
|
2022-03-17 19:03:15 +01:00
|
|
|
|
2022-03-20 11:14:24 +01:00
|
|
|
|
|
|
|
// for dragging floating windows
|
|
|
|
CWindow* currentlyDraggedWindow = nullptr;
|
|
|
|
int dragButton = -1;
|
|
|
|
|
2022-03-17 15:53:45 +01:00
|
|
|
private:
|
|
|
|
|
2022-03-18 23:25:26 +01:00
|
|
|
std::list<SKeyboard> m_lKeyboards;
|
2022-03-17 20:55:04 +01:00
|
|
|
|
2022-03-18 23:52:36 +01:00
|
|
|
void mouseMoveUnified(uint32_t);
|
|
|
|
|
2022-03-17 15:53:45 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
inline std::unique_ptr<CInputManager> g_pInputManager;
|