/[EmuXPortal]/trunk/EmuXPortal/Form1.cs
ViewVC logotype

Diff of /trunk/EmuXPortal/Form1.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/EmuXPortal/Form1.cs	2014/08/04 07:08:29	179
+++ trunk/EmuXPortal/Form1.cs	2014/08/04 07:31:53	180
@@ -52,6 +52,36 @@
 
             int changeAmount = 0;
             int currentPosition = 0;
+            if (e.KeyCode == Keys.Up)
+            {
+                int index = 0;
+                var ctl = game_ctrl_get_selected(out index);
+                if (index == 0)
+                {
+                    rom_flow.Controls[index].Select();
+                    rom_flow.ScrollControlIntoView(rom_flow.Controls[index]);
+                }
+                else
+                {
+                    rom_flow.Controls[index].Select();
+                    rom_flow.ScrollControlIntoView(rom_flow.Controls[index]);
+                }
+            }
+            if (e.KeyCode == Keys.Down)
+            {
+                int index = 0;
+                var ctl = game_ctrl_get_selected(out index);
+                if (index == rom_flow.Controls.Count)
+                {
+                    rom_flow.Controls[0].Select();
+                    rom_flow.ScrollControlIntoView(rom_flow.Controls[0]);
+                }
+                else
+                {
+                    rom_flow.Controls[index].Select();
+                    rom_flow.ScrollControlIntoView(rom_flow.Controls[index]);
+                }
+            }
 
             if (e.KeyCode == Keys.F && e.Modifiers.HasFlag(Keys.Control))
             {
@@ -238,6 +268,36 @@
             PlatformControl c = sender as PlatformControl;
             int changeAmount = 0;
             int currentPosition = 0;
+            if (e.KeyCode == Keys.Up)
+            {
+                int index = 0;
+                var ctl = platform_ctrl_get_selected(out index);
+                if (index == 0)
+                {
+                    platform_flow.Controls[index].Select();
+                    platform_flow.ScrollControlIntoView(platform_flow.Controls[index]);
+                }
+                else
+                {
+                    platform_flow.Controls[index].Select();
+                    platform_flow.ScrollControlIntoView(platform_flow.Controls[index]);
+                }
+            }
+            if (e.KeyCode == Keys.Down)
+            {
+                int index = 0;
+                var ctl = platform_ctrl_get_selected(out index);
+                if (index == platform_flow.Controls.Count)
+                {
+                    platform_flow.Controls[0].Select();
+                    platform_flow.ScrollControlIntoView(platform_flow.Controls[0]);
+                }
+                else
+                {
+                    platform_flow.Controls[index ].Select();
+                    platform_flow.ScrollControlIntoView(platform_flow.Controls[index]);
+                }
+            }
             if (e.KeyCode == Keys.Home)
             {
                 platform_flow.Controls[0].Select();
@@ -250,8 +310,6 @@
             }
             if (e.KeyCode == Keys.PageUp)
             {
-
-
                 changeAmount = platform_flow.VerticalScroll.LargeChange;
                 currentPosition = platform_flow.VerticalScroll.Value;
                 if ((currentPosition - changeAmount) > platform_flow.VerticalScroll.Minimum)
@@ -268,7 +326,7 @@
                 platform_flow.PerformLayout();
             }
             if (e.KeyCode == Keys.PageDown)
-            {
+            {              
                 changeAmount = platform_flow.VerticalScroll.LargeChange;
                 currentPosition = platform_flow.VerticalScroll.Value;
                 if ((currentPosition - changeAmount) < platform_flow.VerticalScroll.Maximum)
@@ -387,6 +445,16 @@
             }
             return s;
         }
+        private GameControl game_ctrl_get_selected(out int index)
+        {
+            index = rom_flow.Controls.IndexOf(CurrentGameControl);
+            return CurrentGameControl;
+        }
+        private PlatformControl platform_ctrl_get_selected(out int index)
+        {
+            index = platform_flow.Controls.IndexOf(CurrentPlatformControl);
+            return CurrentPlatformControl;
+        }
         private PlatformControl platform_ctrl_get_last_visible()
         {
             PlatformControl s = new PlatformControl();

 

  ViewVC Help
Powered by ViewVC 1.1.22