diff --git a/src/Application/States/TextureMappingState.cpp b/src/Application/States/TextureMappingState.cpp index cc62a3d..3548d9d 100644 --- a/src/Application/States/TextureMappingState.cpp +++ b/src/Application/States/TextureMappingState.cpp @@ -61,6 +61,8 @@ void TextureMappingState::draw(Application * app){ } void TextureMappingState::onKeyPressed(Application * app, ofKeyEventArgs & args){ + app->getGui()->getTextureEditor()->keyPressed(args); + switch(args.key){ case '>': @@ -108,6 +110,10 @@ 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 275226f..a78dbb9 100644 --- a/src/Application/States/TextureMappingState.h +++ b/src/Application/States/TextureMappingState.h @@ -25,6 +25,7 @@ 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); diff --git a/src/UserInterface/TextureEditor.cpp b/src/UserInterface/TextureEditor.cpp index 9e2b608..ae9b968 100644 --- a/src/UserInterface/TextureEditor.cpp +++ b/src/UserInterface/TextureEditor.cpp @@ -14,13 +14,13 @@ TextureEditor::~TextureEditor(){ } void TextureEditor::registerKeyEvents(){ - ofAddListener(ofEvents().keyPressed, this, &TextureEditor::keyPressed); - ofAddListener(ofEvents().keyReleased, this, &TextureEditor::keyReleased); + //ofAddListener(ofEvents().keyPressed, this, &TextureEditor::keyPressed); + //ofAddListener(ofEvents().keyReleased, this, &TextureEditor::keyReleased); } void TextureEditor::unregisterKeyEvents(){ - ofRemoveListener(ofEvents().keyPressed, this, &TextureEditor::keyPressed); - ofRemoveListener(ofEvents().keyReleased, this, &TextureEditor::keyReleased); + //ofRemoveListener(ofEvents().keyPressed, this, &TextureEditor::keyPressed); + //ofRemoveListener(ofEvents().keyReleased, this, &TextureEditor::keyReleased); } void TextureEditor::enable(){