about summary refs log tree commit diff stats
path: root/070display.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-14 12:06:16 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-14 12:27:31 -0700
commitaf336c444f4fe9d8a1677a200f40748ce5f24a26 (patch)
treeb06b1c2323a5033194724171af7681e760bd546b /070display.cc
parentb98d3876b67a35f1d913ba374749bc97103b7790 (diff)
downloadmu-af336c444f4fe9d8a1677a200f40748ce5f24a26.tar.gz
1368 - alias carriage-return and newline
CRLF still shows as two newlines, though. Cross that bridge when we get
to it.

The new chessboard test is still hanging, though.
Diffstat (limited to '070display.cc')
-rw-r--r--070display.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/070display.cc b/070display.cc
index 8a782f87..b93731ab 100644
--- a/070display.cc
+++ b/070display.cc
@@ -214,9 +214,10 @@ 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);
-    if (event.key == TB_KEY_BACKSPACE2) event.key = TB_KEY_BACKSPACE;
     result = event.key ? event.key : event.ch;
+    if (result == TB_KEY_CTRL_C) tb_shutdown(), exit(1);
+    if (result == TB_KEY_BACKSPACE2) result = TB_KEY_BACKSPACE;
+    if (result == TB_KEY_CARRIAGE_RETURN) result = TB_KEY_NEWLINE;
     found = true;
   }
   products.resize(2);