I saw this recently in Laura Bow 1.
In the starting room
rm44 they use a combination of the MousedOn and DoLook procedures:
(instance sofa of RPicView
(properties
y 169
x 172
view 144
cel 1
priority 13
signal 16384
)
(method (handleEvent event)
(if (MousedOn self event 3) ;3 == rightClick
(event claimed: 1)
(DoLook {couch})
)
)
)
MousedOn is defined in
Interface.sc (script 255):
(procedure (MousedOn obj event theMods)
(cond
((!= (event type:) 1) 0)
((and (>= argc 3) theMods (== (& (event modifiers:) theMods) 0)) 0)
((obj respondsTo: #nsLeft)
(InRect
(obj nsLeft:)
(obj nsTop:)
(obj nsRight:)
(obj nsBottom:)
event
)
)
)
)
And DoLook is defined in
Main.sc:
(procedure (DoLook param1 &tmp temp0)
(StrCpy (User inputLineAddr:) {Look })
(StrCat (User inputLineAddr:) param1)
((= temp0 (Event new:)) type: evSAID)
(Parse (User inputLineAddr:) temp0)
(User said: temp0)
(temp0 dispose:)
)
Hope that helps a little.
Edit: In case it's not obvious, this simulates the player typing LOOK COUCH, so it also requires (Said 'look/couch') to exist as well. In this specific case that exists in the region associated with rm44,
insideReg.sc (script 210), but it would be easier just to include it in the Sofa's handleEvent method before or after the MousedOn check.
Also, I might be misremembering, but I recall the difference between RPicView and the PicView in older SCI0 games is PicView doesn't respond to nsLeft. You might need to port RPicView into your project as well.