diff options
author | Paul Gilbert | 2019-06-13 07:20:00 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-06-13 20:45:53 -0700 |
commit | 8759a9e851283c69e8c86ce15eed7e2e53bc032c (patch) | |
tree | 58dc6d561acff5b3f1ad48c2425ed76b03772b95 | |
parent | d29727d02aacbacaee3722e390b0cba455d52168 (diff) | |
download | scummvm-rg350-8759a9e851283c69e8c86ce15eed7e2e53bc032c.tar.gz scummvm-rg350-8759a9e851283c69e8c86ce15eed7e2e53bc032c.tar.bz2 scummvm-rg350-8759a9e851283c69e8c86ce15eed7e2e53bc032c.zip |
GLK: ADVSYS: Added readLine method
-rw-r--r-- | engines/glk/advsys/glk_interface.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/engines/glk/advsys/glk_interface.cpp b/engines/glk/advsys/glk_interface.cpp index 6ec5a08547..3e1ccb6a3b 100644 --- a/engines/glk/advsys/glk_interface.cpp +++ b/engines/glk/advsys/glk_interface.cpp @@ -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 |