LoginSignup
1
0

More than 3 years have passed since last update.

openFrameworksで右クリックを判別する方法

Posted at
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 の値

マウスの中ボタンのクリックも取得できた。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0