diff --git a/src/Application/States/TextureMappingState.cpp b/src/Application/States/TextureMappingState.cpp index 3548d9d..af21910 100644 --- a/src/Application/States/TextureMappingState.cpp +++ b/src/Application/States/TextureMappingState.cpp @@ -61,10 +61,33 @@ void TextureMappingState::draw(Application * app){ } void TextureMappingState::onKeyPressed(Application * app, ofKeyEventArgs & args){ - app->getGui()->getTextureEditor()->keyPressed(args); + int key = args.key; + float moveStep; + + if(app->isShiftKeyDown()){ + moveStep = 10.0f; + }else{ + moveStep = 1.0f; + } switch(args.key){ - + + case OF_KEY_LEFT: + app->getGui()->getTextureEditor()->moveSelection(ofVec2f(-moveStep, 0.0f)); + break; + + case OF_KEY_RIGHT: + app->getGui()->getTextureEditor()->moveSelection(ofVec2f(moveStep, 0.0f)); + break; + + case OF_KEY_UP: + app->getGui()->getTextureEditor()->moveSelection(ofVec2f(0.0f, -moveStep)); + break; + + case OF_KEY_DOWN: + app->getGui()->getTextureEditor()->moveSelection(ofVec2f(0.0f, moveStep)); + break; + case '>': app->getCmdManager()->exec( new SelNextTexCoordCmd(app->getGui()->getTextureEditor())); @@ -110,10 +133,6 @@ void TextureMappingState::onKeyPressed(Application * app, ofKeyEventArgs & args) } } -void TextureMappingState::onKeyReleased(Application * app, ofKeyEventArgs & args){ - app->getGui()->getTextureEditor()->keyReleased(args); -} - void TextureMappingState::onBackgroundPressed(Application * app, GuiBackgroundEvent & e){ // Exec the command only if a joint is selected. bool selected = false; diff --git a/src/Application/States/TextureMappingState.h b/src/Application/States/TextureMappingState.h index a78dbb9..275226f 100644 --- a/src/Application/States/TextureMappingState.h +++ b/src/Application/States/TextureMappingState.h @@ -25,7 +25,6 @@ class TextureMappingState : public ApplicationBaseState { void update(Application * app); void draw(Application * app); void onKeyPressed(Application * app, ofKeyEventArgs & args); - void onKeyReleased(Application * app, ofKeyEventArgs & args); void onBackgroundPressed(Application * app, GuiBackgroundEvent & e); void onMousePressed(Application * app, ofMouseEventArgs & args); void onMouseReleased(Application * app, ofMouseEventArgs & args);