From 88d4a2a5a8b63d3799047d8b1eaa43668fe6fb59 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 28 Jun 2014 12:45:12 +0000 Subject: [PATCH] Genesis mouse - mnemonics, default buttons and virtual pad --- .../movie/bk2/Bk2MnemonicConstants.cs | 5 ++ .../tools/VirtualPads/schema/GenSchema.cs | 56 +++++++++++++++++++ output/defctrl.json | 16 +++++- 3 files changed, 76 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.Common/movie/bk2/Bk2MnemonicConstants.cs b/BizHawk.Client.Common/movie/bk2/Bk2MnemonicConstants.cs index a442f7b41c..b0c87d4d71 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2MnemonicConstants.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2MnemonicConstants.cs @@ -73,6 +73,11 @@ namespace BizHawk.Client.Common { "Trigger 1", '1' }, { "Trigger 2", '2' }, + { "Mouse Left", 'l' }, + { "Mouse Right", 'r' }, + { "Mouse Center", 'c' }, + { "Mouse Start", 's' }, + {"Mode", 'M'}, { "Fire", 'F' }, diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GenSchema.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GenSchema.cs index 41b91f1fd8..a0a0c08d44 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GenSchema.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/GenSchema.cs @@ -30,6 +30,9 @@ namespace BizHawk.Client.EmuHawk case LibGPGX.INPUT_DEVICE.DEVICE_LIGHTGUN: yield return LighGun(player); break; + case LibGPGX.INPUT_DEVICE.DEVICE_MOUSE: + yield return Mouse(player); + break; } player++; @@ -243,6 +246,59 @@ namespace BizHawk.Client.EmuHawk }; } + public static PadSchema Mouse(int controller) + { + return new PadSchema + { + DisplayName = "Mouse", + IsConsole = false, + DefaultSize = new Size(400, 290), + Buttons = new[] + { + new PadSchema.ButtonScema + { + Name = "P" + controller + " Mouse X", + Location = new Point(14, 17), + Type = PadSchema.PadInputType.TargetedPair, + TargetSize = new Size(320, 270), + SecondaryNames = new [] + { + "P" + controller + " Mouse Y", + "P" + controller + " Mouse Left", + } + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " Mouse Left", + DisplayName = "Left", + Location = new Point(335, 17), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " Mouse Center", + DisplayName = "Center", + Location = new Point(335, 40), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " Mouse Right", + DisplayName = "Right", + Location = new Point(335, 63), + Type = PadSchema.PadInputType.Boolean + }, + new PadSchema.ButtonScema + { + Name = "P" + controller + " Mouse Start", + DisplayName = "Start", + Location = new Point(335, 86), + Type = PadSchema.PadInputType.Boolean + } + } + }; + } + public static PadSchema ConsoleButtons() { return new PadSchema diff --git a/output/defctrl.json b/output/defctrl.json index 65f46c4922..9d7c5e0076 100644 --- a/output/defctrl.json +++ b/output/defctrl.json @@ -564,8 +564,12 @@ "P2 Y": "", "P2 Z": "", "P2 Mode": "", - "P2 Lightgun Trigger": "WMouse Click", + "P2 Lightgun Trigger": "WMouse L", "P2 Lightgun Start": "NumberPad5", + "P2 Mouse Left": "WMouse L", + "P2 Mouse Center": "WMouse M", + "P2 Mouse Right": "WMouse R", + "P2 Mouse Start": "NumberPad5", "Power": "", "Reset": "" }, @@ -854,6 +858,16 @@ "Mult": 1.0, "Deadzone": 0.0 }, + "P2 Mouse X": { + "Value": "WMouse X", + "Mult": 1.0, + "Deadzone": 0.0 + }, + "P2 Mouse Y": { + "Value": "WMouse Y", + "Mult": 1.0, + "Deadzone": 0.0 + }, }, "WonderSwan Controller": {} }