Here are some words what I wrote.
Post
breakintoprogram.co.ukI Accidentally Wrote an Emulator (Part 7) - L Break Into Program, 0:1In the previous articles I discussed: It was time to embark on a side mission. Emscripten Emscripten is a toolchain that will compile native C and C++ to WebAssembly (webasm). WebAssembly is a low-lev...
Ah no, I remember now - this still falls foul of SDL; it appears to maintain its internal keystate by using the underlying OS KEYUP/KEYDOWN events. Sigh.
0 reposts2 likes
I only superficially familiar with SDL (hello world level), but it has source available, it might have been fixed somewhere? github.com/libsdl-org/S...
I've said it before and I'll say it again: On Windows you'll have to use RegisterRawInputDevices or (most similar to your suggestion) GetAsyncKeyState:
learn.microsoft.comGetAsyncKeyState function (winuser.h) - Win32 appsDetermines whether a key is up or down at the time the function is called, and whether the key was pressed after a previous call to GetAsyncKeyState.