diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-09 21:54:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-09 21:54:10 +0200 |
| commit | b5a446ddfd1ecdae27f44b610acb33578d9ec5e3 (patch) | |
| tree | be6586699337ca033477c3e3861060fc30472dbb /src/managers/input/InputManager.hpp | |
| parent | 248ce664593feddd84d6897ae6b40a3a5fa145c0 (diff) | |
| parent | fbc78534599f3129b11899795ba3d099eae4c5fd (diff) | |
Merge pull request #177 from vaxerski/tablets
Added Tablets support
Diffstat (limited to 'src/managers/input/InputManager.hpp')
| -rw-r--r-- | src/managers/input/InputManager.hpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/managers/input/InputManager.hpp b/src/managers/input/InputManager.hpp new file mode 100644 index 00000000..1cd99658 --- /dev/null +++ b/src/managers/input/InputManager.hpp @@ -0,0 +1,66 @@ +#pragma once + +#include "../../defines.hpp" +#include <list> +#include "../../helpers/WLClasses.hpp" +#include "../../Window.hpp" + +class CInputManager { +public: + + 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*); + void onKeyboardMod(void*, SKeyboard*); + + void newKeyboard(wlr_input_device*); + void newMouse(wlr_input_device*); + void destroyKeyboard(SKeyboard*); + void destroyMouse(wlr_input_device*); + + void constrainMouse(SMouse*, wlr_pointer_constraint_v1*); + void recheckConstraint(SMouse*); + + Vector2D getMouseCoordsInternal(); + void refocus(); + + void setKeyboardLayout(); + + void updateDragIcon(); + void updateCapabilities(wlr_input_device*); + + + // for dragging floating windows + CWindow* currentlyDraggedWindow = nullptr; + int dragButton = -1; + + SDrag m_sDrag; + + std::list<SConstraint> m_lConstraints; + std::list<SKeyboard> m_lKeyboards; + std::list<SMouse> m_lMice; + + // tablets + std::list<STablet> m_lTablets; + std::list<STabletTool> m_lTabletTools; + std::list<STabletPad> m_lTabletPads; + + void newTabletTool(wlr_input_device*); + void newTabletPad(wlr_input_device*); + void focusTablet(STablet*, wlr_tablet_tool*, bool motion = false); + + SKeyboard* m_pActiveKeyboard = nullptr; + + private: + + uint32_t m_uiCapabilities = 0; + + void mouseMoveUnified(uint32_t, bool refocus = false); + + STabletTool* ensureTabletToolPresent(wlr_tablet_tool*); + + void unfocusAllTablets(); +}; + +inline std::unique_ptr<CInputManager> g_pInputManager;
\ No newline at end of file |
