diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-02-22 23:30:10 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-22 23:30:10 +0000 |
| commit | b88813c7efa4b7b0c5fe01471c5fa5b67a61dc7e (patch) | |
| tree | 4454e82bc033d7e28a23ee372d0e3f48341d0aaa /src/managers/input/Tablets.cpp | |
| parent | b4ee4674f9a74e3d602c7fb17bc09f79d221583c (diff) | |
event: refactor HookSystem into a typed event bus (#13333)
Refactors the old HookSystem into a typed event bus with clear
separation,
discovery and types.
Diffstat (limited to 'src/managers/input/Tablets.cpp')
| -rw-r--r-- | src/managers/input/Tablets.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/managers/input/Tablets.cpp b/src/managers/input/Tablets.cpp index 52be6eee..a2fec15c 100644 --- a/src/managers/input/Tablets.cpp +++ b/src/managers/input/Tablets.cpp @@ -2,11 +2,11 @@ #include "../../desktop/view/Window.hpp" #include "../../protocols/Tablet.hpp" #include "../../devices/Tablet.hpp" -#include "../../managers/HookSystemManager.hpp" #include "../../managers/PointerManager.hpp" #include "../../managers/SeatManager.hpp" #include "../../protocols/PointerConstraints.hpp" #include "../../protocols/core/DataDevice.hpp" +#include "../../event/EventBus.hpp" static void unfocusTool(SP<CTabletTool> tool) { if (!tool->getSurface()) @@ -107,6 +107,11 @@ static Vector2D transformToActiveRegion(const Vector2D pos, const CBox activeAre } void CInputManager::onTabletAxis(CTablet::SAxisEvent e) { + Event::SCallbackInfo info; + Event::bus()->m_events.input.tablet.axis.emit(e, info); + if (info.cancelled) + return; + const auto PTAB = e.tablet; const auto PTOOL = ensureTabletToolPresent(e.tool); @@ -171,7 +176,10 @@ void CInputManager::onTabletAxis(CTablet::SAxisEvent e) { } void CInputManager::onTabletTip(CTablet::STipEvent e) { - EMIT_HOOK_EVENT_CANCELLABLE("tabletTip", e); + Event::SCallbackInfo info; + Event::bus()->m_events.input.tablet.tip.emit(e, info); + if (info.cancelled) + return; const auto PTAB = e.tablet; const auto PTOOL = ensureTabletToolPresent(e.tool); @@ -196,6 +204,11 @@ void CInputManager::onTabletTip(CTablet::STipEvent e) { } void CInputManager::onTabletButton(CTablet::SButtonEvent e) { + Event::SCallbackInfo info; + Event::bus()->m_events.input.tablet.button.emit(e, info); + if (info.cancelled) + return; + const auto PTOOL = ensureTabletToolPresent(e.tool); if (e.down) @@ -210,6 +223,11 @@ void CInputManager::onTabletButton(CTablet::SButtonEvent e) { } void CInputManager::onTabletProximity(CTablet::SProximityEvent e) { + Event::SCallbackInfo info; + Event::bus()->m_events.input.tablet.proximity.emit(e, info); + if (info.cancelled) + return; + const auto PTAB = e.tablet; const auto PTOOL = ensureTabletToolPresent(e.tool); |
