- // Count the number of unread input records, including keyboard,
- // mouse, and window-resizing input records.
- GetNumberOfConsoleInputEvents(inh, &dw);
-
- // Read data from console without removing it from the buffer
- if (dw <= 0 || !PeekConsoleInput(inh, rec, Min(dw, 256), &recCnt))
- return 0;
-
- // Search for at least one keyboard event
- for (DWORD i = 0; i < recCnt; i++)
- if (rec[i].EventType == KEY_EVENT)
- return 1;
-
- return 0;
-}
-
-#endif
-
-
-/// prefetch() preloads the given address in L1/L2 cache. This is a non
-/// blocking function and do not stalls the CPU waiting for data to be
-/// loaded from RAM, that can be very slow.
-#if defined(NO_PREFETCH)