MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / onKeyDown

Method onKeyDown

Engine/source/gui/containers/guiWindowCtrl.cpp:1234–1270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1232}
1233
1234bool GuiWindowCtrl::onKeyDown(const GuiEvent &event)
1235{
1236 // If this control is a dead end, kill the event
1237 if ((! mVisible) || (! mActive) || (! mAwake)) return true;
1238
1239 if ((event.keyCode == KEY_TAB) && (event.modifier & SI_PRIMARY_CTRL))
1240 {
1241 // Find the next sibling window, and select it
1242 GuiControl *parent = getParent();
1243 if (parent)
1244 {
1245 GuiWindowCtrl *firstWindow = NULL;
1246 iterator i;
1247 for (i = parent->begin(); i != parent->end(); i++)
1248 {
1249 GuiWindowCtrl *ctrl = dynamic_cast<GuiWindowCtrl *>(*i);
1250 if (ctrl && ctrl->getTabIndex() == mTabIndex + 1)
1251 {
1252 ctrl->selectWindow();
1253 return true;
1254 }
1255 else if (ctrl && ctrl->getTabIndex() == 0)
1256 {
1257 firstWindow = ctrl;
1258 }
1259 }
1260 // Recycle from the beginning
1261 if (firstWindow != this)
1262 {
1263 firstWindow->selectWindow();
1264 return true;
1265 }
1266 }
1267 }
1268
1269 return Parent::onKeyDown(event);
1270}
1271
1272//-----------------------------------------------------------------------------
1273

Callers

nothing calls this directly

Calls 3

beginMethod · 0.45
endMethod · 0.45
selectWindowMethod · 0.45

Tested by

no test coverage detected