about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-10 06:21:14 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-10 06:21:14 -0700
commit3f367cb9466131f95c11c24df3aac7057143587b (patch)
treebca45b3414e4457813255ffca3f7c5867cbfbd9e
parent134dad7c4bbabb4770727240b150d566aa041567 (diff)
downloadmu-3f367cb9466131f95c11c24df3aac7057143587b.tar.gz
1322 - ctrl-c should always interrupt
-rw-r--r--070display.cc1
-rw-r--r--074keyboard.mu1
2 files changed, 2 insertions, 0 deletions
diff --git a/070display.cc b/070display.cc
index f0e96f02..d420d2f8 100644
--- a/070display.cc
+++ b/070display.cc
@@ -190,6 +190,7 @@ case READ_KEY_FROM_KEYBOARD: {
   long long int found = false;
 //?   cerr << event_type << '\n'; //? 1
   if (event_type == TB_EVENT_KEY) {
+    if (event.key == TB_KEY_CTRL_C) tb_shutdown(), exit(1);
     result = event.key ? event.key : event.ch;
     found = true;
   }
diff --git a/074keyboard.mu b/074keyboard.mu
index 13068c12..7149a290 100644
--- a/074keyboard.mu
+++ b/074keyboard.mu
@@ -62,6 +62,7 @@ recipe send-keys-to-channel [
   {
     c:character, found?:boolean <- read-key keyboard:address
     loop-unless found?:boolean
+#?     print-integer screen:address, c:character #? 1
     print-character screen:address, c:character
     chan:address:channel <- write chan:address:channel, c:character
     # todo: eof