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
25
27{
28public:
30 void addStrokeShortcut(KisAbstractInputAction* action, int index, const QList< Qt::Key >& modifiers, Qt::MouseButtons buttons);
31 void addKeyShortcut(KisAbstractInputAction* action, int index,const QList<Qt::Key> &keys);
32 void addTouchShortcut( KisAbstractInputAction* action, int index, KisShortcutConfiguration::TouchGestureAction gesture, bool isTouchPainting = false);
35 bool processUnhandledEvent(QEvent *event);
36 void setupActions();
37 bool handleCompressedTabletEvent(QEvent *event);
39 void fixShortcutMatcherModifiersState(QVector<Qt::Key> newKeys, Qt::KeyboardModifiers modifiers);
40
42
45
47
49
51
52 QObject *eventsReceiver = 0;
54 QScopedPointer<QEvent> compressedMoveEvent;
57
58 typedef QPair<int, QPointer<QObject> > PriorityPair;
62
63 bool popupWasActive = false;
64
67
69
71 void resetCompressor();
72
73 class ProximityNotifier : public QObject
74 {
75 public:
76 ProximityNotifier(Private *_d, QObject *p);
77 bool eventFilter(QObject* object, QEvent* event ) override;
78 private:
80 };
81
82 class CanvasSwitcher : public QObject
83 {
84 public:
85 CanvasSwitcher(Private *_d, QObject *p);
88 bool eventFilter(QObject* object, QEvent* event ) override;
89
90 private:
91 void setupFocusThreshold(QObject *object);
92
93 private:
95 QMap<QObject*, QPointer<KisCanvas2>> canvasResolver;
99 };
101
103
105
107 protected:
108 virtual qint64 currentTimestamp() const override;
109 virtual void print(const QString &message) override;
110 };
111
113#ifdef Q_OS_WIN
114 bool ignoreHighFunctionKeys = false;
115#endif
116};
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)
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)