Skip to content

Commit

Permalink
remove shortkeys from shortkey_to_tool_map_
Browse files Browse the repository at this point in the history
this should fix ros-visualization#880
  • Loading branch information
hdeeken committed Aug 6, 2015
1 parent 9d0d4aa commit 58e0249
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/rviz/tool_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ void ToolManager::handleChar( QKeyEvent* event, RenderPanel* panel )
}

// check if the incoming key triggers the activation of another tool
Tool* tool = shortkey_to_tool_map_[ event->key() ];
Tool* tool = NULL;
if( shortkey_to_tool_map_.find(event->key()) != shortkey_to_tool_map_.end() )
{
tool = shortkey_to_tool_map_[ event->key() ];
}

if( tool )
{
// if there is a incoming tool check if it matches the current tool
Expand Down Expand Up @@ -277,7 +282,14 @@ void ToolManager::removeTool( int index )
{
setDefaultTool( fallback );
}

Q_EMIT toolRemoved( tool );

uint key;
if( toKey( QString( tool->getShortcutKey() ), key ) )
{
shortkey_to_tool_map_.erase( key );
}
delete tool;
Q_EMIT configChanged();
}
Expand Down

0 comments on commit 58e0249

Please sign in to comment.