G4C

;          xOnkey, for extra info on (nearly) every keypress

WINBIG 117 51 460 140   "OnKey.gc"
WinType 11110001
usetopaz

; ---- Decorations

CTEXT 357 3   '  OnKey  ' topaz.font 11 3 2 000
BOX 0 0 460 140   OUT RIDGE
BOX 60 78 118 52   OUT RIDGE
BOX 200 78 118 52   OUT RIDGE

xonLoad 
	GuiOpen OnKey.gc

xonClose
	GuiQuit Onkey.gc

; ---- Explanations

TEXT 20 10 100 10   'Press any key' 18 NOBOX
TEXT 20 23 100 10   'The boxes will (nearly always) tell you :' 42 NOBOX
TEXT 30 35 100 10   'If it was a RAW or a VANILLA key' 32 NOBOX
TEXT 30 44 100 10   'The letter, if it was a VANILLA key' 35 NOBOX
TEXT 30 53 100 10   'Its code number' 16 NOBOX 
TEXT 30 62 100 10   'The qualifier code - of interest only to addicts.' 50 NOBOX 

; The qualifier codes distinguish between Shifted/unshifted,
; Left/Right Alt, Plain/Numeric key pad, and so on.

; No response here from Tab key or Backspace key.
; Try setting debug on for extra insight into the mysteries.

; ---- Boxes to display results

TEXT 80 80 80 10   '' 10 NOBOX
	gadid 1
TEXT 80 92 80 10   '' 10 BOX
	gadid 2
TEXT 80 104 80 10   '' 10 BOX
	gadid 3
TEXT 80 116 80 10   '' 10 BOX
	gadid 4
TEXT 220 80 80 10   '' 10 NOBOX
	gadid 5
TEXT 220 104 80 10   '' 10 BOX
	gadid 6
TEXT 220 116 80 10   '' 10 BOX
	gadid 7

; ---- If a VANILLA key is pressed

xonKey #V
	update OnKey.gc 1 "VANILLA"
	update OnKey.gc 2 $$VANKEY.LETTER
	update OnKey.gc 3 $$VANKEY.CODE
	update OnKey.gc 4 $$VANKEY.QUAL

	;      Clear the RAW boxes

	update OnKey.gc 5 ''
	update OnKey.gc 6 ''
	update OnKey.gc 7 ''

; ---- If a RAW key is pressed

xonKey #R

	update OnKey.gc 5 "RAW"
	update OnKey.gc 6  $$RAWKEY.CODE
	update OnKey.gc 7  $$RAWKEY.QUAL
	 
	;      Clear the VANILLA boxes

	update OnKey.gc 1 ''
	update OnKey.gc 2 ''
	update OnKey.gc 3 ''
	update OnKey.gc 4 ''


