;Example of bdbfs plugin file.
;Information about key codes
;example of WHILE/EXIT statement
;Uses also some elements of bdbfs visual interface.

#include bdbfs.ch
#LOCAL nk, lEsc
cCodePage:='cp866'
SetColor(m->_im)
ScrSave()
Panel(9,19,15,59,{"Press Esc twice for exit"})
DevPos(12, 31)
DevOut('Key Pressed: ')
DevPos(13, 31)
DevOut('ASCII: ')
lEsc:=.F.
SetColor(m->_HdColor)
DO WHILE .T.
	nk:=WaitKey(0)
	IF nk=27	//ESC
		IF lEsc	
			EXIT
		ELSE
			lEsc:=.T.
		ENDIF
	ELSE
		lEsc:=.F.
	ENDIF	
	DispOutAt(12, 45, PAD(StrZero(nk, 3), 4))
	DispOutAt(13, 45, CHR(nk))
ENDDO
ScrRest()
SHOW "Good Bye!!!"
