public bool TryHandleInput(IInputEvent args) { if (!(args is IKeyEvent kargs)) { return(false); } if (kargs.ComplexEventType == KeyEventType.Down && kargs.EventKey == Key.Escape) { appModeService.SetMode(AppMode.Editing); return(true); } if (kargs.ComplexEventType == KeyEventType.Down && kargs.EventKey == Key.F) { var layoutInstance = storyService.RootLayoutInstance; var cameraProps = mainLayer.Camera.GetProps(); if (!hasFreeCamera) { if (layoutInstance.AllowsFreeCamera) { mainLayer.Camera = layoutInstance.CreateFreeCamera(cameraProps); hasFreeCamera = true; hasWarpCamera = false; return(true); } } else { var closestNode = layoutInstance.GetClosestNodeId(cameraProps); navigationService.GoToSpecific(closestNode); FocusOn(storyService.GlobalGraph.NodeObjects[closestNode].GetComponent <IFocusNodeComponent>()); hasFreeCamera = false; } } if (kargs.ComplexEventType == KeyEventType.Down && kargs.EventKey == Key.K) { var layoutInstance = storyService.RootLayoutInstance; var cameraProps = mainLayer.Camera.GetProps(); if (!hasWarpCamera) { if (layoutInstance.AllowsFreeCamera) { mainLayer.Camera = layoutInstance.CreateWarpCamera(cameraProps); hasWarpCamera = true; hasFreeCamera = false; return(true); } } else { var closestNode = layoutInstance.GetClosestNodeId(cameraProps); navigationService.GoToSpecific(closestNode); FocusOn(storyService.GlobalGraph.NodeObjects[closestNode].GetComponent <IFocusNodeComponent>()); hasWarpCamera = false; } } return(false); }
private void ExecStartPresentation(object sender, EventArgs eventArgs) { appModeService.SetMode(AppMode.Presentation); }