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

Method OnKeyDown

Source/Editor/GUI/Dialogs/Dialog.cs:281–306  ·  view source on GitHub ↗

(KeyboardKeys key)

Source from the content-addressed store, hash-verified

279
280 /// <inheritdoc />
281 public override bool OnKeyDown(KeyboardKeys key)
282 {
283 if (base.OnKeyDown(key))
284 return true;
285
286 switch (key)
287 {
288 case KeyboardKeys.Return:
289 if (Root?.FocusedControl != null)
290 Root.SubmitFocused();
291 else
292 OnSubmit();
293 return true;
294 case KeyboardKeys.Escape:
295 OnCancel();
296 return true;
297 case KeyboardKeys.Tab:
298 if (Root != null)
299 {
300 bool shiftDown = Root.GetKey(KeyboardKeys.Shift);
301 Root.Navigate(shiftDown ? NavDirection.Previous : NavDirection.Next);
302 }
303 return true;
304 }
305 return false;
306 }
307 }
308}

Callers

nothing calls this directly

Calls 3

SubmitFocusedMethod · 0.80
GetKeyMethod · 0.45
NavigateMethod · 0.45

Tested by

no test coverage detected