Processing (BETA) version 135+ のリファレンスです。
旧バージョン使用者はソフトウェア内のリファレンスを参照してください。
この文書は Processing のAPIリファレンスを日本語に訳したものです。
最新の内容は 英語版 で確認して下さい。
| Name | mouseButton |
||
|---|---|---|---|
| Examples | // Click within the image and press
// the left and right mouse buttons to
// change the value of the rectangle
void draw() {
if (mousePressed && (mouseButton == LEFT)) {
fill(0);
} else if (mousePressed && (mouseButton == RIGHT)) {
fill(255);
} else {
fill(126);
}
rect(25, 25, 50, 50);
}// Click within the image and press
// the left and right mouse buttons to
// change the value of the rectangle
void draw() {
rect(25, 25, 50, 50);
}
void mousePressed() {
if (mouseButton == LEFT) {
fill(0);
} else if (mouseButton == RIGHT) {
fill(255);
} else {
fill(126);
}
} |
||
| Description | Processing ではマウスボタンが押された場合、どのボタンが押されたかを自動的に追跡します。 システム変数である mouseButton の値は、押されたボタンにより LEFT, RIGHT, CENTER のどれかになります。 | ||
| Parameters | |||
| Usage | Web & Application | ||
| Related | mouseX mouseY mousePressed() mouseReleased() mouseMoved() mouseDragged() |
この文書の原文はクリエイティブ・コモンズ(Creative Commons)のAttribution-Noncommercial-Share Alike(表示・非営利・継承) ライセンスで公開されています。
このライセンスは同一の許諾条件の下で原作者のクレジットを表示し、また作品を営利目的で利用しなければ、作品に対して複製、頒布、展示、実演、二次的著作物の作成が行えることを示します。
© 2007 Processing.org
© 2007 Processing.org

