Allow aborting the command while QR codes are generated.

This commit is contained in:
Michael Lotz
2012-07-01 19:01:26 +02:00
parent a86c7d0ab3
commit e0ef5b2a97
@@ -18,6 +18,11 @@ extern "C" {
}
extern "C" {
extern void abort_debugger_command();
}
static const char* kWebPostBaseURL = "http://haiku.mlotz.ch/qrencode/store.php";
static char sStringBuffer[16 * 1024];
@@ -68,8 +73,9 @@ print_qrcode(QRcode* qrCode, bool waitForKey)
move_to_and_clear_line(qrCode->width / 2 + 3);
if (waitForKey) {
kputs("press any key to continue...\x1b[1B\x1b[G");
kgetc();
kputs("press q to abort or any other key to continue...\x1b[1B\x1b[G");
if (kgetc() == 'q')
abort_debugger_command();
}
}