| 3884 | } |
| 3885 | |
| 3886 | int |
| 3887 | nh340_checkinput( |
| 3888 | HANDLE hConIn, |
| 3889 | INPUT_RECORD *ir, |
| 3890 | DWORD *count, |
| 3891 | uchar numberpad, |
| 3892 | int mode, |
| 3893 | int *mod, |
| 3894 | coord *cc) |
| 3895 | { |
| 3896 | #if defined(SAFERHANGUP) |
| 3897 | DWORD dwWait; |
| 3898 | #endif |
| 3899 | int ch = 0; |
| 3900 | boolean valid = 0, done = 0; |
| 3901 | |
| 3902 | #ifdef QWERTZ_SUPPORT |
| 3903 | if (numberpad & 0x10) { |
| 3904 | numberpad &= ~0x10; |
| 3905 | qwertz = TRUE; |
| 3906 | } else { |
| 3907 | qwertz = FALSE; |
| 3908 | } |
| 3909 | #endif |
| 3910 | while (!done) { |
| 3911 | #if defined(SAFERHANGUP) |
| 3912 | dwWait = WaitForSingleObjectEx(hConIn, // event object to wait for |
| 3913 | INFINITE, // waits indefinitely |
| 3914 | TRUE); // alertable wait enabled |
| 3915 | if (dwWait == WAIT_FAILED) |
| 3916 | return '\033'; |
| 3917 | #endif |
| 3918 | ReadConsoleInput(hConIn, ir, 1, count); |
| 3919 | if (mode == 0) { |
| 3920 | if ((ir->EventType == KEY_EVENT) && ir->Event.KeyEvent.bKeyDown) { |
| 3921 | #ifdef QWERTZ_SUPPORT |
| 3922 | if (qwertz) |
| 3923 | numberpad |= 0x10; |
| 3924 | #endif |
| 3925 | ch = nh340_processkeystroke(hConIn, ir, &valid, numberpad, 0); |
| 3926 | #ifdef QWERTZ_SUPPORT |
| 3927 | numberpad &= ~0x10; |
| 3928 | #endif |
| 3929 | done = valid; |
| 3930 | } |
| 3931 | } else { |
| 3932 | if (*count > 0) { |
| 3933 | if (ir->EventType == KEY_EVENT |
| 3934 | && ir->Event.KeyEvent.bKeyDown) { |
| 3935 | ch = nh340_processkeystroke(hConIn, ir, &valid, numberpad, 0); |
| 3936 | if (valid) |
| 3937 | return ch; |
| 3938 | } else if (ir->EventType == MOUSE_EVENT) { |
| 3939 | if ((ir->Event.MouseEvent.dwEventFlags == 0) |
| 3940 | && (ir->Event.MouseEvent.dwButtonState & MOUSEMASK)) { |
| 3941 | cc->x = ir->Event.MouseEvent.dwMousePosition.X + 1; |
| 3942 | cc->y = ir->Event.MouseEvent.dwMousePosition.Y - 1; |
| 3943 |
nothing calls this directly
no test coverage detected