mirror of
https://git.shylie.info/shylie/terml.git
synced 2024-11-21 15:40:07 +00:00
Translate carriage returns to newlines on windows
This commit is contained in:
parent
a6a2141049
commit
061f318247
@ -86,12 +86,13 @@ void terml_windows::process_events()
|
|||||||
{
|
{
|
||||||
KEY_EVENT_RECORD* record = &input_record_buffer[i].Event.KeyEvent;
|
KEY_EVENT_RECORD* record = &input_record_buffer[i].Event.KeyEvent;
|
||||||
if (record->bKeyDown)
|
if (record->bKeyDown)
|
||||||
|
{
|
||||||
|
const char key = record->uChar.AsciiChar == '\r' ? '\n' : record->uChar.AsciiChar;
|
||||||
|
if (key)
|
||||||
{
|
{
|
||||||
for (int repeat = 0; repeat < record->wRepeatCount; repeat++)
|
for (int repeat = 0; repeat < record->wRepeatCount; repeat++)
|
||||||
{
|
{
|
||||||
if (record->uChar.AsciiChar)
|
key_event(key);
|
||||||
{
|
|
||||||
key_event(record->uChar.AsciiChar);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user