mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
can key focus
This commit is contained in:
parent
daa0cfef3a
commit
b2095db575
4 changed files with 70 additions and 6 deletions
|
|
@ -58,6 +58,7 @@ GuiShaderEditor::GuiShaderEditor()
|
|||
|
||||
// test
|
||||
mCurrNodes.push_back(new ShaderNode());
|
||||
mCurrNodes.push_back(new ShaderNode());
|
||||
}
|
||||
|
||||
bool GuiShaderEditor::onWake()
|
||||
|
|
@ -191,6 +192,22 @@ void GuiShaderEditor::onRender(Point2I offset, const RectI& updateRect)
|
|||
|
||||
bool GuiShaderEditor::onKeyDown(const GuiEvent& event)
|
||||
{
|
||||
if (!mActive)
|
||||
return Parent::onKeyDown(event);
|
||||
|
||||
if (!(event.modifier & SI_PRIMARY_CTRL))
|
||||
{
|
||||
switch (event.keyCode)
|
||||
{
|
||||
case KEY_BACKSPACE:
|
||||
case KEY_DELETE:
|
||||
deleteSelection();
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -367,7 +384,7 @@ void GuiShaderEditor::onMiddleMouseDown(const GuiEvent& event)
|
|||
mLastMousePos = globalToLocalCoord(event.mousePoint);
|
||||
|
||||
setMouseMode(DragPanning);
|
||||
|
||||
getRoot()->showCursor(false);
|
||||
}
|
||||
|
||||
void GuiShaderEditor::onMiddleMouseUp(const GuiEvent& event)
|
||||
|
|
@ -378,6 +395,8 @@ void GuiShaderEditor::onMiddleMouseUp(const GuiEvent& event)
|
|||
return;
|
||||
}
|
||||
|
||||
getRoot()->showCursor(true);
|
||||
|
||||
//unlock the mouse
|
||||
mouseUnlock();
|
||||
|
||||
|
|
@ -471,6 +490,10 @@ void GuiShaderEditor::deleteSelection()
|
|||
for (ShaderNode* node : mSelectedNodes)
|
||||
{
|
||||
mTrash->addObject(node);
|
||||
|
||||
Vector< ShaderNode* >::iterator i = T3D::find(mCurrNodes.begin(), mCurrNodes.end(), node);
|
||||
if (i != mCurrNodes.end())
|
||||
mCurrNodes.erase(i);
|
||||
}
|
||||
|
||||
clearSelection();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue