This function returns the position of the last processed
mouse event, and the state of the mouse buttons and shift
keys before the event.
x and
y represent the column and row, respectively, where
the event took place. They are measured with relative to the
top left corner of the editor's display.
state is a bitmapped integer whose bits are defined as follows:
1 Left button pressed
2 Middle button pressed
4 Right button pressed
8 Shift key pressed
16 Ctrl key pressed
Other information such as the button that triggered the event is
available when the mouse handler is called. As a result, this information
is not returned by
mouse_get_event_info .
This function may be used to map one mouse button to another. The
button represented by x will appear as y .
Use of this function results in changing windows to the window that
was current at the time of the mouse event.
This function associates a slang function
fun with the mouse event
specified by
name . The first parameter
name must be one of the
following:
"mouse_up" "mouse_status_up"
"mouse_down" "mouse_status_down"
"mouse_drag" "mouse_status_drag"
"mouse_2click" "mouse_status_2click"
"mouse_3click" "mouse_status_3click"
The meaning of these names should be obvious. The second parameter,
fun must be defined as
define fun (line, column, btn, shift)
and it must return an integer. The parameters
line and
column correspond to the line and column numbers in the
buffer where the event took place.
btn is an integer that
corresonds to the button triggering the event. It can take
on values
1 ,
2 , and
4 corresponding to the left,
middle, and right buttons, respectively.
shift can take on
values
0 ,
1 , or
2 where
0 indicates that no modifier
key was pressed,
1 indicates that the SHIFT key was
pressed, and
2 indicates that the CTRL key was pressed.
For more detailed information about the modifier keys, use
the function
mouse_get_event_info .
When the hook is called, the editor will automatically change
to the window where the event occured. The return value of
the hook is used to dictate whether or not hook handled the
event or whether the editor should switch back to the window
prior to the event. Specifically, the return value is interpreted
as follows:
-1 Event not handled, pass to default hook.
0 Event handled, return active window prior to event
1 Event handled, stay in current window.