|
Krita Source Code Documentation
|
#include <kis_input_manager_p.h>
Classes | |
| class | CanvasSwitcher |
| struct | EventEater |
| class | ProximityNotifier |
| class | TabletLatencyTracker |
Public Types | |
| typedef QList< PriorityPair > | PriorityList |
| typedef QPair< int, QPointer< QObject > > | PriorityPair |
Static Public Attributes | |
| static constexpr int | TOUCH_HOLD_DELAY_MS = 400 |
Definition at line 29 of file kis_input_manager_p.h.
Definition at line 67 of file kis_input_manager_p.h.
| typedef QPair<int, QPointer<QObject> > KisInputManager::Private::PriorityPair |
Definition at line 66 of file kis_input_manager_p.h.
| KisInputManager::Private::Private | ( | KisInputManager * | ) |
On Windows and Linux we have a proper fix for this bug patched into our local version of Qt. We don't have a fix for macOS
In Linux distributions Qt is not patched, so we should use workaround for them
Definition at line 200 of file kis_input_manager_p.cpp.
References AllActionGroup, canvas, matcher, moveEventCompressor, KisSignalCompressor::setDelay(), KisShortcutMatcher::setInputActionGroupsMaskCallback(), KisInputManager::slotTouchHoldTriggered(), KisConfig::tabletEventsDelay(), tabletLatencyTracker, testingAcceptCompressedTabletEvents, KisConfig::testingAcceptCompressedTabletEvents(), testingCompressBrushEvents, KisConfig::testingCompressBrushEvents(), TOUCH_HOLD_DELAY_MS, touchHoldTimer, KisConfig::trackTabletEventLatency(), and useUnbalancedKeyPressEventWorkaround.
| void KisInputManager::Private::addKeyShortcut | ( | KisAbstractInputAction * | action, |
| int | index, | ||
| const QList< Qt::Key > & | keys ) |
Definition at line 511 of file kis_input_manager_p.cpp.
References KisShortcutMatcher::addShortcut(), matcher, and KisSingleActionShortcut::setKey().
| bool KisInputManager::Private::addNativeGestureShortcut | ( | KisAbstractInputAction * | action, |
| int | index, | ||
| KisShortcutConfiguration::GestureAction | gesture ) |
Definition at line 605 of file kis_input_manager_p.cpp.
References KisShortcutMatcher::addShortcut(), and matcher.
| void KisInputManager::Private::addStrokeShortcut | ( | KisAbstractInputAction * | action, |
| int | index, | ||
| const QList< Qt::Key > & | modifiers, | ||
| Qt::MouseButtons | buttons ) |
Definition at line 482 of file kis_input_manager_p.cpp.
References KisShortcutMatcher::addShortcut(), buttons(), EXTRA_BUTTON, matcher, and KisStrokeShortcut::setButtons().
| void KisInputManager::Private::addTouchShortcut | ( | KisAbstractInputAction * | action, |
| int | index, | ||
| KisShortcutConfiguration::GestureAction | gesture ) |
Definition at line 561 of file kis_input_manager_p.cpp.
References KisShortcutMatcher::addShortcut(), dbgKrita, KisShortcutConfiguration::FiveFingerDrag, KisShortcutConfiguration::FiveFingerTap, KisShortcutConfiguration::FourFingerDrag, KisShortcutConfiguration::FourFingerTap, matcher, KisAbstractInputAction::name, KisShortcutConfiguration::OneFingerDrag, KisShortcutConfiguration::OneFingerHold, KisShortcutConfiguration::OneFingerTap, KisTouchShortcut::setDisableOnTouchPainting(), KisTouchShortcut::setMaximumTouchPoints(), KisTouchShortcut::setMinimumTouchPoints(), KisShortcutConfiguration::ThreeFingerDrag, KisShortcutConfiguration::ThreeFingerTap, KisShortcutConfiguration::TwoFingerDrag, and KisShortcutConfiguration::TwoFingerTap.
| void KisInputManager::Private::addWheelShortcut | ( | KisAbstractInputAction * | action, |
| int | index, | ||
| const QList< Qt::Key > & | modifiers, | ||
| KisShortcutConfiguration::MouseWheelMovement | wheelAction ) |
Definition at line 530 of file kis_input_manager_p.cpp.
References KisShortcutMatcher::addShortcut(), matcher, KisShortcutConfiguration::WheelDown, KisSingleActionShortcut::WheelDown, KisShortcutConfiguration::WheelLeft, KisSingleActionShortcut::WheelLeft, KisShortcutConfiguration::WheelRight, KisSingleActionShortcut::WheelRight, KisShortcutConfiguration::WheelTrackpad, KisSingleActionShortcut::WheelTrackpad, KisShortcutConfiguration::WheelUp, and KisSingleActionShortcut::WheelUp.
| void KisInputManager::Private::allowMouseEvents | ( | ) |
On Windows tablet events may arrive asynchronously to the mouse events (in WinTab mode). The problem is that Qt generates Enter/Leave and FocusIn/Out events via mouse events only. It means that TabletPress may come much before Enter and FocusIn event and start the stroke. In such a case we shouldn't unblock mouse events.
See https://bugs.kde.org/show_bug.cgi?id=417040
PS: Ideally, we should fix Qt to generate Enter/Leave and FocusIn/Out events based on tablet events as well, but it is a lot of work.
Definition at line 681 of file kis_input_manager_p.cpp.
References KisInputManager::Private::EventEater::deactivate(), eventEater, KisShortcutMatcher::hasRunningShortcut(), KisInputManager::Private::EventEater::hungry, and matcher.
| void KisInputManager::Private::blockMouseEvents | ( | ) |
Definition at line 676 of file kis_input_manager_p.cpp.
References KisInputManager::Private::EventEater::activate(), and eventEater.
| void KisInputManager::Private::bufferTouchEvent | ( | QTouchEvent * | event | ) |
Definition at line 749 of file kis_input_manager_p.cpp.
References bufferedTouchEvents.
| void KisInputManager::Private::cancelTouchHoldTimer | ( | ) |
Definition at line 732 of file kis_input_manager_p.cpp.
References touchHoldTimer.
| void KisInputManager::Private::clearBufferedTouchEvents | ( | ) |
Definition at line 779 of file kis_input_manager_p.cpp.
References bufferedTouchEvents.
|
inline |
Definition at line 104 of file kis_input_manager_p.h.
References dbgTablet, debugEnabled(), KisTabletDebugger::eventToString(), ignoringQtCursorEvents(), and KisTabletDebugger::instance().
| void KisInputManager::Private::eatOneMousePress | ( | ) |
Definition at line 707 of file kis_input_manager_p.cpp.
References KisInputManager::Private::EventEater::eatOneMousePress(), and eventEater.
| void KisInputManager::Private::fixShortcutMatcherModifiersState | ( | ) |
Definition at line 802 of file kis_input_manager_p.cpp.
References fixShortcutMatcherModifiersState(), KisExtendedModifiersMapper::queryExtendedModifiers(), KisExtendedModifiersMapper::queryStandardModifiers(), and KisExtendedModifiersMapper::workaroundShiftAltMetaHell().
| void KisInputManager::Private::fixShortcutMatcherModifiersState | ( | QVector< Qt::Key > | newKeys, |
| Qt::KeyboardModifiers | modifiers ) |
This function may be called from slotConfigChanged() from the constructor of KisInputManager. It may theoretically happen that we haven't recieved any sensible events to set up the link to the input manager.
Definition at line 816 of file kis_input_manager_p.cpp.
References KisShortcutMatcher::debugPressedKeys(), KisShortcutMatcher::handlePolledKeys(), matcher, processUnhandledEvent(), q, and KisAbstractInputAction::setInputManager().
| void KisInputManager::Private::flushBufferedTouchEvents | ( | ) |
Definition at line 760 of file kis_input_manager_p.cpp.
References bufferedTouchEvents, KisInputManager::handleTouchBegin(), KisInputManager::handleTouchUpdate(), and q.
| bool KisInputManager::Private::handleCompressedTabletEvent | ( | QEvent * | event | ) |
Definition at line 787 of file kis_input_manager_p.cpp.
References matcher, KisShortcutMatcher::pointerMoved(), toolProxy, touchHasBlockedPressEvents, and KisShortcutMatcher::touchUpdateEvent().
| bool KisInputManager::Private::ignoringQtCursorEvents | ( | ) |
Definition at line 190 of file kis_input_manager_p.cpp.
References eventEater, and KisInputManager::Private::EventEater::hungry.
| bool KisInputManager::Private::isPendingTouchHold | ( | ) | const |
Definition at line 737 of file kis_input_manager_p.cpp.
References touchHoldTimer.
| bool KisInputManager::Private::isWithinTouchHoldSlopRange | ( | const QPointF & | currentPos | ) | const |
Definition at line 742 of file kis_input_manager_p.cpp.
References KisInputManager::d, startingPos, and KisShortcutMatcher::TOUCH_SLOP_SQUARED.
| bool KisInputManager::Private::processUnhandledEvent | ( | QEvent * | event | ) |
Definition at line 651 of file kis_input_manager_p.cpp.
References defaultInputAction, forwardAllEventsToTool, and KisToolInvocationAction::processUnhandledEvent().
| void KisInputManager::Private::resetCompressor | ( | ) |
Definition at line 712 of file kis_input_manager_p.cpp.
References compressedMoveEvent, moveEventCompressor, and KisSignalCompressor::stop().
| void KisInputManager::Private::restartTouchHoldTimer | ( | ) |
Definition at line 727 of file kis_input_manager_p.cpp.
References touchHoldTimer.
| void KisInputManager::Private::setMaskSyntheticEvents | ( | bool | value | ) |
Definition at line 195 of file kis_input_manager_p.cpp.
References KisInputManager::Private::EventEater::eatSyntheticEvents, eventEater, and value().
| void KisInputManager::Private::setupActions | ( | ) |
Definition at line 633 of file kis_input_manager_p.cpp.
References KisInputProfileManager::actions, defaultInputAction, KisInputProfileManager::instance(), KisInputManager::profileChanged(), and q.
| void KisInputManager::Private::startBlockingTouch | ( | ) |
Definition at line 717 of file kis_input_manager_p.cpp.
References eventEater, and KisInputManager::Private::EventEater::startBlockingTouch().
| void KisInputManager::Private::stopBlockingTouch | ( | ) |
Definition at line 722 of file kis_input_manager_p.cpp.
References eventEater, and KisInputManager::Private::EventEater::stopBlockingTouch().
| int KisInputManager::Private::accumulatedScrollDelta = 0 |
Definition at line 171 of file kis_input_manager_p.h.
| QVector<QTouchEvent *> KisInputManager::Private::bufferedTouchEvents |
Definition at line 86 of file kis_input_manager_p.h.
| QPointer<KisCanvas2> KisInputManager::Private::canvas |
Definition at line 48 of file kis_input_manager_p.h.
| CanvasSwitcher KisInputManager::Private::canvasSwitcher |
Definition at line 140 of file kis_input_manager_p.h.
| QScopedPointer<QEvent> KisInputManager::Private::compressedMoveEvent |
Definition at line 62 of file kis_input_manager_p.h.
| bool KisInputManager::Private::containsPointer = false |
Definition at line 169 of file kis_input_manager_p.h.
| KisToolInvocationAction* KisInputManager::Private::defaultInputAction = 0 |
Definition at line 58 of file kis_input_manager_p.h.
| EventEater KisInputManager::Private::eventEater |
Definition at line 167 of file kis_input_manager_p.h.
| QObject* KisInputManager::Private::eventsReceiver = 0 |
Definition at line 60 of file kis_input_manager_p.h.
| bool KisInputManager::Private::forwardAllEventsToTool = false |
Definition at line 51 of file kis_input_manager_p.h.
| int KisInputManager::Private::lastPointCount = 0 |
Definition at line 74 of file kis_input_manager_p.h.
| KisShortcutMatcher KisInputManager::Private::matcher |
Definition at line 56 of file kis_input_manager_p.h.
| KisSignalCompressor KisInputManager::Private::moveEventCompressor |
Definition at line 61 of file kis_input_manager_p.h.
| QScopedPointer<QEvent> KisInputManager::Private::originatingTouchBeginEvent |
Definition at line 78 of file kis_input_manager_p.h.
| bool KisInputManager::Private::popupWasActive = false |
Definition at line 73 of file kis_input_manager_p.h.
| KisPopupWidgetInterface* KisInputManager::Private::popupWidget |
Definition at line 83 of file kis_input_manager_p.h.
| QPointF KisInputManager::Private::previousPos |
Definition at line 77 of file kis_input_manager_p.h.
| PriorityList KisInputManager::Private::priorityEventFilter |
Definition at line 68 of file kis_input_manager_p.h.
| int KisInputManager::Private::priorityEventFilterSeqNo |
Definition at line 69 of file kis_input_manager_p.h.
| KisInputManager* KisInputManager::Private::q |
Definition at line 46 of file kis_input_manager_p.h.
| bool KisInputManager::Private::shouldSynchronizeOnNextKeyPress = false |
Definition at line 81 of file kis_input_manager_p.h.
| QPointF KisInputManager::Private::startingPos |
Definition at line 76 of file kis_input_manager_p.h.
| KisSharedPtr<TabletLatencyTracker> KisInputManager::Private::tabletLatencyTracker |
Definition at line 179 of file kis_input_manager_p.h.
| bool KisInputManager::Private::testingAcceptCompressedTabletEvents = false |
Definition at line 63 of file kis_input_manager_p.h.
| bool KisInputManager::Private::testingCompressBrushEvents = false |
Definition at line 64 of file kis_input_manager_p.h.
| QPointer<KisToolProxy> KisInputManager::Private::toolProxy |
Definition at line 49 of file kis_input_manager_p.h.
|
staticconstexpr |
Definition at line 32 of file kis_input_manager_p.h.
| bool KisInputManager::Private::touchHasBlockedPressEvents = false |
Definition at line 54 of file kis_input_manager_p.h.
| QTimer* KisInputManager::Private::touchHoldTimer |
Definition at line 85 of file kis_input_manager_p.h.
| bool KisInputManager::Private::touchStrokeBlocked = false |
Definition at line 72 of file kis_input_manager_p.h.
| bool KisInputManager::Private::touchStrokeStarted = false |
Definition at line 71 of file kis_input_manager_p.h.
| bool KisInputManager::Private::useUnbalancedKeyPressEventWorkaround = false |
Definition at line 80 of file kis_input_manager_p.h.