***************************************************************************
*
* Hook routines
*

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)
	bne.b	.Not

	cmp.w	#EO_ENTER,sgw_EditOp(a2)
	beq	.EnterPressed

;	cmp.w	#EO_REPLACECHAR,sgw_EditOp(a2)
;	beq.b	.Ok
;	
;	cmp.w	#EO_INSERTCHAR,sgw_EditOp(a2)
;	bne.b	.Not
;.Ok:
;	move.l	a3,-(sp)
;
;	move.l	sgw_WorkBuffer(a2),a3
;	moveq	#0,d0
;	move.w	sgw_BufferPos(a2),d0
;	add.l	d0,a3
;
;	cmp.b	#'q',-1(a3)
;	beq	.Error
;
;	bra.b	.Exit
;.Error:
;	and.l	#~SGA_USE,sgw_Actions(a2)
;	or.l	#SGA_BEEP,sgw_Actions(a2)
;
;
;.Exit:
;	move.l	(sp)+,a3
;
;	moveq	#-1,d0
;	rts
;
;.Not:
	moveq	#0,d0				; Didn't understand command
	rts

.EnterPressed:
	or.l	#SGA_END,sgw_Actions(a2)
	or.l	#SGA_NEXTACTIVE,sgw_Actions(a2)
	moveq	#-1,d0				; Command understood!
	rts
