Re: Win32 (GetAsyncKeyState)
- Posted by Adam Weeden <theskaman at MINDSPRING.COM> May 19, 1999
- 519 views
It might be this. In C (and its successor) whenever you are testing a variable against many values you use a switch statement like this: // Sorry abou the C code, necessary to show my point. // Assume we have already set value of key to what ASyncKeyState // returns. switch(key) { case VALUE1: { // Do whatever you need to do for VALUE1 } break; case VALUE2: { // Do whatever you need to do for VALUE2 } break; default: { // If key doesnt match any of the above values do this } break; } In Euphoria this could be wriiten as If key = VALUE1 then -- Keep in mind VALUE1 in my example is a -- constant so this is legal. -- Do whatever you need to do for VALUE1 elsif key = VALUE2 then -- Do whatever you need to do for VALUE2 else -- If key doesnt match any of the above values do this end if My point is that maybe you need some sort of function that would parse a return value of GetAsyncKeyState that you do not need. Just a thought. Adam Weeden -----Original Message----- From: Molasses <molasses at ALPHALINK.COM.AU> To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU> Date: Tuesday, May 18, 1999 8:45 PM Subject: Win32 (GetAsyncKeyState) >Hi all, > >I have recently been playing around with the user32.dll function >GetAsyncKeyState. >I'm using it for moving around in a 3dfx Glide prog. > >Problems: > >* GetAsyncKeyState only works after I open a message box. > >This may be something to do with not opening a standard window, I open a >Glide window like this: >context = grSstWinOpen( GetDesktopWindow(), GR_RESOLUTION_640x480, ...) > >* GetAsyncKeyState stops responding if I hit a key that i'm not checking >for. > >Anyone know what I'm doing wrong? > >Thanks, > >-molasses