mouseMove & backgoundBehavior

Jim Lambert jiml at netrin.com
Wed Apr 26 20:24:52 EDT 2017


Make a group that is smaller than your card.
Place this in the group’s script:
	on mousemove newMouseH, newMouseV
		put newMouseH, newMouseV
	end mousemove

When the cursor moves around within the group the current mouseLoc is put into the message box. When the cursor moves outside of the group the mouseloc is no longer placed into the message box.

Next set the backgroundBehaviour of the group to TRUE.

Now wherever the cursor is within the CARD the mouseLoc is placed in the message box regardless of whether the cursor is within or without the rect of the group.

The dictionary states, "The mouseMove message is sent to the control the mouse pointer is over, or to the card if no control is under the mouse pointer.”

It is true that a background group is not 'officially' on a card (rather it’s on the background in HyperCard parlance.) But why would the mousemove message get passed to the card when the mouse is outside of the background group containing that handler?

Is this a bug or expected behavior?

Thanks,
Jim Lambert



More information about the use-livecode mailing list