$mouse-pos - Mouse position information
$mouse-pos integer
$mouse-pos is generated by invocation of the command set-cursor-to-mouse(2). The variable is set to a value that indicates the position of the mouse within a window. The values to the mouse intersection are interpreted as follows:-
0 - Text area
1 - Message Line
2 - Mode Line
3 - Horizontal Separator
4 - Up Arrow
5 - Upper Shaft
6 - Scroll Box
7 - Lower Shaft
8 - Down Arrow
9 - Corner
10 - Menu Line
255 - Error
Bit 4 - 2nd Column
The following macro can be used to print out the current position of the mouse, try binding the macro to the "mouse-move" key:
define-macro print-mouse-position !force set-cursor-to-mouse set-variable #l0 &band $mouse-pos 15 !if &equ #l0 0 ml-write "Mouse in text window" !elif &equ #l0 1 ml-write "Mouse on message line" !elif &equ #l0 2 ml-write "Mouse on Mode line" !elif &and &gre #l0 2 &les #l0 10 ml-write "Mouse on scroll bar" !elif &equ #l0 10 ml-write "Mouse on corner" !elif &equ #l0 11 ml-write "Mouse on menu line" !endif !emacro global-bind-key print-mouse-position mouse-move
$mouse-pos is utilized by the mouse picking code, found in macro file mouse.emf.
(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12