ofApp.cpp
void ofApp::mousePressed(ofMouseEventArgs &mouse) {
switch (mouse.button) {
case 0:
ofLog() << "左クリック";
break;
case 1:
ofLog() << "中クリック";
break;
case 2:
ofLog() << "右クリック";
break;
default:
break;
}
}
mouse.button
の中に入っている値で判別する。
もしくは void ofApp::mousePressed(int x, int y, int button)
の button
の値
マウスの中ボタンのクリックも取得できた。