KEY_ESCAPE not exiting?

BlitzMax Forums/BlitzMax Programming/KEY_ESCAPE not exiting?

You'd use something like:

SuperStrict

Framework BRL.StandardIO
Import BRL.PolledInput
Import Pub.Win32

'Let's create a reference to the function (the user32.dll is imported using Pub.Win32 module)

Extern "win32"

	Function GetAsyncKeyState%(vKey%)	'Get's the no of times the key has been pressed since last call

EndExtern


Repeat

	'Loop until we hit shift and escape
	PollSystem()

Until GetAsyncKeyState(KEY_ESCAPE|VK_SHIFT)	'VK_CONTROL, VK_MENU, VK_LWIN

Print "Ending"

End
Because GetAsyncKeyState() is a Windows specific API function, you can't use the modifiers Blitz uses internally (though the normal keys are the same). The modifier constants the function interprets are VK_CONTROL, VK_MENU, VK_LWIN, VK_RWIN, VK_SHIFT which are already defined in Pub.Win32 module so you can use them straight away.

Regarding the commenting of those additional constants, I assume it's because they haven't got them working the same cross-platform so are not supporting them for now.