• Create Account

### #ActualOgre722

Posted 23 February 2012 - 08:33 PM

I have a problem with the WM_KEYUP message not being sent. I've had this problem ever since the first NeHe tutorials that I did when I first started out. I have had this problem across many different input management scheme's, so I don't think its my code that is directly responsible for this, but here it is anyway:

case WM_KEYDOWN:
if (win_active)
for (list<KeyInput>::iterator t = key_inputs.begin(); t != key_inputs.end(); ++t)
(*t).PushKeyDown(ConvertKeyCode(wparam));
return 0;
case WM_KEYUP:
if (win_active)
for (list<KeyInput>::iterator t = key_inputs.begin(); t != key_inputs.end(); ++t)
(*t).PushKeyUp(ConvertKeyCode(wparam));
return 0;


What happens is every so often, a key is pressed down, the keydown message is sent. But when the key is released the keyup message is not sent and my program thinks the key has not been released. the only way to fix this is to press the key again to "unstick" the key. Does anyone know a way to fix this problem?

### #1Ogre722

Posted 23 February 2012 - 08:28 PM

I have a problem with the WM_KEYUP message not being sent. I've had this problem ever since the first NeHe tutorials that I did when I first started out. I have had this problem across many different input management scheme's, so I don't think its my code that is directly responsible for this, but here it is anyway:

case WM_KEYDOWN:
if (win_active)
for (list<KeyInput>::iterator t = key_inputs.begin(); t != key_inputs.end(); ++t)
(*t).PushKeyDown(ConvertKeyCode(wparam));
return 0;
case WM_KEYUP:
if (win_active)
for (list<KeyInput>::iterator t = key_inputs.begin(); t != key_inputs.end(); ++t)
(*t).PushKeyUp(ConvertKeyCode(wparam));
return 0;


What happens is every so often, a key is pressed down, the keydown message is sent. But when the key is released the keyup message is not sent and my program thinks the key has not been released. the only way to fix this is to press the key again to "unstick" the key. Does anyone know a way to fix this problem?

PARTNERS