Mouse Move Events - Raw Over and Hover Events
Author: Carl Sassenrath
This simple example illustrates how a program can track the mouse move events in REBOL. This is useful if you need to make your own over and hover types of graphical user interface actions.
Here is a layout that shows a BOX that is 200x200 in size. The code also sets a new OVER feel for the box that will show the location of the mouse as text in the box. Also, if the mouse moves into the box, the box will turn green. If the mouse moves out of the box, the box will turn red. (The action value indicates those changes.)
If you VIEW the layout with:
you will only see the OVER function get called when the mouse moves into or out of the box (called a transition event). This is done automatically to reduce the amount of computing that happens as you move your mouse around a window.
If you want to get OVER events for every mouse move, add the ALL-OVER option to the window when you VIEW it:
Now you can see every mouse move. This feature can be useful for games and special utilities than need to continuously detect over and hover types of actions.