29 BlockedByTabletProximity = 0x01,
30 BlockedByTabletHover = 0x02,
31 BlockedByTabletPress = 0x04,
32 BlockedByTouchPress = 0x08,
33 BlockedByNextPressSuppression = 0x10,
34 BlockedByButtonsWorkaround = 0x20,
35 BlockedBySynthetic = 0x40
41 bool eventFilter(QObject *
target, QEvent *event);
43 void notifyTabletEnterProximity();
44 void notifyTabletLeaveProximity();
47 void eatOneMousePress();
50 static void debugEvent(QEvent *event, EventBlockingReasons reasons = NotBlocked)
55 QString reasonsString;
57 if (reasons.testFlag(BlockedByTabletProximity)) {
58 reasonsString +=
"Prx";
61 if (reasons.testFlag(BlockedByTabletHover)) {
62 reasonsString +=
"Hov";
65 if (reasons.testFlag(BlockedByTabletPress)) {
66 reasonsString +=
"Prs";
69 if (reasons.testFlag(BlockedByNextPressSuppression)) {
70 reasonsString +=
"Nxt";
73 if (reasons.testFlag(BlockedByTouchPress)) {
74 reasonsString +=
"Tch";
77 if (reasons.testFlag(BlockedBySynthetic)) {
78 reasonsString +=
"Syn";
81 QString msg1 = QString(
"[%1] ").arg(reasonsString, 15);
82 Event *specificEvent =
static_cast<Event *
>(event);
88 bool eatOneMousePressEvent{
false};
89 bool activateSecondaryButtonsWorkaround{
false};
91 bool tabletIsInProximity{
false};
92 bool tabletIsHovering{
false};
93 bool tabletIsPressed{
false};
94 bool touchIsActive{
false};
96#ifdef KRITA_ENABLE_MISSING_PROXIMITY_ENTER_WORKAROUND
117 struct MissingTabletProximityEnterWorkaround {
118 int numSequentialMouseEvents = 0;
120 void notifyTabletEventArrived() {
121 numSequentialMouseEvents = 0;
124 void notifyMouseEventArrived() {
125 numSequentialMouseEvents++;
128 bool shouldForgetAboutTabletInProximity()
const {
129 return numSequentialMouseEvents > 10;
132 std::optional<MissingTabletProximityEnterWorkaround> missingTabletProximityEventsWorkaround;
136 void debugEaterStateTransition(
const QLatin1String &stateName,
138 QEvent::Type eventType,
139 const QLatin1String &comment = QLatin1String());
Q_DECLARE_FLAGS(KisUpdaterContextSnapshotEx, KisUpdaterContextSnapshotExTag)