Disable support for the GPM mouse
gpm_disable_mouse function may be used to inactivate
support for the GPM mouse.
This function may not be available on all systems.
(x, y, state) = mouse_get_event_info ();
This function returns the position of the last processed mouse event, and the state of the mouse buttons and shift keys before the event.
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:
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
1 Left button pressed 2 Middle button pressed 4 Right button pressed 8 Shift key pressed 16 Ctrl key pressed
Void mouse_map_buttons (Integer x, Integer y);
This function may be used to map one mouse button to another. The
button represented by
x will appear as
Void mouse_set_current_window ();
Use of this function results in changing windows to the window that was current at the time of the mouse event.
Void set_default_mouse_hook (String name, String fun);
This function associates a slang function
fun with the mouse event
name. The first parameter
name must be one of the
The meaning of these names should be obvious. The second parameter,
"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"
funmust be defined as
and it must return an integer. The parameters
define fun (line, column, btn, shift)
columncorrespond to the line and column numbers in the buffer where the event took place.
btnis an integer that corresonds to the button triggering the event. It can take on values
4corresponding to the left, middle, and right buttons, respectively.
shiftcan take on values
0indicates that no modifier key was pressed,
1indicates that the SHIFT key was pressed, and
2indicates that the CTRL key was pressed. For more detailed information about the modifier keys, use the function
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.
mouse_get_event_info, mouse_set_current_window, set_buffer_hook