|
Krita Source Code Documentation
|
#include <kis_shortcut_matcher.h>
Inheritance diagram for KisShortcutMatcher:Classes | |
| struct | IgnoreMultiFingerCancelWorkaround |
| struct | RecursionGuard |
| struct | RecursionNotifier |
Static Public Attributes | |
| static constexpr qreal | TOUCH_SLOP = 16 |
| static constexpr int | TOUCH_SLOP_SQUARED = 16 * 16 |
Private Types | |
| enum class | TouchShortcutMode { Drag = 0 , Tap , Hold } |
Private Member Functions | |
| void | forceDeactivateAllActions () |
| void | forceEndRunningShortcut (const QPointF &localPos) |
| KisTouchShortcut * | matchTouchShortcut (QTouchEvent *event, Qt::TouchPointStates allowedStates, TouchShortcutMode mode) |
| bool | matchTouchShortcutBasedOnState (QTouchEvent *event, KisTouchShortcut *shortcut, Qt::TouchPointStates allowedStates, TouchShortcutMode mode) |
| void | prepareReadyShortcuts () |
| void | reset () |
| void | reset (QString msg) |
| void | setMaxTouchPointEvent (QTouchEvent *event) |
| void | slotTouchHoldCompleted () |
| bool | touchUpdateEventImpl (QTouchEvent *event) |
| void | tryActivateReadyShortcut () |
| void | tryCancelAllCurrentTouchActionsImpl () |
| template<typename EventType , typename ShortcutType > | |
| bool | tryEndGestureBasedShortcutImpl (EventType *event, ShortcutType **resultShortcutPtr) |
| bool | tryEndNativeGestureShortcut (QNativeGestureEvent *event) |
| bool | tryEndRunningShortcut (Qt::MouseButton button, QEvent *event) |
| bool | tryEndTouchpadScrollShortcut (QWheelEvent *event) |
| bool | tryEndTouchShortcut (QTouchEvent *event) |
| bool | tryFireTapTouchShortcut (QTouchEvent *event, Qt::TouchPointStates allowedStates) |
| template<typename EventType , typename ShortcutType > | |
| bool | tryRunGestureBasedShortcutImpl (EventType *event, ShortcutType **resultShortcutPtr, const QList< ShortcutType * > allTypedShortcuts) |
| bool | tryRunNativeGestureShortcut (QNativeGestureEvent *event) |
| bool | tryRunReadyShortcut (Qt::MouseButton button, QEvent *event) |
| template<typename T , typename U > | |
| bool | tryRunSingleActionShortcutImpl (T param, U *event, const QSet< Qt::Key > &keysState, bool keyboard=true) |
| bool | tryRunTouchpadScrollShortcut (QWheelEvent *event) |
| bool | tryRunTouchShortcut (QTouchEvent *event, Qt::TouchPointStates allowedStates, TouchShortcutMode mode) |
| bool | tryRunWheelShortcut (KisSingleActionShortcut::WheelAction wheelAction, QWheelEvent *event) |
Private Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Private Attributes | |
| Private *const | m_d |
Private Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Friends | |
| class | KisInputManagerTest |
The class that manages connections between shortcuts and actions.
It processes input events and generates state transitions for the actions basing on the data, represented by the shortcuts.
The class works with two types of actions: long running (represented by KisStrokeShortcuts) and "atomic" (KisSingleActionShortcut). The former one involves some long interaction with the user by means of a mouse cursor or a tablet, the latter one simple action like "Zoom 100%" or "Reset Rotation".
The single action shortcuts are handled quite easily. The matcher listens to the events coming, manages two lists of the pressed keys and buttons and when their content corresponds to some single action shortcut it just runs this shortcut once.
The strategy for handling the stroke shortcuts is a bit more complex. Each such action may be in one of the three states:
Idle <-> Ready <-> Running
In "Idle" state the action is completely inactive and has no access to the user
When the action is in "Ready" state, it means that all the modifiers for the action are already pressed and we are only waiting for a user to press the mouse button and start a stroke. In this state the action can show the user its Cursor to notify the user what is going to happen next.
In the "Running" state, the action has full access to the user input and is considered to perform all the work it was created for.
To implement such state transitions for the actions, KisShortcutMatcher first forms a list of the actions which can be moved to a ready state (m_d->readyShortcuts), then chooses the one with the highest priority to be the only shortcut in the "Ready" state and activates it (m_d->readyShortcut). Then when the user presses the mouse button, the matcher looks through the list of ready shortcuts, chooses which will be running now, deactivates (if needed) currently activated action and starts the chosen one.
Definition at line 89 of file kis_shortcut_matcher.cpp.
|
strongprivate |
| Enumerator | |
|---|---|
| Drag | |
| Tap | |
| Hold | |
Definition at line 320 of file kis_shortcut_matcher.h.
|
inline |
Definition at line 104 of file kis_shortcut_matcher.cpp.
| KisShortcutMatcher::KisShortcutMatcher | ( | ) |
Definition at line 218 of file kis_shortcut_matcher.cpp.
| KisShortcutMatcher::~KisShortcutMatcher | ( | ) |
|
inline |
Definition at line 200 of file kis_shortcut_matcher.cpp.
|
inline |
Definition at line 209 of file kis_shortcut_matcher.cpp.
| void KisShortcutMatcher::addShortcut | ( | KisNativeGestureShortcut * | shortcut | ) |
Definition at line 257 of file kis_shortcut_matcher.cpp.
References m_d.
| void KisShortcutMatcher::addShortcut | ( | KisSingleActionShortcut * | shortcut | ) |
Definition at line 242 of file kis_shortcut_matcher.cpp.
References m_d.
| void KisShortcutMatcher::addShortcut | ( | KisStrokeShortcut * | shortcut | ) |
Definition at line 247 of file kis_shortcut_matcher.cpp.
References m_d.
| void KisShortcutMatcher::addShortcut | ( | KisTouchpadScrollShortcut * | shortcut | ) |
Definition at line 262 of file kis_shortcut_matcher.cpp.
References m_d.
| void KisShortcutMatcher::addShortcut | ( | KisTouchShortcut * | shortcut | ) |
Definition at line 252 of file kis_shortcut_matcher.cpp.
References m_d.
| bool KisShortcutMatcher::autoRepeatedKeyPressed | ( | Qt::Key | key | ) |
Handles a key press event that has been generated by the autorepeat.
Definition at line 304 of file kis_shortcut_matcher.cpp.
References DEBUG_ACTION, forceDeactivateAllActions(), hasRunningShortcut(), m_d, and tryRunSingleActionShortcutImpl().
| bool KisShortcutMatcher::buttonPressed | ( | Qt::MouseButton | button, |
| QEvent * | event ) |
Handles button presses from a tablet or mouse.
| event | the event that caused this call. Must be of type QTabletEvent or QMouseEvent. |
Definition at line 350 of file kis_shortcut_matcher.cpp.
References button(), DEBUG_ACTION, DEBUG_BUTTON_ACTION, forceDeactivateAllActions(), hasRunningShortcut(), m_d, prepareReadyShortcuts(), tryActivateReadyShortcut(), tryCancelAllCurrentTouchActionsImpl(), and tryRunReadyShortcut().
| bool KisShortcutMatcher::buttonReleased | ( | Qt::MouseButton | button, |
| QEvent * | event ) |
Handles the mouse button release event
| event | the event that caused this call. Must be of type QTabletEvent or QMouseEvent. |
Definition at line 380 of file kis_shortcut_matcher.cpp.
References button(), DEBUG_BUTTON_ACTION, forceDeactivateAllActions(), hasRunningShortcut(), KIS_SAFE_ASSERT_RECOVER_NOOP, m_d, prepareReadyShortcuts(), reset(), tryActivateReadyShortcut(), and tryEndRunningShortcut().
| void KisShortcutMatcher::clearShortcuts | ( | ) |
Remove all shortcuts that have been registered.
Definition at line 1101 of file kis_shortcut_matcher.cpp.
| QVector< Qt::Key > KisShortcutMatcher::debugPressedKeys | ( | ) | const |
Return the internal state of the tracked modifiers.
Definition at line 1015 of file kis_shortcut_matcher.cpp.
| void KisShortcutMatcher::enterEvent | ( | ) |
Handle cursor's Enter event. We never eat it because it might be used by someone else
Definition at line 440 of file kis_shortcut_matcher.cpp.
References forceDeactivateAllActions(), hasRunningShortcut(), m_d, prepareReadyShortcuts(), and tryActivateReadyShortcut().
|
private |
Definition at line 1359 of file kis_shortcut_matcher.cpp.
References DEBUG_SHORTCUT, and m_d.
|
private |
Definition at line 1334 of file kis_shortcut_matcher.cpp.
References KisAbstractShortcut::action, KisAbstractInputAction::deactivate(), DEBUG_ACTION, KisAbstractInputAction::end(), KisStrokeShortcut::fakeEndEvent(), forceDeactivateAllActions(), KIS_SAFE_ASSERT_RECOVER, KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, runningShortcut, and KisAbstractShortcut::shortcutIndex.
Resets the internal state of the matcher, tries to resync it to the state passed via argument and activates the prepared action if possible.
This synchronization happens when the user hovers Krita windows, without having keyboard focus set to it (therefore matcher cannot get key press and release events), and is also used for various other fixes.
Definition at line 975 of file kis_shortcut_matcher.cpp.
References DEBUG_ACTION, forceDeactivateAllActions(), hasRunningShortcut(), keyPressed(), keyReleased(), keys, m_d, prepareReadyShortcuts(), and tryActivateReadyShortcut().
| bool KisShortcutMatcher::hasPolledKeys | ( | ) |
Check if polled keys are present, which signals that we need to call KisInputManager::Private::fixShortcutMatcherModifiersState.
Definition at line 1022 of file kis_shortcut_matcher.cpp.
References m_d.
| bool KisShortcutMatcher::hasRunningShortcut | ( | ) | const |
| bool KisShortcutMatcher::hasTouchHoldShortcut | ( | ) | const |
Definition at line 232 of file kis_shortcut_matcher.cpp.
References m_d.
| bool KisShortcutMatcher::hasTouchpadScrollShortcuts | ( | ) | const |
Definition at line 874 of file kis_shortcut_matcher.cpp.
References m_d.
| bool KisShortcutMatcher::ignoreMultiFingerCancelWorkaroundEnalbed | ( | ) | const |
Definition at line 1612 of file kis_shortcut_matcher.cpp.
References m_d.
|
inline |
Definition at line 213 of file kis_shortcut_matcher.cpp.
| bool KisShortcutMatcher::keyPressed | ( | Qt::Key | key | ) |
Handles a key press event. No autorepeat events should be passed to this method.
Definition at line 279 of file kis_shortcut_matcher.cpp.
References DEBUG_ACTION, DEBUG_KEY, forceDeactivateAllActions(), hasRunningShortcut(), m_d, prepareReadyShortcuts(), tryActivateReadyShortcut(), and tryRunSingleActionShortcutImpl().
| bool KisShortcutMatcher::keyReleased | ( | Qt::Key | key | ) |
Handles a key release event. No autorepeat events should be passed to this method.
Definition at line 329 of file kis_shortcut_matcher.cpp.
References DEBUG_ACTION, DEBUG_KEY, forceDeactivateAllActions(), hasRunningShortcut(), m_d, prepareReadyShortcuts(), and tryActivateReadyShortcut().
| void KisShortcutMatcher::leaveEvent | ( | ) |
Handle cursor's Leave event. We never eat it because it might be used by someone else
Definition at line 454 of file kis_shortcut_matcher.cpp.
References forceDeactivateAllActions(), hasRunningShortcut(), m_d, prepareReadyShortcuts(), and tryActivateReadyShortcut().
| void KisShortcutMatcher::lostFocusEvent | ( | const QPointF & | localPos | ) |
Krita lost focus, it means that all the running actions should be ended forcefully.
TODO: it might be that we should also deactivate touch and native gestures on focus-out events. After testing on Windows it seems like it works fine without any explicit stopping the touch strokes. They just continue in the unfocused application (given that Krita does not get overlapped by another window)
Definition at line 1027 of file kis_shortcut_matcher.cpp.
References DEBUG_ACTION, forceDeactivateAllActions(), forceEndRunningShortcut(), and m_d.
|
private |
Definition at line 1411 of file kis_shortcut_matcher.cpp.
References KisTouchShortcut::isAvailable(), m_d, matchTouchShortcutBasedOnState(), and KisTouchShortcut::priority().
|
private |
Definition at line 1425 of file kis_shortcut_matcher.cpp.
References Drag, Hold, KisTouchShortcut::matchDragType(), KisTouchShortcut::matchHoldType(), KisTouchShortcut::matchTapType(), and Tap.
| bool KisShortcutMatcher::nativeGestureBeginEvent | ( | QNativeGestureEvent * | event | ) |
Definition at line 826 of file kis_shortcut_matcher.cpp.
References DEBUG_EVENT_ACTION.
| bool KisShortcutMatcher::nativeGestureEndEvent | ( | QNativeGestureEvent * | event | ) |
Definition at line 854 of file kis_shortcut_matcher.cpp.
References DEBUG_EVENT_ACTION, forceDeactivateAllActions(), hasRunningShortcut(), m_d, prepareReadyShortcuts(), tryActivateReadyShortcut(), and tryEndNativeGestureShortcut().
| bool KisShortcutMatcher::nativeGestureEvent | ( | QNativeGestureEvent * | event | ) |
Definition at line 837 of file kis_shortcut_matcher.cpp.
References DEBUG_EVENT_ACTION, hasRunningShortcut(), m_d, and tryRunNativeGestureShortcut().
| bool KisShortcutMatcher::pointerMoved | ( | QEvent * | event | ) |
Handles tablet and mouse move events.
| event | the event that caused this call |
Definition at line 421 of file kis_shortcut_matcher.cpp.
References KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, and m_d.
|
private |
Definition at line 1171 of file kis_shortcut_matcher.cpp.
References m_d, and KisStrokeShortcut::matchReady().
|
inline |
Definition at line 92 of file kis_shortcut_matcher.cpp.
References AllActionGroup.
| void KisShortcutMatcher::reinitialize | ( | ) |
Resets the internal state of the matcher and activates the prepared action if possible.
This should be done when the window has lost the focus for some time, so that several events could be lost
Definition at line 945 of file kis_shortcut_matcher.cpp.
References forceDeactivateAllActions(), hasRunningShortcut(), prepareReadyShortcuts(), reset(), and tryActivateReadyShortcut().
| void KisShortcutMatcher::reinitializeButtons | ( | ) |
Resets the internal state of the buttons inside matcher and activates the prepared action if possible.
This should be done when the window has lost the focus for some time, so that several events could be lost
Definition at line 960 of file kis_shortcut_matcher.cpp.
References DEBUG_ACTION, forceDeactivateAllActions(), hasRunningShortcut(), m_d, prepareReadyShortcuts(), and tryActivateReadyShortcut().
|
private |
Definition at line 1062 of file kis_shortcut_matcher.cpp.
References DEBUG_ACTION, and m_d.
|
private |
Definition at line 1070 of file kis_shortcut_matcher.cpp.
References DEBUG_ACTION, and m_d.
| bool KisShortcutMatcher::sanityCheckModifiersCorrectness | ( | Qt::KeyboardModifiers | modifiers | ) | const |
Sanity check correctness of the internal state of the matcher by comparing it to the standard modifiers that we get with every input event. Right now this sanity check is used on Windows only.
Definition at line 1002 of file kis_shortcut_matcher.cpp.
References m_d.
| void KisShortcutMatcher::setIgnoreMultiFingerCancelWorkaroundEnalbed | ( | bool | value | ) |
Enabled a workaround that allows processing 3+ finger tap shortcuts, even when the system sends QEvent::TouchCancel for them. Need on some Android devices.
Definition at line 1603 of file kis_shortcut_matcher.cpp.
| void KisShortcutMatcher::setInputActionGroupsMaskCallback | ( | std::function< KisInputActionGroupsMask()> | func | ) |
Definition at line 1129 of file kis_shortcut_matcher.cpp.
References m_d.
|
private |
Definition at line 1368 of file kis_shortcut_matcher.cpp.
References KisTouchShortcut::countTouchPoints(), m_d, and KisTouchShortcut::pressedOnlyTouchStates().
| void KisShortcutMatcher::setTouchHoldDelay | ( | int | value | ) |
|
private |
Definition at line 558 of file kis_shortcut_matcher.cpp.
References DEBUG_TOUCH_ACTION, Hold, KisTouchHoldEventsPostponer::HoldCompleted, KIS_SAFE_ASSERT_RECOVER, KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, KisTouchShortcut::pressedOnlyTouchStates(), and tryRunTouchShortcut().
| bool KisShortcutMatcher::supportsHiResInputEvents | ( | ) |
Returns true if the currently running shortcut supports processing hi resolution flow of events from the tablet device. In most of the cases (except of the painting itself) too many events make the execution of the action too slow, so the action can decide whether it needs it.
Definition at line 267 of file kis_shortcut_matcher.cpp.
References m_d.
| void KisShortcutMatcher::suppressAllActions | ( | bool | value | ) |
Disables the start of any actions.
WARNING: the actions that has been started before this call will not be ended. They will be ended in their usual way, when the mouse button will be released.
| void KisShortcutMatcher::suppressAllKeyboardActions | ( | bool | value | ) |
Disable keyboard actions.
This will disable all actions that consist of only keyboard keys being pressed without mouse or stylus buttons being pressed.
This is turned on when the tool is in text mode.
Disable one-time actions whose shortcuts conflict with the listed shortcuts
Definition at line 1083 of file kis_shortcut_matcher.cpp.
References KisSingleActionShortcut::conflictsWith(), and m_d.
| void KisShortcutMatcher::toolHasBeenActivated | ( | ) |
Is called when a new tool has been activated. The method activates any tool's action if possible with the currently active modifiers.
Definition at line 1048 of file kis_shortcut_matcher.cpp.
References DEBUG_ACTION, forceDeactivateAllActions(), hasRunningShortcut(), prepareReadyShortcuts(), and tryActivateReadyShortcut().
| bool KisShortcutMatcher::touchBeginEvent | ( | QTouchEvent * | event | ) |
Definition at line 468 of file kis_shortcut_matcher.cpp.
References KisTouchShortcut::countTouchPoints(), DEBUG_ACTION, DEBUG_TOUCH_ACTION, hasRunningShortcut(), hasTouchHoldShortcut(), KisTouchHoldEventsPostponer::HoldCancelled, m_d, KisTouchShortcut::pressedOnlyTouchStates(), KisTouchHoldEventsPostponer::sigHoldCompleted(), and TOUCH_SLOP.
| void KisShortcutMatcher::touchCancelEvent | ( | QTouchEvent * | event | ) |
We received TouchCancel event, it means this event sequence has ended right here i.e without a valid TouchEnd, so we should immediately stop all running actions.
Definition at line 772 of file kis_shortcut_matcher.cpp.
References DEBUG_ACTION, DEBUG_TOUCH_ACTION, forceDeactivateAllActions(), hasRunningShortcut(), KIS_SAFE_ASSERT_RECOVER, KIS_SAFE_ASSERT_RECOVER_NOOP, m_d, prepareReadyShortcuts(), touchEndEvent(), tryActivateReadyShortcut(), and tryCancelAllCurrentTouchActionsImpl().
| bool KisShortcutMatcher::touchEndEvent | ( | QTouchEvent * | event | ) |
Definition at line 686 of file kis_shortcut_matcher.cpp.
References KisTouchShortcut::allTouchStates(), DEBUG_ACTION, DEBUG_TOUCH_ACTION, forceDeactivateAllActions(), hasRunningShortcut(), KIS_SAFE_ASSERT_RECOVER, KIS_SAFE_ASSERT_RECOVER_NOOP, m_d, prepareReadyShortcuts(), touchUpdateEventImpl(), tryActivateReadyShortcut(), tryEndTouchShortcut(), tryFireTapTouchShortcut(), void(), and KisTouchHoldEventsPostponer::WaitingForHold.
| int KisShortcutMatcher::touchHoldDelay | ( | ) | const |
Definition at line 1593 of file kis_shortcut_matcher.cpp.
References m_d.
| bool KisShortcutMatcher::touchpadScrollBeginEvent | ( | QWheelEvent * | event | ) |
Definition at line 879 of file kis_shortcut_matcher.cpp.
References DEBUG_EVENT_ACTION, hasRunningShortcut(), m_d, and tryRunTouchpadScrollShortcut().
| bool KisShortcutMatcher::touchpadScrollEndEvent | ( | QWheelEvent * | event | ) |
Definition at line 913 of file kis_shortcut_matcher.cpp.
References DEBUG_EVENT_ACTION, forceDeactivateAllActions(), hasRunningShortcut(), m_d, prepareReadyShortcuts(), tryActivateReadyShortcut(), and tryEndTouchpadScrollShortcut().
| bool KisShortcutMatcher::touchpadScrollEvent | ( | QWheelEvent * | event | ) |
Definition at line 898 of file kis_shortcut_matcher.cpp.
References DEBUG_EVENT_ACTION, and m_d.
| bool KisShortcutMatcher::touchUpdateEvent | ( | QTouchEvent * | event | ) |
Definition at line 524 of file kis_shortcut_matcher.cpp.
References KisTouchShortcut::countTouchPoints(), KisTouchHoldEventsPostponer::HoldCancelled, m_d, KisTouchShortcut::pressedOnlyTouchStates(), touchUpdateEventImpl(), and void().
|
private |
Definition at line 589 of file kis_shortcut_matcher.cpp.
References _41020(), KisTouchShortcut::allTouchStates(), KisTouchShortcut::countTouchPoints(), DEBUG_TOUCH_ACTION, Drag, hasRunningShortcut(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, m_d, matchTouchShortcut(), KisTouchShortcut::pressedOnlyTouchStates(), setMaxTouchPointEvent(), Tap, TOUCH_SLOP, KisTouchShortcut::touchDragDistance(), tryEndTouchShortcut(), tryFireTapTouchShortcut(), and tryRunTouchShortcut().
|
private |
It is important that we first activate the action, and only after that assign it to m_d->readyShortcut. It makes is possible to activate another tool in KisToolInvocationAction and survive the call to forceDeactivateAllActions() from lostFocusEvent(), which would enter infinite loop otherwise.
Definition at line 1248 of file kis_shortcut_matcher.cpp.
References KisAbstractShortcut::action, KisAbstractInputAction::activate(), DEBUG_SHORTCUT, m_d, KisStrokeShortcut::priority(), KisAbstractShortcut::shortcutIndex, and KisAbstractInputAction::trySwitchShortcut().
|
private |
Definition at line 742 of file kis_shortcut_matcher.cpp.
References KisAbstractShortcut::action, KisAbstractInputAction::deactivate(), DEBUG_ACTION, KisAbstractInputAction::end(), KIS_SAFE_ASSERT_RECOVER_NOOP, KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, KisAbstractShortcut::shortcutIndex, touchShortcut, and KisTouchHoldEventsPostponer::WaitingForHold.
|
private |
Definition at line 1546 of file kis_shortcut_matcher.cpp.
References KisAbstractShortcut::action, KisAbstractInputAction::deactivate(), DEBUG_SHORTCUT, KisAbstractInputAction::end(), forceDeactivateAllActions(), hasRunningShortcut(), prepareReadyShortcuts(), runningShortcut, KisAbstractShortcut::shortcutIndex, and tryActivateReadyShortcut().
|
private |
Definition at line 1578 of file kis_shortcut_matcher.cpp.
References m_d, and tryEndGestureBasedShortcutImpl().
|
private |
Definition at line 1292 of file kis_shortcut_matcher.cpp.
References KisAbstractShortcut::action, button(), KisAbstractInputAction::deactivate(), DEBUG_EVENT_ACTION, KisAbstractInputAction::end(), forceDeactivateAllActions(), KisAbstractShortcut::isAvailable(), KIS_SAFE_ASSERT_RECOVER, KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, m_d, KisStrokeShortcut::matchReady(), runningShortcut, and KisAbstractShortcut::shortcutIndex.
|
private |
Definition at line 1588 of file kis_shortcut_matcher.cpp.
References m_d, and tryEndGestureBasedShortcutImpl().
|
private |
Definition at line 1485 of file kis_shortcut_matcher.cpp.
References KisAbstractShortcut::action, KisAbstractInputAction::deactivate(), DEBUG_SHORTCUT, KisAbstractInputAction::end(), m_d, and touchShortcut.
|
private |
Touch actions don't usually send focus events, since they have no hover functionality, so they should be triggered unrelated to the current focus state.
Definition at line 1388 of file kis_shortcut_matcher.cpp.
References KisAbstractShortcut::action, KisAbstractInputAction::activate(), KisAbstractInputAction::begin(), KisAbstractInputAction::deactivate(), DEBUG_SHORTCUT, KisAbstractInputAction::end(), m_d, matchTouchShortcut(), KisAbstractShortcut::shortcutIndex, and Tap.
|
private |
Definition at line 1504 of file kis_shortcut_matcher.cpp.
References DEBUG_SHORTCUT, forceDeactivateAllActions(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, and m_d.
|
private |
Definition at line 1573 of file kis_shortcut_matcher.cpp.
References m_d, and tryRunGestureBasedShortcutImpl().
|
private |
Definition at line 1197 of file kis_shortcut_matcher.cpp.
References KisAbstractShortcut::action, KisAbstractInputAction::activate(), KisAbstractInputAction::begin(), button(), DEBUG_EVENT_ACTION, DEBUG_SHORTCUT, KisAbstractInputAction::end(), forceDeactivateAllActions(), KisAbstractShortcut::isAvailable(), m_d, KisStrokeShortcut::matchBegin(), KisStrokeShortcut::priority(), KisAbstractShortcut::shortcutIndex, and KisAbstractInputAction::trySwitchShortcut().
|
private |
Definition at line 1141 of file kis_shortcut_matcher.cpp.
References KisAbstractShortcut::action, KisAbstractInputAction::begin(), DEBUG_EVENT_ACTION, KisAbstractInputAction::end(), KisAbstractShortcut::isAvailable(), m_d, KisSingleActionShortcut::match(), KisSingleActionShortcut::priority(), and KisAbstractShortcut::shortcutIndex.
|
private |
Definition at line 1583 of file kis_shortcut_matcher.cpp.
References m_d, and tryRunGestureBasedShortcutImpl().
|
private |
Touch actions don't usually send focus events, since they have no hover functionality, so they should be triggered unrelated to the current focus state.
Definition at line 1446 of file kis_shortcut_matcher.cpp.
References KisAbstractShortcut::action, KisAbstractInputAction::activate(), KisAbstractInputAction::begin(), DEBUG_SHORTCUT, KisAbstractInputAction::end(), forceDeactivateAllActions(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, m_d, matchTouchShortcut(), and KisAbstractShortcut::shortcutIndex.
|
private |
Definition at line 1134 of file kis_shortcut_matcher.cpp.
References m_d, and tryRunSingleActionShortcutImpl().
| bool KisShortcutMatcher::wheelEvent | ( | KisSingleActionShortcut::WheelAction | wheelAction, |
| QWheelEvent * | event ) |
Handles the mouse wheel event
Definition at line 408 of file kis_shortcut_matcher.cpp.
References DEBUG_ACTION, hasRunningShortcut(), and tryRunWheelShortcut().
|
friend |
Definition at line 315 of file kis_shortcut_matcher.h.
| std::function<KisInputActionGroupsMask()> KisShortcutMatcher::actionGroupMask |
Definition at line 155 of file kis_shortcut_matcher.cpp.
| QScopedPointer<QEvent> KisShortcutMatcher::bestCandidateForTapTouchEvent |
Definition at line 137 of file kis_shortcut_matcher.cpp.
| int KisShortcutMatcher::brokenByRecursion = 0 |
Definition at line 161 of file kis_shortcut_matcher.cpp.
| QSet<Qt::MouseButton> KisShortcutMatcher::buttons |
Definition at line 119 of file kis_shortcut_matcher.cpp.
| QList<KisStrokeShortcut*> KisShortcutMatcher::candidateShortcuts |
Definition at line 125 of file kis_shortcut_matcher.cpp.
| bool KisShortcutMatcher::cursorEntered |
Definition at line 158 of file kis_shortcut_matcher.cpp.
| std::optional<IgnoreMultiFingerCancelWorkaround> KisShortcutMatcher::ignoreMultiFingerCancelWorkaround |
Definition at line 153 of file kis_shortcut_matcher.cpp.
| bool KisShortcutMatcher::isTouchDragDetected {false} |
Definition at line 135 of file kis_shortcut_matcher.cpp.
| bool KisShortcutMatcher::isTouchHeld {false} |
Definition at line 136 of file kis_shortcut_matcher.cpp.
| QSet<Qt::Key> KisShortcutMatcher::keys |
Definition at line 118 of file kis_shortcut_matcher.cpp.
| QScopedPointer<QTouchEvent> KisShortcutMatcher::lastProcessedTouchEvent |
Definition at line 138 of file kis_shortcut_matcher.cpp.
|
private |
Definition at line 361 of file kis_shortcut_matcher.h.
| int KisShortcutMatcher::matchingIteration {0} |
Definition at line 134 of file kis_shortcut_matcher.cpp.
| int KisShortcutMatcher::maxTouchPoints {0} |
Definition at line 133 of file kis_shortcut_matcher.cpp.
| KisNativeGestureShortcut* KisShortcutMatcher::nativeGestureShortcut |
Definition at line 128 of file kis_shortcut_matcher.cpp.
| QList<KisNativeGestureShortcut*> KisShortcutMatcher::nativeGestureShortcuts |
Definition at line 115 of file kis_shortcut_matcher.cpp.
| QSet<Qt::Key> KisShortcutMatcher::polledKeys |
Definition at line 121 of file kis_shortcut_matcher.cpp.
| KisStrokeShortcut* KisShortcutMatcher::readyShortcut |
Definition at line 124 of file kis_shortcut_matcher.cpp.
| int KisShortcutMatcher::recursiveCounter = 0 |
Definition at line 160 of file kis_shortcut_matcher.cpp.
| KisStrokeShortcut* KisShortcutMatcher::runningShortcut |
Definition at line 123 of file kis_shortcut_matcher.cpp.
| QList<KisSingleActionShortcut*> KisShortcutMatcher::singleActionShortcuts |
Definition at line 111 of file kis_shortcut_matcher.cpp.
| QList<KisStrokeShortcut*> KisShortcutMatcher::strokeShortcuts |
Definition at line 113 of file kis_shortcut_matcher.cpp.
| void KisShortcutMatcher::suppressAllActions |
Definition at line 156 of file kis_shortcut_matcher.cpp.
| void KisShortcutMatcher::suppressAllKeyboardActions |
Definition at line 157 of file kis_shortcut_matcher.cpp.
| QSet<KisSingleActionShortcut*> KisShortcutMatcher::suppressedSingleActionShortcuts |
Definition at line 112 of file kis_shortcut_matcher.cpp.
|
staticconstexpr |
Definition at line 79 of file kis_shortcut_matcher.h.
|
staticconstexpr |
Definition at line 78 of file kis_shortcut_matcher.h.
| bool KisShortcutMatcher::touchActionTracked {false} |
Definition at line 139 of file kis_shortcut_matcher.cpp.
| int KisShortcutMatcher::touchHoldDelayMs {400} |
Definition at line 140 of file kis_shortcut_matcher.cpp.
| std::optional<KisTouchHoldEventsPostponer> KisShortcutMatcher::touchHoldEventPostponer |
Definition at line 130 of file kis_shortcut_matcher.cpp.
| KisTouchpadScrollShortcut* KisShortcutMatcher::touchpadScrollShortcut |
Definition at line 129 of file kis_shortcut_matcher.cpp.
| QList<KisTouchpadScrollShortcut*> KisShortcutMatcher::touchpadScrollShortcuts |
Definition at line 116 of file kis_shortcut_matcher.cpp.
| KisTouchShortcut* KisShortcutMatcher::touchShortcut |
Definition at line 127 of file kis_shortcut_matcher.cpp.
| QList<KisTouchShortcut*> KisShortcutMatcher::touchShortcuts |
Definition at line 114 of file kis_shortcut_matcher.cpp.