GLK: ADVSYS: Added readLine method

This commit is contained in:
Paul Gilbert 2019-06-13 07:20:00 -07:00
parent d29727d02a
commit 8759a9e851

View File

@ -40,8 +40,21 @@ void GlkInterface::print(int number) {
}
Common::String GlkInterface::readLine() {
// TODO: Stub
return "";
event_t ev;
char line[200];
glk_request_line_event(_window, line, 199, 0);
do {
glk_select(&ev);
if (ev.type == evtype_Quit)
return "";
else if (ev.type == evtype_LineInput)
break;
} while (!shouldQuit() && ev.type != evtype_Quit);
line[199] = '\0';
return Common::String(line);
}
} // End of namespace AdvSys