private void Global_KeyUp(CoreWindow sender, KeyEventArgs args) { robot.KeyActionHandlerAsync(sender, args, MrF83RobotUwp.KeyStatus.released); if (args.KeyStatus.IsKeyReleased) { switch (args.VirtualKey) { case VirtualKey.Control: IsCtlKeyPressed = false; ISOSlider.FixShootingParam(); EvSlider.FixShootingParam(); FnumberSlider.FixShootingParam(); SSSlider.FixShootingParam(); ProgramShiftSlider.ReleaseSlider(); break; case VirtualKey.Shift: IsShiftKeyPressed = false; if (IsBarRightOn) { IsBarRightOn = false; if (ZoomElements.Visibility.IsVisible()) { ZoomInStop(); } } else if (IsBarLeftOn) { IsBarLeftOn = false; if (ZoomElements.Visibility.IsVisible()) { ZoomOutStop(); } } break; } } }
private async void Global_KeyDown(CoreWindow sender, KeyEventArgs args) { robot.KeyActionHandlerAsync(sender, args, MrF83RobotUwp.KeyStatus.pressed); if (args.KeyStatus.RepeatCount == 1) { switch (args.VirtualKey) { case VirtualKey.Control: IsCtlKeyPressed = true; break; case VirtualKey.Shift: IsShiftKeyPressed = true; break; case VirtualKey.Space: ShutterButtonPressed(); break; case VirtualKey.Right: if (IsCtlKeyPressed) { if (ZoomElements.Visibility.IsVisible()) { if (!IsBarRightOn) { if (IsShiftKeyPressed) { IsBarRightOn = true; ZoomInStart(); } else { ZoomInTick(); } } } else if (ISOSlider.Visibility.IsVisible()) { ISOSlider.TickSlider(1); } else if (EvSlider.Visibility.IsVisible()) { EvSlider.TickSlider(1); } else if (FnumberSlider.Visibility.IsVisible()) { FnumberSlider.TickSlider(1); } else if (SSSlider.Visibility.IsVisible()) { SSSlider.TickSlider(1); } else if (ProgramShiftSlider.Visibility.IsVisible()) { ProgramShiftSlider.TickSlider(1); } } break; case VirtualKey.Left: if (IsCtlKeyPressed) { if (ZoomElements.Visibility.IsVisible()) { if (!IsBarLeftOn) { if (IsShiftKeyPressed) { IsBarLeftOn = true; ZoomOutStart(); } else { ZoomOutTick(); } } } else if (ISOSlider.Visibility.IsVisible()) { ISOSlider.TickSlider(-1); } else if (EvSlider.Visibility.IsVisible()) { EvSlider.TickSlider(-1); } else if (FnumberSlider.Visibility.IsVisible()) { FnumberSlider.TickSlider(-1); } else if (SSSlider.Visibility.IsVisible()) { SSSlider.TickSlider(-1); } else if (ProgramShiftSlider.Visibility.IsVisible()) { ProgramShiftSlider.TickSlider(-1); } } break; case VirtualKey.Up: if (IsCtlKeyPressed && !AppBarUnit.IsOpen) { AppBarUnit.IsOpen = true; args.Handled = true; } break; case VirtualKey.Down: if (IsCtlKeyPressed && AppBarUnit.IsOpen) { AppBarUnit.IsOpen = false; args.Handled = true; } break; case VirtualKey.Z: if (IsCtlKeyPressed) { if (ScreenViewData.IsZoomAvailable) { _CommandBarManager.FireTapEvent(AppBarItem.Zoom, this); } args.Handled = true; } break; case VirtualKey.I: if (IsCtlKeyPressed) { if (ScreenViewData.IsSetIsoSpeedRateAvailable) { _CommandBarManager.FireTapEvent(AppBarItem.IsoSlider, this); } args.Handled = true; } break; case VirtualKey.E: if (IsCtlKeyPressed) { if (ScreenViewData.IsSetEVAvailable) { _CommandBarManager.FireTapEvent(AppBarItem.EvSlider, this); } args.Handled = true; } break; case VirtualKey.F: if (IsCtlKeyPressed) { if (ScreenViewData.IsSetFNumberAvailable) { _CommandBarManager.FireTapEvent(AppBarItem.FNumberSlider, this); } args.Handled = true; } break; case VirtualKey.S: if (IsCtlKeyPressed) { if (ScreenViewData.IsSetShutterSpeedAvailable) { _CommandBarManager.FireTapEvent(AppBarItem.ShutterSpeedSlider, this); } args.Handled = true; } break; case VirtualKey.P: if (IsCtlKeyPressed) { if (ScreenViewData.IsProgramShiftAvailable) { _CommandBarManager.FireTapEvent(AppBarItem.ProgramShiftSlider, this); } args.Handled = true; } break; case VirtualKey.C: if (IsCtlKeyPressed) { if (_CommandBarManager.IsEnabled(AppBarItemType.Command, AppBarItem.CancelTouchAF)) { _CommandBarManager.FireTapEvent(AppBarItem.CancelTouchAF, this); } args.Handled = true; } break; case VirtualKey.M: if (IsCtlKeyPressed) { await SequentialOperation.ToggleExposureMode(this.target); args.Handled = true; } break; case VirtualKey.Q: if (IsCtlKeyPressed) { ToggleControlPanel(); } break; } } }