diff options
| author | Tim Redfern <tim@getdrop.com> | 2017-12-17 16:14:27 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2017-12-17 16:14:27 +0000 |
| commit | b470c73bfc271c032f4df9a3fd1b9770cf627f00 (patch) | |
| tree | 9f1a716eab400c7e329afcb7b428d50b19c48e61 /gui/src/ofApp.cpp | |
| parent | 3418dd0859106791d5534c53b901c2be4ea6b4c4 (diff) | |
select images
Diffstat (limited to 'gui/src/ofApp.cpp')
| -rw-r--r-- | gui/src/ofApp.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/gui/src/ofApp.cpp b/gui/src/ofApp.cpp index 43f51f1..cbfb139 100644 --- a/gui/src/ofApp.cpp +++ b/gui/src/ofApp.cpp @@ -41,6 +41,8 @@ void ofApp::setup(){ sets[0].init(); sets[1].init(); + + commandPressed=false; } //-------------------------------------------------------------- @@ -256,6 +258,11 @@ void ofApp::newMidiMessage(ofxMidiMessage& msg) { //-------------------------------------------------------------- void ofApp::keyPressed(ofKeyEventArgs &args){ + + if (args.key==OF_KEY_COMMAND){ + commandPressed=true; + } + sets[selected_set].keyPressed(args); if(args.key == '\''){ @@ -293,7 +300,9 @@ void ofApp::outputKeyPressed(ofKeyEventArgs &args){ //-------------------------------------------------------------- void ofApp::keyReleased(int key){ - + if (key==OF_KEY_COMMAND){ + commandPressed=false; + } } //-------------------------------------------------------------- @@ -308,7 +317,17 @@ void ofApp::mouseDragged(int x, int y, int button){ //-------------------------------------------------------------- void ofApp::mousePressed(int x, int y, int button){ - sets[selected_set].mousePressed(x,y,button); + if (commandPressed){ + if (y<200){ + sets[0].mousePressed(x,y,OF_MOUSE_BUTTON_4); + } + else { + sets[1].mousePressed(x,y,OF_MOUSE_BUTTON_4); + } + } + else { + sets[selected_set].mousePressed(x,y,button); + } } //-------------------------------------------------------------- |
