Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_input_manager_p.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 Michael Abrahams <miabraha@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7
8#include <QList>
9#include <QPointer>
10#include <QEvent>
11#include <QScopedPointer>
12
13#include "KisInputEventsEater.h"
14#include "kis_input_manager.h"
17#include "kis_canvas2.h"
18#include "kis_tool_proxy.h"
22#include "kis_latency_tracker.h"
23
24#include <KoToolManager.h>
25
27
29{
30public:
31 Private(KisInputManager *qq, KoToolManager *toolManagerArg);
32 void addStrokeShortcut(KisAbstractInputAction* action, int index, const QList< Qt::Key >& modifiers, Qt::MouseButtons buttons);
33 void addKeyShortcut(KisAbstractInputAction* action, int index,const QList<Qt::Key> &keys);
34 void addTouchShortcut( KisAbstractInputAction* action, int index, KisShortcutConfiguration::TouchGestureAction gesture, bool isTouchPainting = false);
37 bool processUnhandledEvent(QEvent *event);
38 void setupActions();
39 bool handleCompressedTabletEvent(QEvent *event);
41 void fixShortcutMatcherModifiersState(QVector<Qt::Key> newKeys, Qt::KeyboardModifiers modifiers);
42
44
48
50
52
54
55 QObject *eventsReceiver = 0;
57 QScopedPointer<QEvent> compressedMoveEvent;
60
61 typedef QPair<int, QPointer<QObject> > PriorityPair;
65
66 bool popupWasActive = false;
67
70
72
74 void resetCompressor();
75
76 class ProximityNotifier : public QObject
77 {
78 public:
79 ProximityNotifier(Private *_d, QObject *p);
80 bool eventFilter(QObject* object, QEvent* event ) override;
81 private:
83 };
84
85 class CanvasSwitcher : public QObject
86 {
87 public:
88 CanvasSwitcher(Private *_d, QObject *p);
91 bool eventFilter(QObject* object, QEvent* event ) override;
92
93 private:
94 void setupFocusThreshold(QObject *object);
95
96 private:
98 QMap<QObject*, QPointer<KisCanvas2>> canvasResolver;
102 };
104
106
108
110 protected:
111 virtual qint64 currentTimestamp() const override;
112 virtual void print(const QString &message) override;
113 };
114
116#ifdef Q_OS_WIN
117 bool ignoreHighFunctionKeys = false;
118#endif
119};
float value(const T *src, size_t ch)
const Params2D p
Abstract base class for input actions.
QMap< QObject *, QPointer< KisCanvas2 > > canvasResolver
KisSignalAutoConnectionsStore thresholdConnections
bool eventFilter(QObject *object, QEvent *event) override
bool eventFilter(QObject *object, QEvent *event) override
virtual void print(const QString &message) override
void addTouchShortcut(KisAbstractInputAction *action, int index, KisShortcutConfiguration::TouchGestureAction gesture, bool isTouchPainting=false)
void setMaskSyntheticEvents(bool value)
KisInputEventsEater eventEater
bool handleCompressedTabletEvent(QEvent *event)
bool addNativeGestureShortcut(KisAbstractInputAction *action, int index, KisShortcutConfiguration::NativeGestureAction gesture)
void addKeyShortcut(KisAbstractInputAction *action, int index, const QList< Qt::Key > &keys)
void addWheelShortcut(KisAbstractInputAction *action, int index, const QList< Qt::Key > &modifiers, KisShortcutConfiguration::MouseWheelMovement wheelAction)
QPair< int, QPointer< QObject > > PriorityPair
KisToolInvocationAction * defaultInputAction
QPointer< KisToolProxy > toolProxy
KisSignalCompressor moveEventCompressor
void addStrokeShortcut(KisAbstractInputAction *action, int index, const QList< Qt::Key > &modifiers, Qt::MouseButtons buttons)
QPointer< KoToolManager > toolManager
QList< PriorityPair > PriorityList
QScopedPointer< QEvent > compressedMoveEvent
QPointer< KisCanvas2 > canvas
bool processUnhandledEvent(QEvent *event)
KisSharedPtr< TabletLatencyTracker > tabletLatencyTracker
KisPopupWidgetInterface * popupWidget
Central object to manage canvas input.
The PopupWidgetInterface abstract class defines the basic interface that will be used by all popup wi...
Tool Invocation action of KisAbstractInputAction.
QString buttons(const T &ev)