Skip to content

Commit

Permalink
[NO MERGE] Report pressed keys
Browse files Browse the repository at this point in the history
  • Loading branch information
shoogle committed Oct 1, 2024
1 parent ace8209 commit 2a5b579
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/framework/ui/internal/navigationcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <QApplication>
#include <QWindow>
#include <QTextStream>
#include <QKeyEvent>

#include "global/defer.h"

Expand Down Expand Up @@ -381,6 +382,14 @@ bool NavigationController::eventFilter(QObject* watched, QEvent* event)
{
if (event->type() == QEvent::MouseButtonPress) {
resetIfNeed(watched);
} else if (event->type() == QEvent::ShortcutOverride) {
auto keyEvent = static_cast<QKeyEvent*>(event);
QKeySequence sequence(keyEvent->keyCombination());
LOGI() << QString("Keys: '%1' Native: '%2' Text: '%3'").arg(
sequence.toString(QKeySequence::PortableText), // default
sequence.toString(QKeySequence::NativeText),
keyEvent->text()
).toStdString();
}

return QObject::eventFilter(watched, event);
Expand Down

0 comments on commit 2a5b579

Please sign in to comment.