Browse Source

Add custom left, right, up, down moveSelection values

master
Krisjanis Rijnieks 8 years ago
parent
commit
293c859ef1
  1. 8
      example-custom-shortcuts/src/ofApp.cpp

8
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);
}

Loading…
Cancel
Save