Hyprland/src/managers/InputManager.hpp

37 lines
1,006 B
C++
Raw Normal View History

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:
void onMouseMoved(wlr_event_pointer_motion*);
2022-03-17 16:56:33 +01:00
void onMouseWarp(wlr_event_pointer_motion_absolute*);
2022-03-18 20:42:49 +01:00
void onMouseButton(wlr_event_pointer_button*);
2022-03-18 23:06:45 +01:00
void onKeyboardKey(wlr_event_keyboard_key*, SKeyboard*);
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-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;