| 634 | } |
| 635 | |
| 636 | int NetHackQtBind::qt_nhgetch() |
| 637 | { |
| 638 | if (main) |
| 639 | main->fadeHighlighting(true); |
| 640 | |
| 641 | // Process events until a key arrives. |
| 642 | // |
| 643 | while (keybuffer.Empty()) { |
| 644 | int exc = qApp->exec(); |
| 645 | /* |
| 646 | * On OSX (possibly elsewhere), this prevents an infinite |
| 647 | * loop repeatedly issuing the complaint: |
| 648 | QCoreApplication::exec: The event loop is already running |
| 649 | * to stderr if you synchronously start nethack from a terminal |
| 650 | * then switch focus back to that terminal and type ^C. |
| 651 | * SIGINT -> done1() -> done2() -> yn_function("Really quit?") |
| 652 | * in the core asks for another keystroke. |
| 653 | * |
| 654 | * However, it still issues one such complaint, and whatever |
| 655 | * prompt wanted a response ("Really quit?") is shown in the |
| 656 | * message window but is auto-answered with ESC. |
| 657 | */ |
| 658 | if (exc == -1) |
| 659 | keybuffer.Put('\033'); |
| 660 | } |
| 661 | |
| 662 | // after getting a key rather than before |
| 663 | if (main) |
| 664 | main->fadeHighlighting(false); |
| 665 | |
| 666 | return keybuffer.GetAscii(); |
| 667 | } |
| 668 | |
| 669 | #ifdef IDLECHECKPOINT |
| 670 | void |
nothing calls this directly
no test coverage detected