KEY_ESCAPE won't register, won't let me leave!
BlitzMax Forums/BlitzMax Beginners Area/KEY_ESCAPE won't register, won't let me leave!
| ||
I'm quite used to programming, just new to BlitzMax. I've noticed that sometimes while debugging my game ( really just started ), it won't let me use the normal While Not KeyDown(KEY_ESCAPE) loop conditions. Sometimes it works just fine, but after developing a little and testing the game a few times, it suddenly stops working. I recently reinstalled Windows (7 Pro x64) because of this weird issue, because then it would happen in both Blitz3D and BlitzMax. Using keys to control my sprites is fine, just not escape key. I'm sure its got something to do with my keyboard (Logitech G510) or drivers or something obscure, but I just wanted to ask if anyone has ever encountered this. |
| ||
You sure the Program is not in a loop inside the while loop? Maybe the KB buffer is saturated? Clear it Obviously change escape to something else, (just in-case the debugger is cleaning escapes from the buffer) Put a simple IF key END/STOP/POP inside the loop, see what happens. Is there a possibility that after the loop you are jumping back into it? You spelt Key_Escape right? Last edited 2011 |
| ||
I had the same problem so I had to use while not KEY_F1 or KEY_TILDA |
| ||
Got a FlushKeys() in there somewhere? |
| ||
Sometimes keys get stuck and stop responding. Could be that. Little bits of toast and dust and stuff get stuck under the keys. Maybe try cleaning it. |
| ||
I've got a very simple example goingStrict 'Include FILES ' INIT Graphics Graphics 1024,768,32 ' Prepare variables Local TestImage:TImage Const MAP_WIDTH = 256 Const MAP_HEIGHT = 256 Local MapArray[MAP_WIDTH, MAP_HEIGHT] Local MapXi=0, MapYi=0 ' Load ASSETS TestImage = LoadImage:TImage("assets\64x64.png") ' Main LOOP While Not KeyDown(KEY_ESCAPE) Cls For MapXi = 0 To MAP_WIDTH-1 For MapYi = 0 To MAP_HEIGHT-1 DrawImage TestImage, MapXi*64, MapYi*64 Next Next Flip True Wend ' Exit GAME But I've made progress. This problem ONLY happens when I've got Photoshop running in the background. If I close it, escape works fine. This was probably the case before my format/reinstallation of Windows, as I usually have Photoshop running all the time. Is it just me, or could people playing my game also experience this with certain keys? |
| ||
If it affects you, of course it could affect others as well - hard to predict, though. |
| ||
Hi. Have you tried changing KeyDown(KEY_ESCAPE) to KeyHit(KEY_ESCAPE)? |
| ||
KeyHit(KEY_ESCAPE) doesn't work either. I've checked Photoshops keyboard shortcuts, and ESC isn't used for anything. |