Пример #1
0
        private static PadSchema Controller()
        {
            return(new PadSchema
            {
                Size = new Size(440, 260),
                Buttons = new PadSchemaControl[]
                {
                    ButtonSchema.Up(14, 79),
                    ButtonSchema.Down(14, 122),
                    ButtonSchema.Left(2, 100),
                    ButtonSchema.Right(24, 100),
                    new ButtonSchema(2, 10, "L"),
                    new ButtonSchema(366, 10, "R"),
                    new ButtonSchema(341, 179, "Start"),
                    new ButtonSchema(341, 201, "Select"),
                    new ButtonSchema(341, 100, "Y"),
                    new ButtonSchema(365, 113, "B"),
                    new ButtonSchema(341, 76, "X"),
                    new ButtonSchema(366, 86, "A"),

                    // Screen
                    new TargetedPairSchema(72, 35, "Touch X")
                    {
                        TargetSize = new Size(256, 192)
                    },
                    new ButtonSchema(72, 10, "Touch")
                }
            });
        }
Пример #2
0
 private static PadSchema StandardController()
 {
     return(new PadSchema
     {
         Size = new Size(222, 103),
         Buttons = new[]
         {
             ButtonSchema.Up(14, 36, "P1 L_Up"),
             ButtonSchema.Down(14, 80, "P1 L_Down"),
             ButtonSchema.Left(2, 58, "P1 L_Left"),
             ButtonSchema.Right(24, 58, "P1 L_Right"),
             new ButtonSchema(122, 58, 1, "B"),
             new ButtonSchema(146, 58, 1, "A"),
             new ButtonSchema(52, 58, 1, "Select")
             {
                 DisplayName = "s"
             },
             new ButtonSchema(74, 58, 1, "Start")
             {
                 DisplayName = "S"
             },
             ButtonSchema.Up(188, 36, "P1 R_Up"),
             ButtonSchema.Down(188, 80, "P1 R_Down"),
             ButtonSchema.Left(176, 58, "P1 R_Left"),
             ButtonSchema.Right(198, 58, "P1 R_Right"),
             new ButtonSchema(24, 8, 1, "L"),
             new ButtonSchema(176, 8, 1, "R")
         }
     });
 }
Пример #3
0
 private static PadSchema StandardController()
 {
     return(new PadSchema
     {
         Size = new Size(194, 90),
         Buttons = new[]
         {
             ButtonSchema.Up(29, 17),
             ButtonSchema.Down(29, 61),
             ButtonSchema.Left(17, 39),
             ButtonSchema.Right(39, 39),
             new ButtonSchema(130, 39, "B"),
             new ButtonSchema(154, 39, "A"),
             new ButtonSchema(64, 39, "Select")
             {
                 DisplayName = "s"
             },
             new ButtonSchema(86, 39, "Start")
             {
                 DisplayName = "S"
             },
             new ButtonSchema(2, 12, "L"),
             new ButtonSchema(166, 12, "R")
         }
     });
 }
Пример #4
0
 private static PadSchema Wheel(int controller)
 {
     return(new PadSchema
     {
         DisplayName = "Wheel",
         Size = new Size(325, 130),
         Buttons = new PadSchemaControl[]
         {
             new SingleAxisSchema(45, 70, controller, "Analog Left / Right")
             {
                 TargetSize = new Size(256, 45),
                 MinValue = 0,
                 MaxValue = 65535,
                 DisplayName = "Wheel"
             },
             new ButtonSchema(15, 12, controller, "Z"),
             new ButtonSchema(42, 22, controller, "Y"),
             new ButtonSchema(69, 32, controller, "X"),
             new ButtonSchema(145, 32, controller, "Start"),
             new ButtonSchema(231, 32, controller, "A"),
             new ButtonSchema(258, 22, controller, "B"),
             new ButtonSchema(285, 12, controller, "C"),
             ButtonSchema.Left(122, 32, $"P{controller} L Gear Shift"),
             ButtonSchema.Right(185, 32, $"P{controller} R Gear Shift")
         }
     });
 }
 private static PadSchema StandardController(int controller)
 {
     return(new PadSchema
     {
         Size = new Size(230, 100),
         Buttons = new[]
         {
             ButtonSchema.Up(14, 12, controller),
             ButtonSchema.Down(14, 56, controller),
             ButtonSchema.Left(2, 34, controller),
             ButtonSchema.Right(24, 34, controller),
             new ButtonSchema(72, 17, controller, "Mode 1: Set A", "1A"),
             new ButtonSchema(72, 40, controller, "Mode 2: Set A", "2A"),
             new ButtonSchema(102, 17, controller, "Mode 1: Set B", "1B"),
             new ButtonSchema(102, 40, controller, "Mode 2: Set B", "2B"),
             new ButtonSchema(140, 63, controller, "IV"),
             new ButtonSchema(166, 53, controller, "V"),
             new ButtonSchema(192, 43, controller, "VI"),
             new ButtonSchema(140, 40, controller, "I"),
             new ButtonSchema(166, 30, controller, "II"),
             new ButtonSchema(192, 20, controller, "III"),
             new ButtonSchema(77, 63, controller, "Select", "s"),
             new ButtonSchema(101, 63, controller, "Run", "R")
         }
     });
 }
 public IEnumerable <PadSchema> GetPadSchemas(IEmulator core, Action <string> showMessageBox)
 {
     yield return(new PadSchema
     {
         Size = new Size(194, 90),
         Buttons = new[]
         {
             ButtonSchema.Up(14, 12),
             ButtonSchema.Down(14, 56),
             ButtonSchema.Left(2, 34),
             ButtonSchema.Right(24, 34),
             new ButtonSchema(130, 62, "B"),
             new ButtonSchema(154, 62, "A"),
             new ButtonSchema(100, 12, "Option 1")
             {
                 DisplayName = "1"
             },
             new ButtonSchema(100, 62, "Option 2")
             {
                 DisplayName = "2"
             },
             new ButtonSchema(100, 37, "Pause")
         }
     });
 }
Пример #7
0
        public override void SetSchema(ControlSchema controlSchema)
        {
            // set things based off the schema
            transform.localPosition = controlSchema.Position;
            transform.localRotation = controlSchema.Rotation;
            _name = controlSchema.Name;

            buttonSchema = ButtonSchema.CreateFromControl(controlSchema);
        }
Пример #8
0
        private static PadSchema DualShockController(int controller)
        {
            var stickRanges = new[] { new AxisSpec(0.RangeTo(255), 128), new AxisSpec(0.RangeTo(255), 128, isReversed: true) };

            return(new PadSchema
            {
                Size = new Size(500, 290),
                DisplayName = $"DualShock Player{controller}",
                Buttons = new PadSchemaControl[]
                {
                    ButtonSchema.Up(32, 50, controller),
                    ButtonSchema.Down(32, 71, controller),
                    ButtonSchema.Left(11, 62, controller),
                    ButtonSchema.Right(53, 62, controller),
                    new ButtonSchema(3, 32, controller, "L1"),
                    new ButtonSchema(191, 32, controller, "R1"),
                    new ButtonSchema(3, 10, controller, "L2"),
                    new ButtonSchema(191, 10, controller, "R2"),
                    new ButtonSchema(72, 90, controller, "L3"),
                    new ButtonSchema(130, 90, controller, "R3"),
                    new ButtonSchema(148, 62, controller, "Square")
                    {
                        Icon = VGamepadButtonImage.Square
                    },
                    new ButtonSchema(169, 50, controller, "Triangle")
                    {
                        Icon = VGamepadButtonImage.Triangle
                    },
                    new ButtonSchema(190, 62, controller, "Circle")
                    {
                        Icon = VGamepadButtonImage.Circle
                    },
                    new ButtonSchema(169, 71, controller, "Cross")
                    {
                        Icon = VGamepadButtonImage.Cross
                    },
                    new ButtonSchema(112, 62, controller, "Start", "S"),
                    new ButtonSchema(90, 62, controller, "Select", "s"),
                    new AnalogSchema(3, 120, $"P{controller} LStick X")
                    {
                        Spec = stickRanges[0],
                        SecondarySpec = stickRanges[1]
                    },
                    new AnalogSchema(260, 120, $"P{controller} RStick X")
                    {
                        Spec = stickRanges[0],
                        SecondarySpec = stickRanges[1]
                    }
                }
            });
        }
 private static IEnumerable <ButtonSchema> ThreeButtons(int controller)
 {
     return(new[]
     {
         ButtonSchema.Up(14, 12, controller),
         ButtonSchema.Down(14, 56, controller),
         ButtonSchema.Left(2, 34, controller),
         ButtonSchema.Right(24, 34, controller),
         new ButtonSchema(98, 40, controller, "A"),
         new ButtonSchema(122, 40, controller, "B"),
         new ButtonSchema(146, 40, controller, "C"),
         new ButtonSchema(122, 12, controller, "Start", "S")
     });
 }
Пример #10
0
 private static PadSchema StandardController(int controller)
 {
     return(new PadSchema
     {
         Size = new Size(100, 100),
         Buttons = new[]
         {
             ButtonSchema.Up(14, 12, controller),
             ButtonSchema.Down(14, 56, controller),
             ButtonSchema.Left(2, 34, controller),
             ButtonSchema.Right(24, 34, controller),
             new ButtonSchema(74, 34, controller, "F")
         }
     });
 }
Пример #11
0
        public static IEnumerable <ButtonSchema> StandardButtons(int controller)
        {
            yield return(ButtonSchema.Up(14, 12, controller));

            yield return(ButtonSchema.Down(14, 56, controller));

            yield return(ButtonSchema.Left(2, 34, controller));

            yield return(ButtonSchema.Right(24, 34, controller));

            yield return(new ButtonSchema(122, 34, controller, "B1", "1"));

            yield return(new ButtonSchema(146, 34, controller, "B2", "2"));

            yield return(new ButtonSchema(134, 12, controller, "Start", "S"));
        }
Пример #12
0
 private static PadSchema StandardController(int controller)
 {
     return(new PadSchema
     {
         DisplayName = $"Player {controller}",
         Size = new Size(174, 74),
         Buttons = new[]
         {
             ButtonSchema.Up(23, 15, controller),
             ButtonSchema.Down(23, 36, controller),
             ButtonSchema.Left(2, 24, controller),
             ButtonSchema.Right(44, 24, controller),
             new ButtonSchema(124, 24, controller, "Button", "B")
         }
     });
 }
Пример #13
0
 private static PadSchema StandardController(int controller)
 {
     return(new PadSchema
     {
         Size = new Size(174, 90),
         Buttons = new[]
         {
             ButtonSchema.Up(14, 12, controller),
             ButtonSchema.Down(14, 56, controller),
             ButtonSchema.Left(2, 34, controller),
             ButtonSchema.Right(24, 34, controller),
             new ButtonSchema(134, 12, controller, "Start", "S"),
             new ButtonSchema(122, 34, controller, "B1", "1"),
             new ButtonSchema(146, 34, controller, "B2", "2")
         }
     });
 }
 private static PadSchema Controller()
 {
     return(new PadSchema
     {
         Size = new Size(174, 79),
         Buttons = new[]
         {
             ButtonSchema.Up(14, 12, 1),
             ButtonSchema.Down(14, 56, 1),
             ButtonSchema.Left(2, 34, 1),
             ButtonSchema.Right(24, 34, 1),
             new ButtonSchema(74, 34, 1, "B"),
             new ButtonSchema(98, 34, 1, "A"),
             new ButtonSchema(146, 12, 1, "Option", "O")
         }
     });
 }
Пример #15
0
 private static PadSchema JoystickController(int controller)
 {
     return(new PadSchema
     {
         DisplayName = $"Player {controller}",
         Size = new Size(174, 90),
         Buttons = new[]
         {
             ButtonSchema.Up(14, 12, controller),
             ButtonSchema.Down(14, 56, controller),
             ButtonSchema.Left(2, 34, controller),
             ButtonSchema.Right(24, 34, controller),
             new ButtonSchema(122, 34, controller, "B1", "1"),
             new ButtonSchema(146, 34, controller, "B2", "2")
         }
     });
 }
Пример #16
0
 private static PadSchema ProLineController(int controller)
 {
     return(new PadSchema
     {
         DisplayName = $"Player {controller}",
         Size = new Size(174, 74),
         Buttons = new[]
         {
             ButtonSchema.Up(23, 15, controller),
             ButtonSchema.Down(23, 36, controller),
             ButtonSchema.Left(2, 24, controller),
             ButtonSchema.Right(44, 24, controller),
             new ButtonSchema(120, 24, controller, "Trigger", "1"),
             new ButtonSchema(145, 24, controller, "Trigger 2", "2")
         }
     });
 }
Пример #17
0
 private static PadSchema NeGcon(int controller)
 {
     return(new PadSchema
     {
         Size = new Size(343, 195),
         DisplayName = $"NeGcon Player{controller}",
         Buttons = new PadSchemaControl[]
         {
             ButtonSchema.Up(36, 83, controller),
             ButtonSchema.Down(36, 104, controller),
             ButtonSchema.Left(15, 95, controller),
             ButtonSchema.Right(57, 95, controller),
             new ButtonSchema(78, 118, controller, "Start", "S"),
             new ButtonSchema(278, 38, controller, "B"),
             new ButtonSchema(308, 55, controller, "A"),
             new ButtonSchema(308, 15, controller, "R"),
             new SingleAxisSchema(5, 15, controller, "L")
             {
                 TargetSize = new Size(128, 55),
                 MinValue = 0,
                 MaxValue = 255
             },
             new SingleAxisSchema(125, 15, controller, "Twist", isVertical: true)
             {
                 TargetSize = new Size(64, 178),
                 MinValue = 0,
                 MaxValue = 255
             },
             new SingleAxisSchema(180, 60, controller, "2")
             {
                 DisplayName = "II",
                 TargetSize = new Size(128, 55),
                 MinValue = 0,
                 MaxValue = 255
             },
             new SingleAxisSchema(220, 120, controller, "1")
             {
                 DisplayName = "I",
                 TargetSize = new Size(128, 55),
                 MinValue = 0,
                 MaxValue = 255
             }
         }
     });
 }
Пример #18
0
 // GBHawk controllers
 protected static PadSchema StandardControllerH(int controller)
 {
     return(new PadSchema
     {
         Size = new Size(174, 79),
         Buttons = new[]
         {
             ButtonSchema.Up(14, 12, controller),
             ButtonSchema.Down(14, 56, controller),
             ButtonSchema.Left(2, 34, controller),
             ButtonSchema.Right(24, 34, controller),
             new ButtonSchema(122, 34, controller, "B"),
             new ButtonSchema(146, 34, controller, "A"),
             new ButtonSchema(52, 34, controller, "Select", "s"),
             new ButtonSchema(74, 34, controller, "Start", "S")
         }
     });
 }
Пример #19
0
 private static PadSchema StandardController(int controller)
 {
     return(new PadSchema
     {
         Size = new Size(200, 100),
         Buttons = new[]
         {
             ButtonSchema.Up(14, 12, controller),
             ButtonSchema.Down(14, 56, controller),
             ButtonSchema.Left(2, 34, controller),
             ButtonSchema.Right(24, 34, controller),
             Button(74, 34, controller, 1),
             Button(98, 34, controller, 2),
             Button(122, 34, controller, 3),
             Button(146, 34, controller, 4)
         }
     });
 }
Пример #20
0
        private static PadSchema Famicom2ndController()
        {
            var controller = 2;

            return(new PadSchema
            {
                DisplayName = "Player 2",
                Size = new Size(174, 74),
                Buttons = new[]
                {
                    ButtonSchema.Up(23, 15, controller),
                    ButtonSchema.Down(23, 36, controller),
                    ButtonSchema.Left(2, 24, controller),
                    ButtonSchema.Right(44, 24, controller),
                    new ButtonSchema(124, 24, controller, "B"),
                    new ButtonSchema(147, 24, controller, "A"),
                    new ButtonSchema(72, 24, controller, "Microphone", "Mic")
                }
            });
        }
Пример #21
0
 private static PadSchema StandardController(int controller)
 {
     return(new PadSchema
     {
         Size = new Size(275, 316),
         Buttons = new PadSchemaControl[]
         {
             ButtonSchema.Up(24, 230, $"P{controller} DPad U"),
             ButtonSchema.Down(24, 251, $"P{controller} DPad D"),
             ButtonSchema.Left(3, 242, $"P{controller} DPad L"),
             ButtonSchema.Right(45, 242, $"P{controller} DPad R"),
             new ButtonSchema(3, 185, controller, "L"),
             new ButtonSchema(191, 185, controller, "R"),
             new ButtonSchema(81, 269, controller, "Z"),
             new ButtonSchema(81, 246, controller, "Start", "S"),
             new ButtonSchema(127, 246, controller, "B"),
             new ButtonSchema(138, 269, controller, "A"),
             new ButtonSchema(173, 210, controller, "C Up")
             {
                 Icon = VGamepadButtonImage.YellowArrN
             },
             new ButtonSchema(173, 231, controller, "C Down")
             {
                 Icon = VGamepadButtonImage.YellowArrS
             },
             new ButtonSchema(152, 221, controller, "C Left")
             {
                 Icon = VGamepadButtonImage.YellowArrW
             },
             new ButtonSchema(194, 221, controller, "C Right")
             {
                 Icon = VGamepadButtonImage.YellowArrE
             },
             new AnalogSchema(6, 14, $"P{controller} X Axis")
             {
                 Spec = new AxisSpec((-128).RangeTo(127), 0),
                 SecondarySpec = new AxisSpec((-128).RangeTo(127), 0)
             }
         }
     });
 }
Пример #22
0
 private static PadSchema ThreeDeeController(int controller)
 {
     return(new PadSchema
     {
         Size = new Size(458, 285),
         Buttons = new PadSchemaControl[]
         {
             ButtonSchema.Up(290, 77, $"P{controller} D-Pad Up"),
             ButtonSchema.Down(290, 121, $"P{controller} D-Pad Down"),
             ButtonSchema.Left(278, 99, $"P{controller} D-Pad Left"),
             ButtonSchema.Right(300, 99, $"P{controller} D-Pad Right"),
             new ButtonSchema(334, 112, controller, "Start", "S"),
             new ButtonSchema(366, 123, controller, "A"),
             new ButtonSchema(390, 113, controller, "B"),
             new ButtonSchema(414, 103, controller, "C"),
             new ButtonSchema(366, 100, controller, "X"),
             new ButtonSchema(390, 90, controller, "Y"),
             new ButtonSchema(414, 80, controller, "Z"),
             new AnalogSchema(6, 74, $"P{controller} Analog Left / Right")
             {
                 SecondaryName = $"P{controller} Analog Up / Down",
                 Spec = AxisRange,
                 SecondarySpec = AxisRange
             },
             new SingleAxisSchema(8, 12, controller, "L")
             {
                 DisplayName = "L",
                 TargetSize = new Size(128, 55),
                 MinValue = AxisRange.Min,
                 MaxValue = AxisRange.Max
             },
             new SingleAxisSchema(328, 12, controller, "R")
             {
                 DisplayName = "R",
                 TargetSize = new Size(128, 55),
                 MinValue = AxisRange.Min,
                 MaxValue = AxisRange.Max
             }
         }
     });
 }
 private static PadSchema StandardController(int controller)
 {
     return(new PadSchema
     {
         Size = new Size(200, 90),
         Buttons = new[]
         {
             ButtonSchema.Up(34, 17, controller),
             ButtonSchema.Down(34, 61, controller),
             ButtonSchema.Left(22, 39, controller),
             ButtonSchema.Right(44, 39, controller),
             new ButtonSchema(2, 10, controller, "L"),
             new ButtonSchema(174, 10, controller, "R"),
             new ButtonSchema(70, 39, controller, "Select", "s"),
             new ButtonSchema(92, 39, controller, "Start", "S"),
             new ButtonSchema(121, 39, controller, "Y"),
             new ButtonSchema(145, 52, controller, "B"),
             new ButtonSchema(122, 15, controller, "X"),
             new ButtonSchema(146, 25, controller, "A")
         }
     });
 }
Пример #24
0
 private static IEnumerable <ButtonSchema> StandardButtons(int controller)
 {
     return(new[]
     {
         ButtonSchema.Up(50, 11, controller),
         ButtonSchema.Down(50, 32, controller),
         ButtonSchema.Left(29, 22, controller),
         ButtonSchema.Right(71, 22, controller),
         new ButtonSchema(27, 85, controller, "1"),
         new ButtonSchema(50, 85, controller, "2"),
         new ButtonSchema(73, 85, controller, "3"),
         new ButtonSchema(27, 108, controller, "4"),
         new ButtonSchema(50, 108, controller, "5"),
         new ButtonSchema(73, 108, controller, "6"),
         new ButtonSchema(27, 131, controller, "7"),
         new ButtonSchema(50, 131, controller, "8"),
         new ButtonSchema(73, 131, controller, "9"),
         new ButtonSchema(27, 154, controller, "Star", "*"),
         new ButtonSchema(50, 154, controller, "0"),
         new ButtonSchema(73, 154, controller, "Pound", "#")
     });
 }
Пример #25
0
 private static PadSchema StandardController(int controller)
 {
     return(new PadSchema
     {
         Size = new Size(250, 100),
         Buttons = new[]
         {
             ButtonSchema.Up(34, 17, controller),
             ButtonSchema.Down(34, 61, controller),
             ButtonSchema.Left(22, 39, controller),
             ButtonSchema.Right(44, 39, controller),
             new ButtonSchema(78, 52, controller, "Start", "S"),
             new ButtonSchema(110, 63, controller, "A"),
             new ButtonSchema(134, 53, controller, "B"),
             new ButtonSchema(158, 43, controller, "C"),
             new ButtonSchema(110, 40, controller, "X"),
             new ButtonSchema(134, 30, controller, "Y"),
             new ButtonSchema(158, 20, controller, "Z"),
             new ButtonSchema(2, 10, controller, "L"),
             new ButtonSchema(184, 10, controller, "R")
         }
     });
 }
Пример #26
0
 private static PadSchema GamePadController(int controller)
 {
     return(new PadSchema
     {
         Size = new Size(240, 115),
         DisplayName = $"Gamepad Player{controller}",
         Buttons = new[]
         {
             ButtonSchema.Up(37, 55, controller),
             ButtonSchema.Down(37, 76, controller),
             ButtonSchema.Left(16, 67, controller),
             ButtonSchema.Right(58, 67, controller),
             new ButtonSchema(8, 37, controller, "L1"),
             new ButtonSchema(196, 37, controller, "R1"),
             new ButtonSchema(8, 15, controller, "L2"),
             new ButtonSchema(196, 15, controller, "R2"),
             new ButtonSchema(153, 67, controller, "Square")
             {
                 Icon = VGamepadButtonImage.Square
             },
             new ButtonSchema(174, 55, controller, "Triangle")
             {
                 Icon = VGamepadButtonImage.Triangle
             },
             new ButtonSchema(195, 67, controller, "Circle")
             {
                 Icon = VGamepadButtonImage.Circle
             },
             new ButtonSchema(174, 76, controller, "Cross")
             {
                 Icon = VGamepadButtonImage.Cross
             },
             new ButtonSchema(112, 67, controller, "Start", "S"),
             new ButtonSchema(90, 67, controller, "Select", "s")
         }
     });
 }
Пример #27
0
 // Gambatte Controller
 private static PadSchema StandardController()
 {
     return(new PadSchema
     {
         Size = new Size(174, 79),
         Buttons = new[]
         {
             ButtonSchema.Up(14, 12),
             ButtonSchema.Down(14, 56),
             ButtonSchema.Left(2, 34),
             ButtonSchema.Right(24, 34),
             new ButtonSchema(122, 34, "B"),
             new ButtonSchema(146, 34, "A"),
             new ButtonSchema(52, 34, "Select")
             {
                 DisplayName = "s"
             },
             new ButtonSchema(74, 34, "Start")
             {
                 DisplayName = "S"
             }
         }
     });
 }
Пример #28
0
        private static PadSchema Keyboard()
        {
            return(new PadSchema
            {
                DisplayName = "Keyboard",
                Size = new Size(390, 150),
                Buttons = new[]
                {
                    /************************** Row 1 **************************/
                    new ButtonSchema(10, 18, "Escape")
                    {
                        DisplayName = "Esc"
                    },
                    new ButtonSchema(46, 18, "1"),
                    new ButtonSchema(70, 18, "2"),
                    new ButtonSchema(94, 18, "3"),
                    new ButtonSchema(118, 18, "4"),
                    new ButtonSchema(142, 18, "5"),
                    new ButtonSchema(166, 18, "6"),
                    new ButtonSchema(190, 18, "7"),
                    new ButtonSchema(214, 18, "8"),
                    new ButtonSchema(238, 18, "9"),
                    new ButtonSchema(262, 18, "0"),
                    new ButtonSchema(286, 18, "-"),
                    new ButtonSchema(307, 18, "="),
                    new ButtonSchema(331, 18, "Delete"),

                    /************************** Row 2 **************************/
                    new ButtonSchema(10, 42, "Tab")
                    {
                        DisplayName = " Tab "
                    },
                    new ButtonSchema(52, 42, "Q"),
                    new ButtonSchema(78, 42, "W"),
                    new ButtonSchema(106, 42, "E"),
                    new ButtonSchema(130, 42, "R"),
                    new ButtonSchema(156, 42, "T"),
                    new ButtonSchema(180, 42, "Y"),
                    new ButtonSchema(204, 42, "U"),
                    new ButtonSchema(230, 42, "I"),
                    new ButtonSchema(250, 42, "O"),
                    new ButtonSchema(276, 42, "P"),
                    new ButtonSchema(302, 42, "["),
                    new ButtonSchema(325, 42, "]"),
                    new ButtonSchema(349, 42, "\\")
                    {
                        DisplayName = " \\ "
                    },

                    /************************** Row 3 **************************/
                    new ButtonSchema(10, 66, "Control")
                    {
                        DisplayName = " Control "
                    },
                    new ButtonSchema(66, 66, "A"),
                    new ButtonSchema(90, 66, "S"),
                    new ButtonSchema(114, 66, "D"),
                    new ButtonSchema(140, 66, "F"),
                    new ButtonSchema(164, 66, "G"),
                    new ButtonSchema(190, 66, "H"),
                    new ButtonSchema(216, 66, "J"),
                    new ButtonSchema(238, 66, "K"),
                    new ButtonSchema(262, 66, "L"),
                    new ButtonSchema(286, 66, ";"),
                    new ButtonSchema(307, 66, "'"),
                    new ButtonSchema(328, 66, "Return"),

                    /************************** Row 4 **************************/
                    new ButtonSchema(10, 90, "Shift")
                    {
                        DisplayName = "     Shift     "
                    },
                    new ButtonSchema(80, 90, "Z"),
                    new ButtonSchema(106, 90, "X"),
                    new ButtonSchema(130, 90, "C"),
                    new ButtonSchema(154, 90, "V"),
                    new ButtonSchema(178, 90, "B"),
                    new ButtonSchema(202, 90, "N"),
                    new ButtonSchema(226, 90, "M"),
                    new ButtonSchema(252, 90, ","),
                    new ButtonSchema(272, 90, "."),
                    new ButtonSchema(292, 90, "/"),
                    new ButtonSchema(315, 90, "Shift")
                    {
                        DisplayName = "    Shift    "
                    },

                    /************************** Row 5 **************************/

                    new ButtonSchema(10, 114, "Caps Lock")
                    {
                        DisplayName = "Caps"
                    },
                    new ButtonSchema(52, 114, "`")
                    {
                        DisplayName = "~"
                    },
                    new ButtonSchema(96, 114, "White Apple")
                    {
                        DisplayName = "<"
                    },
                    new ButtonSchema(120, 114, "Space")
                    {
                        DisplayName = "                Space                "
                    },
                    new ButtonSchema(265, 114, "Black Apple")
                    {
                        DisplayName = ">"
                    },
                    ButtonSchema.Left(289, 114),
                    ButtonSchema.Right(311, 114),
                    ButtonSchema.Down(333, 114),
                    ButtonSchema.Up(355, 114)
                }
            });
        }
Пример #29
0
        private static PadSchema Keyboard()
        {
            var bls = new List <ButtonLayout>
            {
                new ButtonLayout {
                    Name = "Key True Video", DisName = "TV", Row = 0, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key Inv Video", DisName = "IV", Row = 0, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key 1", DisName = "1", Row = 0, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key 2", DisName = "2", Row = 0, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key 3", DisName = "3", Row = 0, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key 4", DisName = "4", Row = 0, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key 5", DisName = "5", Row = 0, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key 6", DisName = "6", Row = 0, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key 7", DisName = "7", Row = 0, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key 8", DisName = "8", Row = 0, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key 9", DisName = "9", Row = 0, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key 0", DisName = "0", Row = 0, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key Break", DisName = "BREAK", Row = 0, WidthFactor = 1.5
                },

                new ButtonLayout {
                    Name = "Key Delete", DisName = "DEL", Row = 1, WidthFactor = 1.5
                },
                new ButtonLayout {
                    Name = "Key Graph", DisName = "GR", Row = 1, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key Q", DisName = "Q", Row = 1, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key W", DisName = "W", Row = 1, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key E", DisName = "E", Row = 1, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key R", DisName = "R", Row = 1, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key T", DisName = "T", Row = 1, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key Y", DisName = "Y", Row = 1, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key U", DisName = "U", Row = 1, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key I", DisName = "I", Row = 1, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key O", DisName = "O", Row = 1, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key P", DisName = "P", Row = 1, WidthFactor = 1
                },

                new ButtonLayout {
                    Name = "Key Extend Mode", DisName = "EM", Row = 2, WidthFactor = 1.5
                },
                new ButtonLayout {
                    Name = "Key Edit", DisName = "ED", Row = 2, WidthFactor = 1.25
                },
                new ButtonLayout {
                    Name = "Key A", DisName = "A", Row = 2, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key S", DisName = "S", Row = 2, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key D", DisName = "D", Row = 2, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key F", DisName = "F", Row = 2, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key G", DisName = "G", Row = 2, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key H", DisName = "H", Row = 2, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key J", DisName = "J", Row = 2, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key K", DisName = "K", Row = 2, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key L", DisName = "L", Row = 2, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key Return", DisName = "ENTER", Row = 2, WidthFactor = 1.75
                },

                new ButtonLayout {
                    Name = "Key Caps Shift", DisName = "CAPS-S", Row = 3, WidthFactor = 2.25
                },
                new ButtonLayout {
                    Name = "Key Caps Lock", DisName = "CL", Row = 3, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key Z", DisName = "Z", Row = 3, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key X", DisName = "X", Row = 3, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key C", DisName = "C", Row = 3, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key V", DisName = "V", Row = 3, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key B", DisName = "B", Row = 3, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key N", DisName = "N", Row = 3, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key M", DisName = "M", Row = 3, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key Period", DisName = ".", Row = 3, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key Caps Shift", DisName = "CAPS-S", Row = 3, WidthFactor = 2.25
                },

                new ButtonLayout {
                    Name = "Key Symbol Shift", DisName = "SS", Row = 4, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key Semi-Colon", DisName = ";", Row = 4, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key Quote", DisName = "\"", Row = 4, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key Left Cursor", DisName = "←", Row = 4, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key Right Cursor", DisName = "→", Row = 4, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key Space", DisName = "SPACE", Row = 4, WidthFactor = 4.5
                },
                new ButtonLayout {
                    Name = "Key Up Cursor", DisName = "↑", Row = 4, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key Down Cursor", DisName = "↓", Row = 4, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key Comma", DisName = ",", Row = 4, WidthFactor = 1
                },
                new ButtonLayout {
                    Name = "Key Symbol Shift", DisName = "SS", Row = 4, WidthFactor = 1
                }
            };

            var ps = new PadSchema
            {
                DisplayName = "Keyboard",
                Size        = new Size(500, 170)
            };

            var btns = new List <ButtonSchema>();

            int rowHeight      = 29;        //24
            int stdButtonWidth = 29;        //24
            int yPos           = 18;
            int xPos           = 22;
            int currRow        = 0;

            foreach (var b in bls)
            {
                if (b.Row > currRow)
                {
                    currRow++;
                    yPos += rowHeight;
                    xPos  = 22;
                }

                int txtLength = b.DisName.Length;
                int btnSize   = System.Convert.ToInt32((double)stdButtonWidth * b.WidthFactor);


                string disp = b.DisName;
                if (txtLength == 1)
                {
                    disp = $" {disp}";
                }

                disp = b.DisName switch
                {
                    "SPACE" => $"            {disp}            ",
                    "I" => $" {disp} ",
                    "W" => b.DisName,
                    _ => disp
                };

                if (b.IsActive)
                {
                    var btn = new ButtonSchema(xPos, yPos, b.Name)
                    {
                        DisplayName = disp
                    };
                    btns.Add(btn);
                }

                xPos += btnSize;
            }

            ps.Buttons = btns.ToArray();
            return(ps);
        }