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

Method OnKeyDown

Source/Editor/Windows/EditorWindow.cs:274–305  ·  view source on GitHub ↗

(KeyboardKeys key)

Source from the content-addressed store, hash-verified

272
273 /// <inheritdoc />
274 public override bool OnKeyDown(KeyboardKeys key)
275 {
276 // Prevent closing the editor window when using RMB + Ctrl + W to slow down the camera flight
277 if (Editor.Options.Options.Input.CloseTab.Process(this, key))
278 {
279 if (Root.GetMouseButton(MouseButton.Right))
280 return true;
281 }
282
283 if (base.OnKeyDown(key))
284 return true;
285
286 switch (key)
287 {
288 case KeyboardKeys.Return:
289 if (CanUseNavigation && Root?.FocusedControl != null)
290 {
291 Root.SubmitFocused();
292 return true;
293 }
294 break;
295 case KeyboardKeys.Tab:
296 if (CanUseNavigation && Root != null)
297 {
298 bool shiftDown = Root.GetKey(KeyboardKeys.Shift);
299 Root.Navigate(shiftDown ? NavDirection.Previous : NavDirection.Next);
300 return true;
301 }
302 break;
303 }
304 return false;
305 }
306
307 /// <inheritdoc />
308 public override void OnDestroy()

Callers

nothing calls this directly

Calls 5

SubmitFocusedMethod · 0.80
ProcessMethod · 0.45
GetMouseButtonMethod · 0.45
GetKeyMethod · 0.45
NavigateMethod · 0.45

Tested by

no test coverage detected