| 703 | #endif /* IDLECHECKPOINT */ |
| 704 | |
| 705 | int NetHackQtBind::qt_nh_poskey(coordxy *x, coordxy *y, int *mod) |
| 706 | { |
| 707 | if (main) |
| 708 | main->fadeHighlighting(true); |
| 709 | |
| 710 | #ifdef IDLECHECKPOINT |
| 711 | if (iflags.idlecheckpoint) { |
| 712 | if (!qt_input_timer) { |
| 713 | qt_input_timer = new QTimer(); |
| 714 | qt_input_timer->setSingleShot(true); |
| 715 | connect(qt_input_timer, &QTimer::timeout, &qt_timer_fire); |
| 716 | } |
| 717 | if (!qt_input_timer->isActive()) |
| 718 | qt_input_timer->start(IDLECHECKPOINT_WAIT_TIME * 1000); |
| 719 | } |
| 720 | #endif |
| 721 | // Process events until a key or map-click arrives. |
| 722 | // |
| 723 | while (keybuffer.Empty() && clickbuffer.Empty()) { |
| 724 | int exc = qApp->exec(); |
| 725 | // [see comment above in qt_nhgetch()] |
| 726 | if (exc == -1) |
| 727 | keybuffer.Put('\033'); |
| 728 | } |
| 729 | |
| 730 | // after getting a key or click rather than before |
| 731 | if (main) |
| 732 | main->fadeHighlighting(false); |
| 733 | |
| 734 | if (!keybuffer.Empty()) { |
| 735 | #ifdef IDLECHECKPOINT |
| 736 | if (qt_input_timer->isActive()) |
| 737 | qt_input_timer->stop(); |
| 738 | #endif |
| 739 | return keybuffer.GetAscii(); |
| 740 | } else { |
| 741 | *x=clickbuffer.NextX(); |
| 742 | *y=clickbuffer.NextY(); |
| 743 | *mod=clickbuffer.NextMod(); |
| 744 | clickbuffer.Get(); |
| 745 | #ifdef IDLECHECKPOINT |
| 746 | if (qt_input_timer->isActive()) |
| 747 | qt_input_timer->stop(); |
| 748 | #endif |
| 749 | return 0; |
| 750 | } |
| 751 | } |
| 752 | |
| 753 | void NetHackQtBind::qt_nhbell() |
| 754 | { |