Browse Source

Exec `MvSelectionCmd` on arrow keypresses

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

34
src/Application/ProjectionMappingState.cpp

@ -18,7 +18,7 @@ void ProjectionMappingState::draw(Application * app){
void ProjectionMappingState::onKeyPressed(Application * app, ofKeyEventArgs & args){
switch(args.key){
case 't':
app->getCmdManager()->exec(
new AddSurfaceCmd(
@ -136,6 +136,38 @@ void ProjectionMappingState::onKeyPressed(Application * app, ofKeyEventArgs & ar
case '<':
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