summaryrefslogtreecommitdiff
path: root/src/managers/InputManager.hpp
blob: ce1afceabc72526d6128e0f4661b42a5f13efaa6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once

#include "../defines.hpp"
#include <list>
#include "../helpers/WLClasses.hpp"
#include "../Window.hpp"

class CInputManager {
public:

    void            onMouseMoved(wlr_event_pointer_motion*);
    void            onMouseWarp(wlr_event_pointer_motion_absolute*);
    void            onMouseButton(wlr_event_pointer_button*);
    void            onKeyboardKey(wlr_event_keyboard_key*, SKeyboard*);
    void            onKeyboardMod(void*, SKeyboard*);

    void            newKeyboard(wlr_input_device*);
    void            newMouse(wlr_input_device*);
    void            destroyKeyboard(SKeyboard*);
    void            destroyMouse(wlr_input_device*);

    Vector2D        getMouseCoordsInternal();


    // for dragging floating windows
    CWindow*        currentlyDraggedWindow = nullptr;
    int             dragButton = -1;

private:

    std::list<SKeyboard> m_lKeyboards;

    void            mouseMoveUnified(uint32_t);

};

inline std::unique_ptr<CInputManager> g_pInputManager;