public static void Initialize() { UserCommandModifierInput moveSlow = new UserCommandModifierInput(KeyModifiers.Control); UserCommandModifierInput moveFast = new UserCommandModifierInput(KeyModifiers.Shift); UserCommands[UserCommand.PrintScreen] = new UserCommandKeyInput(Keys.PrintScreen, KeyModifiers.None); UserCommands[UserCommand.NewInstance] = new UserCommandKeyInput(Keys.F, KeyModifiers.None); UserCommands[UserCommand.ChangeScreenMode] = new UserCommandKeyInput(Keys.Enter, KeyModifiers.Alt); UserCommands[UserCommand.QuitGame] = new UserCommandKeyInput(Keys.Q, KeyModifiers.None); UserCommands[UserCommand.ResetZoomAndLocation] = new UserCommandKeyInput(Keys.R, KeyModifiers.None); UserCommands[UserCommand.MoveLeft] = new UserCommandModifiableKeyInput(Keys.Left, KeyModifiers.None, moveFast, moveSlow); UserCommands[UserCommand.MoveRight] = new UserCommandModifiableKeyInput(Keys.Right, KeyModifiers.None, moveFast, moveSlow); UserCommands[UserCommand.MoveUp] = new UserCommandModifiableKeyInput(Keys.Up, KeyModifiers.None, moveFast, moveSlow); UserCommands[UserCommand.MoveDown] = new UserCommandModifiableKeyInput(Keys.Down, KeyModifiers.None, moveFast, moveSlow); UserCommands[UserCommand.ZoomIn] = new UserCommandModifiableKeyInput(Keys.PageUp, KeyModifiers.None, moveFast, moveSlow); UserCommands[UserCommand.ZoomOut] = new UserCommandModifiableKeyInput(Keys.PageDown, KeyModifiers.None, moveFast, moveSlow); }
public InputSettings(IEnumerable <string> options, SettingsStore store) : base(SettingsStore.GetSettingsStore(store?.StoreType ?? StoreType.Registry, store.Location, "Keyboard")) { InitializeCommands(UserCommands); LoadSettings(options); UserCommandModifierInput userCommandModifier = UserCommands[UserCommand.DisplayNextWindowTab] as UserCommandModifierInput; WindowTabCommandModifier = (userCommandModifier.Alt ? KeyModifiers.Alt : KeyModifiers.None) | (userCommandModifier.Control ? KeyModifiers.Control : KeyModifiers.None) | (userCommandModifier.Shift ? KeyModifiers.Shift : KeyModifiers.None); userCommandModifier = UserCommands[UserCommand.CameraMoveFast] as UserCommandModifierInput; CameraMoveFastModifier = (userCommandModifier.Alt ? KeyModifiers.Alt : KeyModifiers.None) | (userCommandModifier.Control ? KeyModifiers.Control : KeyModifiers.None) | (userCommandModifier.Shift ? KeyModifiers.Shift : KeyModifiers.None); userCommandModifier = UserCommands[UserCommand.CameraMoveSlow] as UserCommandModifierInput; CameraMoveSlowModifier = (userCommandModifier.Alt ? KeyModifiers.Alt : KeyModifiers.None) | (userCommandModifier.Control ? KeyModifiers.Control : KeyModifiers.None) | (userCommandModifier.Shift ? KeyModifiers.Shift : KeyModifiers.None); userCommandModifier = UserCommands[UserCommand.GameSuspendOldPlayer] as UserCommandModifierInput; GameSuspendOldPlayerModifier = (userCommandModifier.Alt ? KeyModifiers.Alt : KeyModifiers.None) | (userCommandModifier.Control ? KeyModifiers.Control : KeyModifiers.None) | (userCommandModifier.Shift ? KeyModifiers.Shift : KeyModifiers.None); userCommandModifier = UserCommands[UserCommand.GameSwitchWithMouse] as UserCommandModifierInput; GameSwitchWithMouseModifier = (userCommandModifier.Alt ? KeyModifiers.Alt : KeyModifiers.None) | (userCommandModifier.Control ? KeyModifiers.Control : KeyModifiers.None) | (userCommandModifier.Shift ? KeyModifiers.Shift : KeyModifiers.None); }