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

Method onKeyDown

Engine/source/gui/containers/guiWindowCtrl.cpp:1262–1298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1260}
1261
1262bool GuiWindowCtrl::onKeyDown(const GuiEvent &event)
1263{
1264 // If this control is a dead end, kill the event
1265 if ((! mVisible) || (! mActive) || (! mAwake)) return true;
1266
1267 if ((event.keyCode == KEY_TAB) && (event.modifier & SI_PRIMARY_CTRL))
1268 {
1269 // Find the next sibling window, and select it
1270 GuiControl *parent = getParent();
1271 if (parent)
1272 {
1273 GuiWindowCtrl *firstWindow = NULL;
1274 iterator i;
1275 for (i = parent->begin(); i != parent->end(); i++)
1276 {
1277 GuiWindowCtrl *ctrl = dynamic_cast<GuiWindowCtrl *>(*i);
1278 if (ctrl && ctrl->getTabIndex() == mTabIndex + 1)
1279 {
1280 ctrl->selectWindow();
1281 return true;
1282 }
1283 else if (ctrl && ctrl->getTabIndex() == 0)
1284 {
1285 firstWindow = ctrl;
1286 }
1287 }
1288 // Recycle from the beginning
1289 if (firstWindow != this)
1290 {
1291 firstWindow->selectWindow();
1292 return true;
1293 }
1294 }
1295 }
1296
1297 return Parent::onKeyDown(event);
1298}
1299
1300//-----------------------------------------------------------------------------
1301

Callers

nothing calls this directly

Calls 3

beginMethod · 0.45
endMethod · 0.45
selectWindowMethod · 0.45

Tested by

no test coverage detected