שתשת                                        NameHookCode:
; Hook conventions
;	A0 - pointer to hook itself
;	A1 - pointer to parameter packet ("message")
;	A2 - Hook specific address data ("object," e.g, gadget )

	cmp.l	#SGH_KEY,(a1)			; Check if key
	bne	.Not

	cmp.w	#EO_REPLACECHAR,sgw_EditOp(a2)	; Check if replace
	beq	.Ok
	
	cmp.w	#EO_INSERTCHAR,sgw_EditOp(a2)	; or insert.
	bne	.Not
.Ok:
	move.l	a3,-(sp)

	move.l	sgw_WorkBuffer(a2),a3		; Get address to workbuffer
	moveq	#0,d0
	move.w	sgw_BufferPos(a2),d0		; and add bufferpos to it.
	add.l	d0,a3

	cmp.b	#':',-1(a3)			; Check if :
	beq	.Error				; Jump to .Error if not wanted

	cmp.b	#'/',-1(a3)
	beq	.Error


	bra	.Exit
.Error:
	move.l	#~SGA_USE,sgw_Actions(a2)	; Do not use the char!
	and.l	#SGA_BEEP,sgw_Actions(a2)	; And do a DisplayBeep..


.Exit:
	move.l	(sp)+,a3

	moveq	#-1,d0
	rts

.Not:
	moveq	#0,d0
	rts

; ------------------------------------------------------------------------
;     Data
; ------------------------------------------------------------------------

NameTags:
	dc.l	GTST_EditHook,NameHook
	dc.l	TAG_DONE

NameHook:
	dc.l	0		; MLN_SUCC
	dc.l	0		; MLN_PRED
	dc.l	NameHookCode	; assembler entry point
	dc.l	0		; optional HLL entry point
	dc.l	0		; owner specific
