From b470c73bfc271c032f4df9a3fd1b9770cf627f00 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Sun, 17 Dec 2017 16:14:27 +0000 Subject: select images --- gui/src/ofApp.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'gui/src/ofApp.cpp') 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); + } } //-------------------------------------------------------------- -- cgit v1.2.3