MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / OnKeyDown

Method OnKeyDown

Source/Engine/UI/GUI/Common/TextBoxBase.cs:1407–1637  ·  view source on GitHub ↗

(KeyboardKeys key)

Source from the content-addressed store, hash-verified

1405
1406 /// <inheritdoc />
1407 public override bool OnKeyDown(KeyboardKeys key)
1408 {
1409 var window = Root;
1410 bool shiftDown = window.GetKey(KeyboardKeys.Shift);
1411 bool ctrDown = window.GetKey(KeyboardKeys.Control);
1412 KeyDown?.Invoke(key);
1413
1414 // Handle controls that have bindings
1415#if FLAX_EDITOR
1416 InputOptions options = FlaxEditor.Editor.Instance.Options.Options.Input;
1417 if (options.Copy.Process(this))
1418 {
1419 Copy();
1420 return true;
1421 }
1422 else if (options.Paste.Process(this))
1423 {
1424 Paste();
1425 return true;
1426 }
1427 else if (options.Duplicate.Process(this))
1428 {
1429 Duplicate();
1430 return true;
1431 }
1432 else if (options.Cut.Process(this))
1433 {
1434 Cut();
1435 return true;
1436 }
1437 else if (options.SelectAll.Process(this))
1438 {
1439 SelectAll();
1440 return true;
1441 }
1442 else if (options.DeselectAll.Process(this))
1443 {
1444 Deselect();
1445 return true;
1446 }
1447#endif
1448
1449 // Handle controls without bindings
1450 switch (key)
1451 {
1452 case KeyboardKeys.ArrowRight:
1453 MoveRight(shiftDown, ctrDown);
1454 return true;
1455 case KeyboardKeys.ArrowLeft:
1456 MoveLeft(shiftDown, ctrDown);
1457 return true;
1458 case KeyboardKeys.ArrowUp:
1459 MoveUp(shiftDown, ctrDown);
1460 return true;
1461 case KeyboardKeys.ArrowDown:
1462 MoveDown(shiftDown, ctrDown);
1463 return true;
1464 case KeyboardKeys.C:

Callers

nothing calls this directly

Calls 7

GetCharPositionFunction · 0.85
HitTestTextFunction · 0.85
InsertFunction · 0.85
GetKeyMethod · 0.45
ProcessMethod · 0.45
RemoveMethod · 0.45
ClampMethod · 0.45

Tested by

no test coverage detected