*** Keycode displayer
** A tool for displaying the keycode of
** keys pressed
* Press Shift+Control+K to activate

enum 1 2 205
	kill targ
next

*create the base object
new: comp 1 2 205 "blank" 1 0 0
attr 32
flto 0 300
*respond to keyboard events - key down
imsk 1

setv ov00 0

scrp 1 2 205 73
	doif keyd 17 = 1 and keyd 16 = 1
		doif _p1_ = 'K'
			doif ov00 = 0
				pat: fixd 1 "blank" 0 0 0 10000 "whiteontransparentchars"
				setv ov00 1
				frel pntr
				flto 0 30
			else
				pat: kill 1
				setv ov00 0
				frel null
			endi
		endi
	endi

	doif ov00 = 1
		part 1
		sets va00 "Key:\n"
		adds va00 vtos _p1_
		ptxt va00
	endi
endm

******REMOVAL
rscr
enum 1 2 205
	kill targ
next
scrx 1 2 205 73