diff --git a/src/widgets/DisassemblyWidget.cpp b/src/widgets/DisassemblyWidget.cpp index c1423dfd..57c262be 100644 --- a/src/widgets/DisassemblyWidget.cpp +++ b/src/widgets/DisassemblyWidget.cpp @@ -100,6 +100,11 @@ DisassemblyWidget::DisassemblyWidget(QWidget *parent) connect(Core(), &CutterCore::refreshAll, this, [this]() { refreshDisasm(Core()->getOffset()); }); + + // Dirty + QShortcut *shortcut_escape = new QShortcut(QKeySequence(Qt::Key_Escape), this); + shortcut_escape->setContext(Qt::WidgetShortcut); + connect(shortcut_escape, SIGNAL(activated()), this, SLOT(seekPrev())); } DisassemblyWidget::DisassemblyWidget(const QString &title, QWidget *parent) : @@ -516,3 +521,8 @@ void DisassemblyTextEdit::keyPressEvent(QKeyEvent */*event*/) { //QPlainTextEdit::keyPressEvent(event); } + +void DisassemblyWidget::seekPrev() +{ + Core()->seekPrev(); +} diff --git a/src/widgets/DisassemblyWidget.h b/src/widgets/DisassemblyWidget.h index f2201856..5192c571 100644 --- a/src/widgets/DisassemblyWidget.h +++ b/src/widgets/DisassemblyWidget.h @@ -26,6 +26,7 @@ public slots: void refreshDisasm(RVA offset = RVA_INVALID); void fontsUpdatedSlot(); void colorsUpdatedSlot(); + void seekPrev(); private slots: void on_seekChanged(RVA offset);