diff --git a/src/input.cpp b/src/input.cpp index 0d86f2a843..650fd3ab69 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -2240,6 +2240,22 @@ public: } return true; } + bool keyEvent(QKeyEvent *event) + { + if (event->key() != Qt::Key_Escape) { + return false; + } + + auto seat = waylandServer()->seat(); + if (!seat->isDrag()) { + return false; + } + seat->setTimestamp(event->timestamp()); + + seat->cancelDrag(); + + return true; + } private: void raiseDragTarget() {