Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.0 - 日本語

Change language to:
English - Français - Português

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab manual >> Graphics Library > interaction > xgetmouse

xgetmouse

マウスのイベントおよびカレントの位置を取得する

呼び出し手順

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

パラメータ

sel

論理値ベクトル [getmotion, getrelease]. デフォルト値は [%t, %f]です

rep

大きさ 3のベクトル, [x,y,ibutton].

win

イベントが発生した図の番号.

説明

マウスポインタがカレントの図のウインドウ内に位置する場合, xgetmouserepに カレントのポインタの位置(x,y)と値ibuttonを返します. ibuttonの値は以下のイベントの種類を示します:

ibutton==0

マウスの左ボタンが押されました

ibutton==1

マウスの中ボタンが押されました

ibutton==2

マウスの右ボタンが押されました

ibutton==3

マウスの左ボタンがクリックされました

ibutton==4

マウスの中ボタンがクリックされました

ibutton==5

マウスの右ボタンがクリックされました

ibutton==10

マウスの左ボタンがダブルクリックされました

ibutton==11

マウスの中ボタンがダブルクリックされました

ibutton==12

マウスの右ボタンがダブルクリックされました

ibutton==-5

マウスの左ボタンが放されました

ibutton==-4

マウスの中ボタンが放されました

ibutton==-3

マウスの右ボタンが放されました

ibutton==-1

ポインタが移動されました

ibutton > =32

ASCIIコードascii(ibutton)を有するキーが押されました

ibutton < =-32

ASCIIコードascii(-ibutton)を有するキーが放されました

ibutton > =1000+32

ASCIIコードascii(ibutton-1000)を有するキーがCTRLキーが押されている間に 押されました

ibutton==-1000

グラフィックウインドが閉じられました

警告: 前のバージョンの Scilab (<5.0)では, xgetmouseが入力された時点で マウスクリックのイベントキューをクリアするかどうかを設定するフラグを ユーザが設定できました. このオプションは, Scilab 5.1 で削除されています.

//  矩形選択
clf();  // ウインドウを消去/作成
a=gca();a.data_bounds=[0 0;100 100];//ユーザ座標を設定
xtitle(" drawing a rectangle ") //タイトルを追加
show_window(); //ウインドウを最前面に配置

[b,xc,yc]=xclick(); //ポイントを取得
xrect(xc,yc,0,0) //矩形エンティティを描画
r=gce();// 矩形のハンドル
rep=[xc,yc,-1];first=%f;

while rep(3)==-1 do // マウスを移動 ...
  rep=xgetmouse();
  xc1=rep(1);yc1=rep(2);
  ox=min(xc,xc1);
  oy=max(yc,yc1);
  w=abs(xc-xc1);h=abs(yc-yc1);
  r.data=[ox,oy,w,h]; //矩形の原点,幅と高さを変更
  first=%f;
end

作者

S. Steer

<< xclick interaction load_save >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Jan 26 16:25:13 CET 2011