   WM_KEYUP is a pain
  Okiday...  I find every time I join a forum It's because I need help, but after reading through some related problems and still finding no functioning solution I have decided to post my exact problem in hopes a great mind can solve this feeble problem.My program captures WM_KEYDOWN quite fine, and it also captures the WM_KEYUP at the same time.  What ends up happening is that the Boolean is turned on and back off before the gameloop can start up again.switch( msg ){case WM_KEYDOWN:switch (wParam){case (0x42)://This is the "b" Button.POINT temp;temp.x = gameObjectPosition.x + 40;//this sets it so the Arrow fires a little to the right of the Player.temp.y = gameObjectPosition.y;arrowLocationList.push_back(temp);break;case VK_LEFT:Left = true;/*if (gameObjectPosition.x > 60){gameObjectPosition.x -= hSpeed;}stepCounter += 1;if(stepCounter >= 8){//sndPlaySound(L"FootStep.wav", SND_ASYNC);FSOUND_Stream_Play(2,footStep);stepCounter = 0;}*/break;case VK_RIGHT:if (gameObjectPosition.x < windowWidth - 140){gameObjectPosition.x += hSpeed;}stepCounter += 1;if(stepCounter >= 8){//sndPlaySound(L"FootStep.wav", SND_ASYNC);FSOUND_Stream_Play(2,footStep);stepCounter = 0;}break;case VK_UP:if (gameObjectPosition.y > 350){gameObjectPosition.y -= vSpeed;}stepCounter += 1;if(stepCounter >= 8){//sndPlaySound(L"FootStep.wav", SND_ASYNC);FSOUND_Stream_Play(2,footStep);stepCounter = 0;}break;case VK_DOWN:if (gameObjectPosition.y < 600){gameObjectPosition.y += vSpeed;}stepCounter += 1;if(stepCounter >= 8){//sndPlaySound(L"FootStep.wav", SND_ASYNC);FSOUND_Stream_Play(2,footStep);stepCounter = 0;}break;case VK_SPACE:FSOUND_Stream_Stop(swordSwing);swingDelay = 0;//sndPlaySound(L"Sword1.wav", SND_ASYNC);FSOUND_Stream_Play(1,swordSwing);attackObjectPosition.x = gameObjectPosition.x + 60;attackObjectPosition.y = gameObjectPosition.y - 40;break;}}case WM_KEYUP:switch(wParam){case VK_LEFT:Left = false; break;}return 0;And the movement is handled in the Game's Loop.if(Left == true)//Movement for left.{if (gameObjectPosition.x > 60){gameObjectPosition.x -= hSpeed;/* hSpeed is a Variable for the speed of movement on the X Axis.*/ }stepCounter += 1;if(stepCounter >= 8){//sndPlaySound(L"FootStep.wav", SND_ASYNC);FSOUND_Stream_Play(2,footStep);stepCounter = 0;}}Anyone have an idea on how to solve this one?   
  The probable error is that you need a break at the end of your "case WM_KEYDOWN" blockwhat you haveswitch (msg){    case WM_KEYDOWN:   switch(wParam)   {  //snip...   }    case WM_KEYUP:   switch(wParam)   {  //snip..   }}what you should have:switch (msg){    case WM_KEYDOWN:   switch(wParam)   {  //snip...   }   break;    case WM_KEYUP:   switch(wParam)   {  //snip...   }   break;}break only breaks out of the nearest control block, it's not global.  i.e. your break statements just break out of the containing switch(wParam) but not also out of the switch(msg) block.As posted, all your WM_KEYDOWN messages should also be falling through to the WM_KEYUP block probably causing weird bugs with VK_LEFT.  Stepping through your code in a debugger would have revealed this.-me   ;  Absolutely.   Thanks a million, It's all dandy now.I'll try to be more thorough with my debugger in the future.   ;  Also, a handy thing to make your code a bit easier to write as well as more readable is that you can use something like case 'B' to check for a keypress instead of having to look up the hex values for the key.   