Why's ALT pausing my app in windowed mode?

BlitzPlus Forums/BlitzPlus Programming/Why's ALT pausing my app in windowed mode?

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

OK I have a "workaround/hack" for the alt pausing problem.
define these constants:
Const LEFT_ALT = 56
Const KEYEVENTF_KEYUP = 2			

Then add this of code to your main loop:
If KeyHit (LEFT_ALT) Then			
User32_keybd_event(255,0,0,0)
User32_keybd_event(255,0,KEYEVENTF_KEYUP,0)
EndIf

It requires that you have made a user.decls file with this in it:
.lib "user32.dll"
User32_keybd_event%(bVk%, bScan%, dwFlags%, dwExtraInfo%) : "keybd_event" 

Basically, when alt is pressed, the blitz program intercepts it and pushes a 255 Key Down (and Key Up (for safety)). This modifies the alt key press so that it thinks alt+255 is pressed (which doesn't exist) and thus the window menu is not focused. Tada.