ImageGlass.ImageBox.ProcessImageShortcuts C# (CSharp) Method

ProcessImageShortcuts() protected method

Processes shortcut keys for zooming and selection
protected ProcessImageShortcuts ( KeyEventArgs e ) : void
e System.Windows.Forms.KeyEventArgs /// The instance containing the event data. ///
return void
        protected virtual void ProcessImageShortcuts(KeyEventArgs e)
        {
            Point currentPixel;
            int currentZoom;
            Point relativePoint;

            relativePoint = CenterPoint;
            currentPixel = PointToImage(relativePoint);
            currentZoom = Zoom;

            switch (e.KeyCode)
            {
                //case Keys.Home:
                //    if (this.AllowZoom)
                //    {
                //        this.PerformActualSize(ImageBoxActionSources.User);
                //    }
                //    break;

                //case Keys.PageDown:
                case Keys.Oemplus:
                    if (AllowZoom)
                    {
                        PerformZoomIn(ImageBoxActionSources.User, true);
                    }
                    break;

                //case Keys.PageUp:
                case Keys.OemMinus:
                    if (AllowZoom)
                    {
                        PerformZoomOut(ImageBoxActionSources.User, true);
                    }
                    break;
            }

            if (Zoom != currentZoom)
            {
                ScrollTo(currentPixel, relativePoint);
            }
        }
ImageBox