From 63db26eb35c29bd10a698b992cbdf9f9bf06854c Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Fri, 20 Jan 2017 19:54:26 +0200 Subject: [PATCH] Add custom mode switch shortcuts --- example-custom-shortcuts/src/ofApp.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/example-custom-shortcuts/src/ofApp.cpp b/example-custom-shortcuts/src/ofApp.cpp index 6d36efc..5daa820 100644 --- a/example-custom-shortcuts/src/ofApp.cpp +++ b/example-custom-shortcuts/src/ofApp.cpp @@ -14,7 +14,17 @@ void ofApp::draw(){ } void ofApp::keyPressed(int key){ - mapper.keyPressed(key); + if(key == '1'){ + mapper.setMode(ofxPiMapper::PRESENTATION_MODE); + }else if(key == '2'){ + mapper.setMode(ofxPiMapper::MAPPING_MODE); + }else if(key == '3'){ + mapper.setMode(ofxPiMapper::TEXTURE_MODE); + }else if(key == '4'){ + mapper.setMode(ofxPiMapper::SOURCE_MODE); + }else{ + mapper.keyPressed(key); + } } void ofApp::keyReleased(int key){