Guest PaltryProgrammer Posted October 21, 2021 Posted October 21, 2021 Running the code below and pressing a key once results in two separate keyboard events with the output being 1 1 Kindly advise Thank You Cheerios #include <iostream> #include <cassert> #include <windows.h> void keyboard(HANDLE hstd_input) { INPUT_RECORD input_record; DWORD nevents = 0; BOOL ok = ReadConsoleInput(hstd_input, &input_record, 1, &nevents); assert(ok); std::wcout << nevents << std::endl; } int main() { HANDLE hstd_input = GetStdHandle(STD_INPUT_HANDLE); keyboard(hstd_input); keyboard(hstd_input); } Continue reading... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.