Original Post
Hi. I'm having trouble with GetKeyState when multiple keys are pressed down. For example, I use the arrow keys to control the camera movement, as shown below. If I have both up arrow and down arrow keys pressed down, then the left arrow key doesn't work, but strangely the right arrow key works. Similarly, if I have both left and right arrow keys pressed down, then the up arrow key doesn't work but the down arrow key works. I'm not sure how GetKeyState works internally, but there seems to be something wrong when multiple keys are pressed. Any help is appreciated!
void get_keyboard_input()
{
if(GetKeyState(VK_UP) & 0x80)
Camera.MoveCamera(MOVE_FORWARD);
if(GetKeyState(VK_DOWN) & 0x80)
Camera.MoveCamera(MOVE_BACKWARD);
if(GetKeyState(VK_RIGHT) & 0x80)
Camera.MoveCamera(MOVE_RIGHT);
if(GetKeyState(VK_LEFT) & 0x80)
Camera.MoveCamera(MOVE_LEFT);
}