protected static void RegisterGlobalKeyBindings() { IInputManager inputManager = ServiceRegistration.Get <IInputManager>(); inputManager.AddKeyBinding(Key.Escape, () => { // Close dialog or switch to previous workflow state IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>(); if (screenManager.IsDialogVisible) { screenManager.CloseTopmostDialog(); } else { ServiceRegistration.Get <IWorkflowManager>().NavigatePop(1); } }); inputManager.AddKeyBinding(Key.Fullscreen, () => { //switch to fullscreen IScreenControl sc = ServiceRegistration.Get <IScreenControl>(); int nextMode = ((int)sc.CurrentScreenMode) + 1; int totalModes = Enum.GetNames(typeof(ScreenMode)).Length; ScreenMode newMode = (ScreenMode)(nextMode % totalModes); ServiceRegistration.Get <ILogger>().Info("SkinEngine: Switching screen mode from current '{0}' to '{1}'", sc.CurrentScreenMode, newMode); sc.SwitchMode(newMode); }); }
public void RegisterKeyActions() { IInputManager inputManager = ServiceRegistration.Get <IInputManager>(); inputManager.AddKeyBinding(Consts.LOAD_SKIN_KEY, new VoidKeyActionDlgt(LoadSkinThemeModel.ShowLoadSkinDialog)); inputManager.AddKeyBinding(Consts.LOAD_THEME_KEY, new VoidKeyActionDlgt(LoadSkinThemeModel.ShowLoadThemeDialog)); }
public void RegisterKeyActions() { IInputManager inputManager = ServiceRegistration.Get <IInputManager>(); inputManager.AddKeyBinding(Consts.RELOAD_SCREEN_KEY, new VoidKeyActionDlgt(ReloadScreenAction)); inputManager.AddKeyBinding(Consts.RELOAD_THEME_KEY, new VoidKeyActionDlgt(ReloadThemeAction)); inputManager.AddKeyBinding(Consts.SAVE_SKIN_AND_THEME_KEY, new VoidKeyActionDlgt(SaveSkinAndThemeAction)); }
private void RegisterKeyBindings() { IInputManager manager = ServiceRegistration.Get <IInputManager>(false); if (manager != null) { Log("Registering KeyBindings on IInputManager"); manager.AddKeyBinding(Key.F10, new VoidKeyActionDlgt(ToggleStatsRendering)); manager.AddKeyBinding(Key.F11, new VoidKeyActionDlgt(ToggleRenderMode)); } }
protected void AddKeyBinding_NeedLock(Key key, VoidKeyActionDlgt action) { _registeredKeyBindings.Add(key); IInputManager inputManager = ServiceRegistration.Get <IInputManager>(); inputManager.AddKeyBinding(key, action); }
protected static void RegisterGlobalKeyBindings() { IInputManager inputManager = ServiceRegistration.Get <IInputManager>(); inputManager.AddKeyBinding(Key.Escape, () => { // Close dialog or switch to previous workflow state IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>(); if (screenManager.IsDialogVisible) { screenManager.CloseTopmostDialog(); } else { ServiceRegistration.Get <IWorkflowManager>().NavigatePop(1); } }); inputManager.AddKeyBinding(Key.Fullscreen, () => { //switch to fullscreen IScreenControl sc = ServiceRegistration.Get <IScreenControl>(); sc.SwitchMode(sc.IsFullScreen ? ScreenMode.NormalWindowed : ScreenMode.FullScreen); }); }
private void RegisterKeyBindings() { IInputManager manager = ServiceRegistration.Get <IInputManager>(false); if (manager != null) { if (settings.OnOffButton == 1) { manager.AddKeyBinding(Key.Red, new VoidKeyActionDlgt(ToggleEffectOnOff)); } else if (settings.OnOffButton == 2) { manager.AddKeyBinding(Key.Green, new VoidKeyActionDlgt(ToggleEffectOnOff)); } else if (settings.OnOffButton == 3) { manager.AddKeyBinding(Key.Yellow, new VoidKeyActionDlgt(ToggleEffectOnOff)); } else if (settings.OnOffButton == 4) { manager.AddKeyBinding(Key.Blue, new VoidKeyActionDlgt(ToggleEffectOnOff)); } if (settings.ProfileButton == 1) { manager.AddKeyBinding(Key.Red, new VoidKeyActionDlgt(ChangeAtmoWinProfile)); } else if (settings.ProfileButton == 2) { manager.AddKeyBinding(Key.Green, new VoidKeyActionDlgt(ChangeAtmoWinProfile)); } else if (settings.ProfileButton == 3) { manager.AddKeyBinding(Key.Yellow, new VoidKeyActionDlgt(ChangeAtmoWinProfile)); } else if (settings.ProfileButton == 4) { manager.AddKeyBinding(Key.Blue, new VoidKeyActionDlgt(ChangeAtmoWinProfile)); } } }