The codes in the linked document don't match my keyboard, neither. At my PC the key 'w' for example is 17 which is 'q' in the specification. I just iterated over all the keys until I found the right one, but this is a messy solution.
I tried virtual key codes first but they never get through to the Application. It's actually a game and I believe D3D manages keypresses.
Is there no function for this? I was hoping there was something like getchar().