From cae0ee2160c595ceff160ed705c3ed9b5cb75c13 Mon Sep 17 00:00:00 2001 From: Shylie Date: Mon, 15 Apr 2024 09:37:58 -0400 Subject: [PATCH] Emit CR as well as NL --- source/terml_windows.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/terml_windows.cpp b/source/terml_windows.cpp index 629fde8..e6673f1 100644 --- a/source/terml_windows.cpp +++ b/source/terml_windows.cpp @@ -87,12 +87,15 @@ void terml_windows::process_events() KEY_EVENT_RECORD* record = &input_record_buffer[i].Event.KeyEvent; if (record->bKeyDown) { - const char key = record->uChar.AsciiChar == '\r' ? '\n' : record->uChar.AsciiChar; - if (key) + if (record->uChar.AsciiChar) { for (int repeat = 0; repeat < record->wRepeatCount; repeat++) { - key_event(key); + key_event(record->uChar.AsciiChar); + if (record->uChar.AsciiChar == '\r') + { + key_event('\n'); + } } } }