Browse Source

Exec `MvSelectionCmd` on arrow keypresses

master
Krisjanis Rijnieks 9 years ago
parent
commit
07232410b5
  1. 32
      src/Application/ProjectionMappingState.cpp
  2. 1
      src/Application/ProjectionMappingState.h

32
src/Application/ProjectionMappingState.cpp

@ -137,6 +137,38 @@ void ProjectionMappingState::onKeyPressed(Application * app, ofKeyEventArgs & ar
app->getCmdManager()->exec(new SelPrevVertexCmd(app->getSurfaceManager()));
break;
case OF_KEY_UP:
if(app->isShiftKeyDown()){
app->getCmdManager()->exec(new MvSelectionCmd(app->getSurfaceManager(), ofVec2f(0.0f, -10.0f)));
}else{
app->getCmdManager()->exec(new MvSelectionCmd(app->getSurfaceManager(), ofVec2f(0.0f, -1.0f)));
}
break;
case OF_KEY_DOWN:
if(app->isShiftKeyDown()){
app->getCmdManager()->exec(new MvSelectionCmd(app->getSurfaceManager(), ofVec2f(0.0f, 10.0f)));
}else{
app->getCmdManager()->exec(new MvSelectionCmd(app->getSurfaceManager(), ofVec2f(0.0f, 1.0f)));
}
break;
case OF_KEY_LEFT:
if(app->isShiftKeyDown()){
app->getCmdManager()->exec(new MvSelectionCmd(app->getSurfaceManager(), ofVec2f(-10.0f, 0.0f)));
}else{
app->getCmdManager()->exec(new MvSelectionCmd(app->getSurfaceManager(), ofVec2f(-1.0f, 0.0f)));
}
break;
case OF_KEY_RIGHT:
if(app->isShiftKeyDown()){
app->getCmdManager()->exec(new MvSelectionCmd(app->getSurfaceManager(), ofVec2f(10.0f, 0.0f)));
}else{
app->getCmdManager()->exec(new MvSelectionCmd(app->getSurfaceManager(), ofVec2f(1.0f, 0.0f)));
}
break;
default:
break;
}

1
src/Application/ProjectionMappingState.h

@ -14,6 +14,7 @@
#include "SelPrevSurfaceCmd.h"
#include "SelNextVertexCmd.h"
#include "SelPrevVertexCmd.h"
#include "MvSelectionCmd.h"
#include "TogglePerspectiveCmd.h"
#include "SurfaceType.h"

Loading…
Cancel
Save