7#ifndef __KIS_SHORTCUT_MATCHER_H
8#define __KIS_SHORTCUT_MATCHER_H
19class QNativeGestureEvent;
77 static constexpr int TOUCH_SLOP_SQUARED = 16 * 16;
82 bool hasRunningShortcut()
const;
83 bool hasTouchHoldShortcut()
const;
97 bool supportsHiResInputEvents();
106 bool keyPressed(Qt::Key key);
115 bool autoRepeatedKeyPressed(Qt::Key key);
124 bool keyReleased(Qt::Key key);
135 bool buttonPressed(Qt::MouseButton
button, QEvent *event);
146 bool buttonReleased(Qt::MouseButton
button, QEvent *event);
164 bool pointerMoved(QEvent *event);
178 bool touchBeginEvent(QTouchEvent *event);
179 bool touchUpdateEvent(QTouchEvent *event);
180 bool touchEndEvent(QTouchEvent *event);
187 void touchCancelEvent(QTouchEvent *event,
const QPointF &localPos);
194 bool touchHoldBeginEvent(QTouchEvent *event);
196 bool nativeGestureBeginEvent(QNativeGestureEvent *event);
197 bool nativeGestureEvent(QNativeGestureEvent *event);
198 bool nativeGestureEndEvent(QNativeGestureEvent *event);
216 void reinitializeButtons();
234 bool sanityCheckModifiersCorrectness(Qt::KeyboardModifiers modifiers)
const;
244 bool hasPolledKeys();
250 void lostFocusEvent(
const QPointF &localPos);
256 void toolHasBeenActivated();
286 void clearShortcuts();
288 void setInputActionGroupsMaskCallback(std::function<KisInputActionGroupsMask()> func);
291 friend class KisInputManagerTest;
294 void reset(QString msg);
297 template<
typename T,
typename U>
bool tryRunSingleActionShortcutImpl(T param, U *event,
const QSet<Qt::Key> &keysState,
bool keyboard =
true);
299 void prepareReadyShortcuts();
301 bool tryRunReadyShortcut( Qt::MouseButton
button, QEvent* event );
302 void tryActivateReadyShortcut();
303 bool tryEndRunningShortcut( Qt::MouseButton
button, QEvent* event );
304 void forceEndRunningShortcut(
const QPointF &localPos);
305 void forceDeactivateAllActions();
307 void setMaxTouchPointEvent(QTouchEvent *event);
308 void fireReadyTouchShortcut(QTouchEvent *event);
310 bool matchTouchShortcutBasedOnState(QTouchEvent *event,
KisTouchShortcut *shortcut);
311 bool tryRunTouchShortcut(QTouchEvent *event);
312 bool tryEndTouchShortcut(QTouchEvent *event);
314 bool tryRunNativeGestureShortcut(QNativeGestureEvent *event);
315 bool tryEndNativeGestureShortcut(QNativeGestureEvent *event);
float value(const T *src, size_t ch)
void suppressAllKeyboardActions(bool value)
void suppressAllActions(bool value)
The KisTouchShortcut class only handles touch gestures it does not handle tool invocation i....
QString button(const QWheelEvent &ev)