Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_shortcut_matcher.cpp File Reference
#include "kis_shortcut_matcher.h"
#include <QEvent>
#include <QMouseEvent>
#include <QTabletEvent>
#include "kis_assert.h"
#include "kis_abstract_input_action.h"
#include "kis_stroke_shortcut.h"
#include "kis_touch_shortcut.h"
#include "kis_native_gesture_shortcut.h"
#include "KisTouchpadScrollShortcut.h"
#include "kis_config.h"
#include "kis_extended_modifiers_mapper.h"
#include "KisTouchHoldEventsPostponer.h"
#include <KoPointerEvent.h>

Go to the source code of this file.

Classes

struct  KisShortcutMatcher::IgnoreMultiFingerCancelWorkaround
 
class  KisShortcutMatcher
 
struct  KisShortcutMatcher::RecursionGuard
 
struct  KisShortcutMatcher::RecursionNotifier
 

Macros

#define DEBUG_ACTION(text)   dbgInputMatcher << __FUNCTION__ << "-" << text;
 
#define DEBUG_BUTTON_ACTION(text, button)   dbgInputMatcher << __FUNCTION__ << "-" << text << "button:" << button << "btns:" << m_d->buttons << "keys:" << m_d->keys;
 
#define DEBUG_EVENT_ACTION(text, event)   if (event) {dbgInputMatcher << __FUNCTION__ << "-" << text << "type:" << event->type();}
 
#define DEBUG_KEY(text)   dbgInputMatcher << __FUNCTION__ << "-" << text << "keys:" << m_d->keys;
 
#define DEBUG_SHORTCUT(text, shortcut)   dbgInputMatcher << __FUNCTION__ << "-" << text << "act:" << debugShortcutName(shortcut);
 
#define DEBUG_TOUCH_ACTION(text, event)
 

Functions

QString debugShortcutName (const KisAbstractShortcut *shortcut)
 
Qt::MouseButtons listToFlags (const QList< Qt::MouseButton > &list)
 

Macro Definition Documentation

◆ DEBUG_ACTION

#define DEBUG_ACTION ( text)    dbgInputMatcher << __FUNCTION__ << "-" << text;

Definition at line 37 of file kis_shortcut_matcher.cpp.

◆ DEBUG_BUTTON_ACTION

#define DEBUG_BUTTON_ACTION ( text,
button )   dbgInputMatcher << __FUNCTION__ << "-" << text << "button:" << button << "btns:" << m_d->buttons << "keys:" << m_d->keys;

Definition at line 40 of file kis_shortcut_matcher.cpp.

◆ DEBUG_EVENT_ACTION

#define DEBUG_EVENT_ACTION ( text,
event )   if (event) {dbgInputMatcher << __FUNCTION__ << "-" << text << "type:" << event->type();}

Definition at line 41 of file kis_shortcut_matcher.cpp.

◆ DEBUG_KEY

#define DEBUG_KEY ( text)    dbgInputMatcher << __FUNCTION__ << "-" << text << "keys:" << m_d->keys;

Definition at line 39 of file kis_shortcut_matcher.cpp.

◆ DEBUG_SHORTCUT

#define DEBUG_SHORTCUT ( text,
shortcut )   dbgInputMatcher << __FUNCTION__ << "-" << text << "act:" << debugShortcutName(shortcut);

Definition at line 38 of file kis_shortcut_matcher.cpp.

◆ DEBUG_TOUCH_ACTION

#define DEBUG_TOUCH_ACTION ( text,
event )
Value:
if (event) { \
dbgInputMatcher << __FUNCTION__ << "-" << text << "type:" << event->type() \
<< "maxTps:" << m_d->maxTouchPoints << "drag:" << m_d->isTouchDragDetected; \
}
static Qt::TouchPointStates pressedOnlyTouchStates()
static int countTouchPoints(const QTouchEvent *event, Qt::TouchPointStates allowedStates)
static Qt::TouchPointStates allTouchStates()
#define dbgInputMatcher
Definition kis_debug.h:68

Definition at line 42 of file kis_shortcut_matcher.cpp.

42#define DEBUG_TOUCH_ACTION(text, event) \
43 if (event) { \
44 dbgInputMatcher << __FUNCTION__ << "-" << text << "type:" << event->type() \
45 << "tps:" << KisTouchShortcut::countTouchPoints(event, KisTouchShortcut::allTouchStates()) \
46 << "pressedTps:" << KisTouchShortcut::countTouchPoints(event, KisTouchShortcut::pressedOnlyTouchStates()) \
47 << "maxTps:" << m_d->maxTouchPoints << "drag:" << m_d->isTouchDragDetected; \
48 }

Function Documentation

◆ debugShortcutName()

QString debugShortcutName ( const KisAbstractShortcut * shortcut)
inline

Definition at line 31 of file kis_shortcut_matcher.cpp.

32{
33 auto action = shortcut->action();
34 return QString("%1/%2").arg(action->name()).arg(action->shortcutIndexes().key(shortcut->shortcutIndex(), "<unknown>"));
35}
KisAbstractInputAction * action

References KisAbstractShortcut::action, and KisAbstractShortcut::shortcutIndex.

◆ listToFlags()

Qt::MouseButtons listToFlags ( const QList< Qt::MouseButton > & list)

Definition at line 937 of file kis_shortcut_matcher.cpp.

937 {
938 Qt::MouseButtons flags;
939 Q_FOREACH (Qt::MouseButton b, list) {
940 flags |= b;
941 }
942 return flags;
943}