May 8, 200521 yr OK, never mind ! I found it ;) and it is working :)//____________________________________________Ok, here's the question,why does this work:if (keys[VK_F3]){keys[VK_F3]=FALSE;_charsize-=1;BuildFont();}and why doesn't this work:if (keys['a']){keys['a']=FALSE;_charsize-=1;BuildFont();}In other words, how can my code know if a key is pressed other than the VK keys ?I keep looking on the net in the meantime while waiting an answer here.
May 8, 200521 yr I'm not 100% sure about the "keys[]" command, but typically keyboard inputs are scanned as ASCII codes. In the latter example you gave, you are passing an argument of type 'char' to a function expecting maybe an integer value. This is my best guess as most of my coding is in VB.If you were to use the ASCII value instead of 'a' (65), it should work fine:_____________________if (keys[65]){keys[65]=FALSE;...._____________________Roberthttp://777Simulator.com
May 8, 200521 yr As said in my edit, I made it work ;) Tnx anyway.To show you what I did: case WM_CHAR: // received a character message switch(wParam) // check what was pressed through wParam { case 'a': if (!_fmpAlt == 1) { _fmpAlt=1; } else { _fmpAlt=0; } break; case 'A': // _fmpAlt2=1; break;etc etc.
May 9, 200521 yr Ahh... thought you were asking specifically why the original code didn't work. Glad to hear it is running!Robert
Create an account or sign in to comment