diff --git a/src/Application/ProjectionMappingState.cpp b/src/Application/ProjectionMappingState.cpp index eda917b..f65413b 100644 --- a/src/Application/ProjectionMappingState.cpp +++ b/src/Application/ProjectionMappingState.cpp @@ -37,6 +37,20 @@ void ProjectionMappingState::onKeyPressed(Application * app, ofKeyEventArgs & ar app->getOfxPiMapper()->getCmdManager()->exec( new RmSurfaceCmd(app->getOfxPiMapper())); break; + + case 'p': + if(app->getOfxPiMapper()->getSurfaceManager()->getSelectedSurface() == 0){ + break; + } + + if(app->getOfxPiMapper()->getSurfaceManager()->getSelectedSurface()->getType() == + SurfaceType::QUAD_SURFACE){ + + app->getOfxPiMapper()->getCmdManager()->exec( + new TogglePerspectiveCmd( + (QuadSurface *)app->getOfxPiMapper()->getSurfaceManager()->getSelectedSurface() ) ); + } + break; default: break; diff --git a/src/Application/ProjectionMappingState.h b/src/Application/ProjectionMappingState.h index b406a49..1d7ec42 100644 --- a/src/Application/ProjectionMappingState.h +++ b/src/Application/ProjectionMappingState.h @@ -5,6 +5,7 @@ #include "ofLog.h" #include "ofGraphics.h" #include "AddSurfaceCmd.h" +#include "TogglePerspectiveCmd.h" #include "SurfaceType.h" namespace ofx {