aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/virtualkeyboard/inputcontext.cpp13
-rw-r--r--src/virtualkeyboard/virtualkeyboarddebug.h5
2 files changed, 15 insertions, 3 deletions
diff --git a/src/virtualkeyboard/inputcontext.cpp b/src/virtualkeyboard/inputcontext.cpp
index 80739819..7a856e21 100644
--- a/src/virtualkeyboard/inputcontext.cpp
+++ b/src/virtualkeyboard/inputcontext.cpp
@@ -444,7 +444,11 @@ void InputContext::sendKeyClick(int key, const QString &text, int modifiers)
if (d->focus && d->inputContext) {
QKeyEvent pressEvent(QEvent::KeyPress, key, Qt::KeyboardModifiers(modifiers), text);
QKeyEvent releaseEvent(QEvent::KeyRelease, key, Qt::KeyboardModifiers(modifiers), text);
- VIRTUALKEYBOARD_DEBUG() << "InputContext::sendKeyClick():" << key;
+ VIRTUALKEYBOARD_DEBUG().nospace() << "InputContext::sendKeyClick()"
+#ifdef SENSITIVE_DEBUG
+ << ": " << key
+#endif
+ ;
d->stateFlags |= InputContextPrivate::KeyEventState;
d->inputContext->sendKeyEvent(&pressEvent);
@@ -452,8 +456,11 @@ void InputContext::sendKeyClick(int key, const QString &text, int modifiers)
if (d->activeKeys.isEmpty())
d->stateFlags &= ~InputContextPrivate::KeyEventState;
} else {
- qWarning() << "InputContext::sendKeyClick(): no focus to send key click" << key << text
- << "- QGuiApplication::focusWindow() is:" << QGuiApplication::focusWindow();
+ VIRTUALKEYBOARD_WARN() << "InputContext::sendKeyClick(): no focus to send key click"
+#ifdef SENSITIVE_DEBUG
+ << key << text
+#endif
+ << "- QGuiApplication::focusWindow() is:" << QGuiApplication::focusWindow();
}
}
diff --git a/src/virtualkeyboard/virtualkeyboarddebug.h b/src/virtualkeyboard/virtualkeyboarddebug.h
index 17e53bdf..6dee6372 100644
--- a/src/virtualkeyboard/virtualkeyboarddebug.h
+++ b/src/virtualkeyboard/virtualkeyboarddebug.h
@@ -35,6 +35,11 @@
Q_DECLARE_LOGGING_CATEGORY(qlcVirtualKeyboard)
+// Enables logging of sensitive information, such as key events.
+// Should never be enabled by default.
+//#define SENSITIVE_DEBUG
+
#define VIRTUALKEYBOARD_DEBUG() qCDebug(qlcVirtualKeyboard)
+#define VIRTUALKEYBOARD_WARN() qCWarning(qlcVirtualKeyboard)
#endif // VIRTUALKEYBOARDDEBUG_H