summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/live.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/live.cpp b/src/live.cpp
index 641eb7d..0120bd7 100644
--- a/src/live.cpp
+++ b/src/live.cpp
@@ -59,8 +59,11 @@ LiveOutput::HandleEvents()
{
sf::Event event;
while (this->window_.pollEvent(event)) {
- if (event.type == sf::Event::Closed)
+ if ((event.type == sf::Event::Closed)
+ || (event.type == sf::Event::KeyPressed
+ && event.key.code == sf::Keyboard::Escape)) {
this->window_.close();
+ }
}
return this->window_.isOpen();
}