Scilab Function
Last update : September 1994

xgetmouse - get the mouse events and current position

Calling Sequence

rep=xgetmouse([flag], [sel])

Parameters

Description

If the mouse pointer is located in the current graphics window, xgetmouse returns in rep the current pointer position (x,y) and the value ibutton. The ibutton value indicates the event type:

ibutton==0: Left mouse button has been pressed
ibutton==1: Middle mouse button has been pressed
ibutton==2: Right mouse button has been pressed

ibutton==3: Left mouse button has been clicked
ibutton==4: Middle mouse button has been clicked
ibutton==5: Right mouse button has been clicked

ibutton==10: Left mouse button has been double-clicked
ibutton==11: Middle mouse button has been double-clicked
ibutton==12: Right mouse button has been double-clicked

ibutton==-5: Left mouse button has been released
ibutton==-4: Middle mouse button has been released
ibutton==-3: Right mouse button has been released

ibutton==-1: pointer has moved

ibutton > =32: key with ascii code ascii(ibutton) has been pressed
ibutton < =-32: key with ascii code ascii(-ibutton) has been released

ibutton > =1000+32: key with ascii code ascii(ibutton-1000) has been pressed while CTRL key pressed
ibutton==-1000: graphic window has been closed

Examples


xselect(); xbasc(); xsetech([0 0 1 1],[0 0 100 100])
xset("alufunction",6)
xtitle(" drawing a rectangle ")
[b,x0,y0]=xclick(); rep=[x0,y0,-1]; x=x0; y=y0;
xrect(x0,y0,x-x0,y-y0)
while rep(3)==-1 then
    rep=xgetmouse(0)
    xrect(x0,y0,x-x0,y0-y)
    x=rep(1); y=rep(2);
    xrect(x0,y0,x-x0,y0-y)
end
xset("alufunction",3)
 
  

See Also

locate,  xclick,  seteventhandler,  

Author

S. Steer