Skip to content

Commit acb14cf

Browse files
committed
fix middle mouse button input bind
half the code was using `WMouse M`, the other `WMouse C`. I think `WMouse M` makes the most sense.
1 parent 9e07c85 commit acb14cf

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/BizHawk.Client.Common/Api/Interfaces/IInputApi.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public interface IInputApi : IExternalApi
1313
/// <remarks>
1414
/// Includes gamepad axes (<c>!axis.isNeutral</c>, with sticks as 4 "buttons" suffixed <c>"Up"</c>/<c>"Down"</c>/<c>"Left"</c>/<c>"Right"</c>).<br/>
1515
/// Includes mouse buttons, but not axes (cursor position and wheel rotation).
16-
/// Unlike <see cref="GetMouse"/>, these have the names <c>"WMouse L"</c>, <c>"WMouse R"</c>, <c>"WMouse C"</c>, <c>"WMouse 1"</c>, and <c>"WMouse 2"</c> for LMB, RMB, MMB, Mouse4, and Mouse5, respectively.<br/>
16+
/// Unlike <see cref="GetMouse"/>, these have the names <c>"WMouse L"</c>, <c>"WMouse R"</c>, <c>"WMouse M"</c>, <c>"WMouse 1"</c>, and <c>"WMouse 2"</c> for LMB, RMB, MMB, Mouse4, and Mouse5, respectively.<br/>
1717
/// See <see cref="DistinctKey"/> for keyboard key names, though some are overridden by <see cref="DistinctKeyNameOverrides"/> (check the source).
1818
/// </remarks>
1919
/// <seealso cref="GetPressedButtons"/>
@@ -49,7 +49,7 @@ public interface IInputApi : IExternalApi
4949
/// <remarks>
5050
/// Includes gamepad axes (<c>!axis.isNeutral</c>, with sticks as 4 "buttons" suffixed <c>"Up"</c>/<c>"Down"</c>/<c>"Left"</c>/<c>"Right"</c>).<br/>
5151
/// Includes mouse buttons, but not axes (cursor position and wheel rotation).
52-
/// Unlike <see cref="GetMouse"/>, these have the names <c>"WMouse L"</c>, <c>"WMouse R"</c>, <c>"WMouse C"</c>, <c>"WMouse 1"</c>, and <c>"WMouse 2"</c> for LMB, RMB, MMB, Mouse4, and Mouse5, respectively.<br/>
52+
/// Unlike <see cref="GetMouse"/>, these have the names <c>"WMouse L"</c>, <c>"WMouse R"</c>, <c>"WMouse M"</c>, <c>"WMouse 1"</c>, and <c>"WMouse 2"</c> for LMB, RMB, MMB, Mouse4, and Mouse5, respectively.<br/>
5353
/// See <see cref="DistinctKey"/> for keyboard key names, though some are overridden by <see cref="DistinctKeyNameOverrides"/> (check the source).
5454
/// </remarks>
5555
IReadOnlyList<string> GetPressedButtons();

src/BizHawk.Client.Common/lua/CommonLibs/InputLuaLibrary.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public InputLuaLibrary(ILuaLibraries luaLibsImpl, ApiContainer apiContainer, Act
1010
public override string Name => "input";
1111

1212
[LuaMethodExample("local buttons_down = input.get();\nlocal is_b_down = buttons_down[\"B\"];\nif is_b_down and not was_b_down then console.writeline(\"B pressed\"); end\nwas_b_down = is_b_down;")]
13-
[LuaMethod("get", "Returns a dict-like table of key/button names (of host). Only pressed buttons will appear (with a value of {{true}}); unpressed buttons are omitted. Includes gamepad axes ({{!axis.isNeutral}}, with sticks as 4 \"buttons\" suffixed {{\"Up\"}}/{{\"Down\"}}/{{\"Left\"}}/{{\"Right\"}}). Includes mouse buttons, but not axes (cursor position and wheel rotation). Unlike {{getmouse}}, these have the names {{\"WMouse L\"}}, {{\"WMouse R\"}}, {{\"WMouse C\"}}, {{\"WMouse 1\"}}, and {{\"WMouse 2\"}} for LMB, RMB, MMB, Mouse4, and Mouse5, respectively.")]
13+
[LuaMethod("get", "Returns a dict-like table of key/button names (of host). Only pressed buttons will appear (with a value of {{true}}); unpressed buttons are omitted. Includes gamepad axes ({{!axis.isNeutral}}, with sticks as 4 \"buttons\" suffixed {{\"Up\"}}/{{\"Down\"}}/{{\"Left\"}}/{{\"Right\"}}). Includes mouse buttons, but not axes (cursor position and wheel rotation). Unlike {{getmouse}}, these have the names {{\"WMouse L\"}}, {{\"WMouse R\"}}, {{\"WMouse M\"}}, {{\"WMouse 1\"}}, and {{\"WMouse 2\"}} for LMB, RMB, MMB, Mouse4, and Mouse5, respectively.")]
1414
public LuaTable Get()
1515
#pragma warning disable CS0618 // the ApiHawk equivalent of this function is warn-level deprecated; Lua can't and shouldn't make that distinction
1616
=> _th.DictToTable(APIs.Input.Get());

src/BizHawk.Client.EmuHawk/Input/Input.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ private void UpdateThreadProc()
236236

237237
var mouseBtns = Control.MouseButtons;
238238
HandleButton("WMouse L", (mouseBtns & MouseButtons.Left) != 0, ClientInputFocus.Mouse);
239-
HandleButton("WMouse C", (mouseBtns & MouseButtons.Middle) != 0, ClientInputFocus.Mouse);
239+
HandleButton("WMouse M", (mouseBtns & MouseButtons.Middle) != 0, ClientInputFocus.Mouse);
240240
HandleButton("WMouse R", (mouseBtns & MouseButtons.Right) != 0, ClientInputFocus.Mouse);
241241
HandleButton("WMouse 1", (mouseBtns & MouseButtons.XButton1) != 0, ClientInputFocus.Mouse);
242242
HandleButton("WMouse 2", (mouseBtns & MouseButtons.XButton2) != 0, ClientInputFocus.Mouse);
@@ -246,7 +246,7 @@ private void UpdateThreadProc()
246246
#if false // don't do this: for now, it will interfere with the virtualpad. don't do something similar for the mouse position either
247247
// unpress all buttons
248248
HandleButton("WMouse L", false, ClientInputFocus.Mouse);
249-
HandleButton("WMouse C", false, ClientInputFocus.Mouse);
249+
HandleButton("WMouse M", false, ClientInputFocus.Mouse);
250250
HandleButton("WMouse R", false, ClientInputFocus.Mouse);
251251
HandleButton("WMouse 1", false, ClientInputFocus.Mouse);
252252
HandleButton("WMouse 2", false, ClientInputFocus.Mouse);

0 commit comments

Comments
 (0)