From 293c859ef1f9c7ac1bcda57c74d2ef9bfec428fe Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Sun, 22 Jan 2017 12:28:29 +0200 Subject: [PATCH] Add custom left, right, up, down moveSelection values --- example-custom-shortcuts/src/ofApp.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/example-custom-shortcuts/src/ofApp.cpp b/example-custom-shortcuts/src/ofApp.cpp index 212a312..3b58649 100644 --- a/example-custom-shortcuts/src/ofApp.cpp +++ b/example-custom-shortcuts/src/ofApp.cpp @@ -32,6 +32,14 @@ void ofApp::keyPressed(int key){ mapper.createSurface(ofx::piMapper::TRIANGLE_SURFACE); }else if(key == OF_KEY_BACKSPACE){ mapper.eraseSurface(mapper.getNumSurfaces() - 1); + }else if(key == OF_KEY_LEFT){ + mapper.moveSelection(ofVec2f(-20.0f, 0.0f)); + }else if(key == OF_KEY_RIGHT){ + mapper.moveSelection(ofVec2f(20.0f, 0.0f)); + }else if(key == OF_KEY_UP){ + mapper.moveSelection(ofVec2f(0.0f, -20.0f)); + }else if(key == OF_KEY_DOWN){ + mapper.moveSelection(ofVec2f(0.0f, 20.0f)); }else{ mapper.keyPressed(key); }