12#include <klocalizedstring.h>
39 d->indexes.insert(i18n(
"Activate"), 0);
59 Q_UNUSED(oldShortcut);
60 Q_UNUSED(newShortcut);
70 d->startCursorPosition =
d->lastCursorPosition;
80 d->lastCursorPosition = newPosition;
115 return Private::inputManager;
125 return d->description;
165 Private::inputManager = manager;
180 switch (event->type()) {
181 case QEvent::MouseMove:
182 case QEvent::MouseButtonPress:
183 case QEvent::MouseButtonDblClick:
184 case QEvent::MouseButtonRelease:
185 return static_cast<const QMouseEvent*
>(event)->pos();
187 case QEvent::TabletMove:
188 case QEvent::TabletPress:
189 case QEvent::TabletRelease:
190 return static_cast<const QTabletEvent*
>(event)->pos();
192 case QEvent::TouchBegin:
193 case QEvent::TouchUpdate:
194 case QEvent::TouchEnd:
195 return static_cast<const QTouchEvent *
>(event)->touchPoints().at(0).pos().toPoint();
198 return static_cast<const QWheelEvent*
>(event)->position().toPoint();
200 case QEvent::NativeGesture: {
210#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
211 return canvas->
canvasWidget()->mapFromGlobal(QPointF(
static_cast<const QNativeGestureEvent*
>(event)->globalPos())).toPoint();
213 return canvas->
canvasWidget()->mapFromGlobal(
static_cast<const QNativeGestureEvent*
>(event)->globalPos());
218 warnUI <<
"KisAbstractInputAction" <<
d->name <<
"tried to process event data from an unhandled event type" <<
event->type();
229 switch (event->type()) {
230 case QEvent::MouseMove:
231 case QEvent::MouseButtonPress:
232 case QEvent::MouseButtonDblClick:
233 case QEvent::MouseButtonRelease:
234 return static_cast<const QMouseEvent*
>(event)->localPos();
236 case QEvent::TabletMove:
237 case QEvent::TabletPress:
238 case QEvent::TabletRelease:
239 return static_cast<const QTabletEvent*
>(event)->posF();
241 case QEvent::TouchBegin:
242 case QEvent::TouchUpdate:
243 case QEvent::TouchEnd:
244 return static_cast<const QTouchEvent *
>(event)->touchPoints().at(0).pos();
247 return static_cast<const QWheelEvent*
>(event)->position();
249 case QEvent::NativeGesture: {
259#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
260 return canvas->
canvasWidget()->mapFromGlobal(QPointF(
static_cast<const QNativeGestureEvent*
>(event)->globalPos()));
262 return canvas->
canvasWidget()->mapFromGlobal(
static_cast<const QNativeGestureEvent*
>(event)->globalPos());
266 warnUI <<
"KisAbstractInputAction" <<
d->name <<
"tried to process event data from an unhandled event type" <<
event->type();
KisAbstractCanvasWidget * canvasWidget
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)