From 8bd292d8d5702085a03a5316a9d6c6116fb1c121 Mon Sep 17 00:00:00 2001 From: Sour Date: Sat, 22 Dec 2018 16:05:12 -0500 Subject: [PATCH] Input: Added option to hide mouse cursor when a zapper is connected (e.g for the aimtrak light gun) --- Docs/content/apireference/_index.md | 2 +- Docs/content/configuration/Input.md | 5 ++- Docs/static/images/InputOptions_Advanced.png | Bin 5510 -> 6724 bytes GUI.NET/Config/InputInfo.cs | 2 ++ GUI.NET/CursorManager.cs | 30 +++++++++++------- GUI.NET/Dependencies/resources.ca.xml | 1 + GUI.NET/Dependencies/resources.en.xml | 1 + GUI.NET/Dependencies/resources.es.xml | 1 + GUI.NET/Dependencies/resources.fr.xml | 1 + GUI.NET/Dependencies/resources.ja.xml | 1 + GUI.NET/Dependencies/resources.pt.xml | 1 + GUI.NET/Dependencies/resources.ru.xml | 1 + GUI.NET/Dependencies/resources.uk.xml | 1 + GUI.NET/Dependencies/resources.zh.xml | 1 + .../Forms/Config/frmInputConfig.Designer.cs | 20 ++++++++++-- GUI.NET/Forms/Config/frmInputConfig.cs | 1 + 16 files changed, 52 insertions(+), 17 deletions(-) diff --git a/Docs/content/apireference/_index.md b/Docs/content/apireference/_index.md index d88993fd..fbddbf3c 100644 --- a/Docs/content/apireference/_index.md +++ b/Docs/content/apireference/_index.md @@ -9,7 +9,7 @@ This section documents the Mesen-specific Lua API that is available in scripts v ## Changelog ## -The Lua is still a recent feature and not completely stable yet. To get a list of the major changes between different versions of Mesen, take a look at the [Changelog](/apireference/changelog.html). +Lua scripting is still a relatively recent feature and the API is not quite stable yet. To get a list of the major changes between different versions of Mesen, take a look at the [Changelog](/apireference/changelog.html). ## API References ## diff --git a/Docs/content/configuration/Input.md b/Docs/content/configuration/Input.md index 98c6307d..6dbb026c 100644 --- a/Docs/content/configuration/Input.md +++ b/Docs/content/configuration/Input.md @@ -51,9 +51,12 @@ You can also configure that controller's turbo buttons' speed with the `Turbo Sp Advanced Options +**Hide mouse pointer when using zapper**: Hides the mouse pointer completely when a Zapper is connected. This is useful when using light guns (for PCs) that simulate a mouse. + ### Display Controller Input ### Use these options to display the controller input on the screen. {{% notice warning %}} This will be recorded by the [Video Recorder](/tools.html#video-recorder) - so make sure you turn it off if you do not want it to appear on the video. -{{% /notice %}} \ No newline at end of file +{{% /notice %}} + diff --git a/Docs/static/images/InputOptions_Advanced.png b/Docs/static/images/InputOptions_Advanced.png index 5f53cd95999de528c386cd169a5f0374044e7b61..aee9e486ae28f924ff68a88d2e3807e302936fff 100644 GIT binary patch literal 6724 zcmeHMXIN9+vX1hhAPNWqq96hSBCrJ&AygHRP6Uyf(5tl2rN)Aww1|`dQj{Vh1PCRB zjvydJLz5Chz)%b=^j>eibI*C6bH4lCzxUVuG0$FW?OAKho|!c>@7k{)7-*h3b>S2U z1UjRwrEUZQ9rL5pb*AI=kr6GlH2v|1^IiSBAP@%0vTw^s?=!=-%zZ&1)|Nl%7}r&u zr}RNyKMga#hh9#8fwn%5Ah@loryt(PjcpfCf;(Q64>excNf)Fia{Qs=LIE?YrO&)mfxAuw|l0<_v(+v1unfe zdOhEcU%3I-nR0h{=9r_MQ;ZM|V1M^y@~R+nXw#$d&n1gfk#I!m1KHlBIl2Tho(U zjmrsvNBFAhhM@W7bq2O!Ptd#%9KO6z(LHkiZge^R_6c_;lvwuuJli25cV~VaaX_;^ zSXRtFpaq7`BFEQi#`g=I#}Lb^hzr z?ap%NI&(tx!7ws#HNV=7#13%q4xX~wi$Wr3xol&Han(m_rF{GSdu)emTj9IO$fNxj z#Fkk3{8&RsCgBT|BD7{~{{C2ksH&pMqN*Oa%!>n*t6+FT#{BDV_zr~)u|3{-v9w`- z)T_brxCUT06{&T>I&>Xolmzn{3t1~~bu=2@H)W{C5ug4U4msk6k`4Y_eXHdI*|k_L!MtvpalV0rU-IGSN6tMaYRJh@W7f_QJp z=a*r~+t8$*nJlxLkYOG?y71YaPHggQr_k*v{8rP^!H_j#(*JDZYt_9qNLPLrja03= zvi$?PzggYXAP()z`RQcnZs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eEV+Si|GDiO$D53e*r|*d_3rwNI^19{^gsl-HZ^&9Cqm>MVW(+g59QN zQLJ`GV9jeG2`&>yC6>Of?|)v`?s6kycT3#-*t1*5{CH)+&0mR&^MWASi2Fk53H2Hy zx8qm@5HNHa1Tg&@?|DFg>a?42qf&IumcuYUV)=jkpYp-8Oen*n8`cGdDou zUypblrHo5*05!YM6(ba2Q#xjY# z-|wQ)lIMo+h}69X_KNq@a4>rRBsrA-v199;+M}CSyZDfIK4pw{4-fU*lfivgyHK0e^*1;HZb6z3VI-X_w=qyQs*GrdY3 Hx7dFJv~ZF% diff --git a/GUI.NET/Config/InputInfo.cs b/GUI.NET/Config/InputInfo.cs index 7937dc56..01f8a173 100644 --- a/GUI.NET/Config/InputInfo.cs +++ b/GUI.NET/Config/InputInfo.cs @@ -137,6 +137,8 @@ namespace Mesen.GUI.Config public InteropEmu.InputDisplayPosition DisplayInputPosition = InteropEmu.InputDisplayPosition.BottomRight; public bool DisplayInputHorizontally = true; + public bool HideMousePointerForZapper = true; + [XmlElement(ElementName = "InputDevice")] public List Controllers = new List(); public ZapperInfo Zapper = new ZapperInfo(); diff --git a/GUI.NET/CursorManager.cs b/GUI.NET/CursorManager.cs index fa1cd34e..97451d4f 100644 --- a/GUI.NET/CursorManager.cs +++ b/GUI.NET/CursorManager.cs @@ -35,8 +35,15 @@ namespace Mesen.GUI //Have not been able to find a reliable way to reproduce it yet //This is a patch to prevent that bug from having any negative impact if(!_mouseCaptured && _lastPosition != Cursor.Position) { - ShowMouse(); _lastPosition = Cursor.Position; + + bool running = InteropEmu.IsRunning() && !InteropEmu.IsPaused(); + if(running && ConfigManager.Config.InputInfo.HideMousePointerForZapper && CursorManager.IsLightGun) { + //Keep mouse hidden when using zapper if option to hide mouse is enabled + return; + } + + ShowMouse(); } } @@ -67,19 +74,14 @@ namespace Mesen.GUI } } + private static bool IsLightGun + { + get { return InteropEmu.HasZapper() || InteropEmu.GetExpansionDevice() == InteropEmu.ExpansionPortDevice.BandaiHyperShot; } + } + public static bool NeedMouseIcon { - get { - switch(InteropEmu.GetExpansionDevice()) { - case InteropEmu.ExpansionPortDevice.OekaKidsTablet: - case InteropEmu.ExpansionPortDevice.BandaiHyperShot: - return true; - } - if(InteropEmu.HasZapper()) { - return true; - } - return false; - } + get { return CursorManager.IsLightGun || InteropEmu.GetExpansionDevice() == InteropEmu.ExpansionPortDevice.OekaKidsTablet; } } public static void OnMouseMove(Control ctrl) @@ -99,6 +101,10 @@ namespace Mesen.GUI if(!InteropEmu.IsRunning() || InteropEmu.IsPaused()) { ShowMouse(); + } else if(ConfigManager.Config.InputInfo.HideMousePointerForZapper && CursorManager.IsLightGun) { + //Keep mouse hidden when using zapper if option to hide mouse is enabled + HideMouse(); + return; } _tmrHideMouse.Stop(); diff --git a/GUI.NET/Dependencies/resources.ca.xml b/GUI.NET/Dependencies/resources.ca.xml index 69930211..e77acdf2 100644 --- a/GUI.NET/Dependencies/resources.ca.xml +++ b/GUI.NET/Dependencies/resources.ca.xml @@ -217,6 +217,7 @@ Jugador 4 Posició de pantalla: Mostra horitzontalment + Hide mouse pointer when using zapper Advertència: La vostra configuració actual conté assignacions conflictives - algunes tecles del vostre teclat o botons del comandament han estat assignats a múltiples botons al comandament de la NES. Si això no ha estat intencionat, us preguem que reviseu i corregiu les vostres assignacions. diff --git a/GUI.NET/Dependencies/resources.en.xml b/GUI.NET/Dependencies/resources.en.xml index 456ec51c..983962e7 100644 --- a/GUI.NET/Dependencies/resources.en.xml +++ b/GUI.NET/Dependencies/resources.en.xml @@ -217,6 +217,7 @@ Port 4 Display Position: Display horizontally + Hide mouse pointer when using zapper Warning: Your current configuration contains conflicting key bindings - some physical buttons on your keyboard or gamepad are mapped to multiple buttons on the NES controller. If this is not intentional, please review and correct your key bindings. diff --git a/GUI.NET/Dependencies/resources.es.xml b/GUI.NET/Dependencies/resources.es.xml index d026380e..20cfd5c6 100644 --- a/GUI.NET/Dependencies/resources.es.xml +++ b/GUI.NET/Dependencies/resources.es.xml @@ -216,6 +216,7 @@ Jugador 4 Posición de pantalla: Mostrar horizontalmente + Hide mouse pointer when using zapper Advertencia: su configuración actual contiene asignaciones conflictivas - algunas teclas de su teclado o botones del mando se han asignado a varios botones del mando de la NES. Si esto no es intencionado, revise y corrija las asignaciones. diff --git a/GUI.NET/Dependencies/resources.fr.xml b/GUI.NET/Dependencies/resources.fr.xml index e992312d..5a98e751 100644 --- a/GUI.NET/Dependencies/resources.fr.xml +++ b/GUI.NET/Dependencies/resources.fr.xml @@ -217,6 +217,7 @@ Joueur 4 Position d'affichage : Afficher horizontalement + Cacher la souris lorsqu'un zapper est connecté Attention: Votre configuration actuelle contient des conflits - certaines touches sur votre clavier ou manette sont mappées à plusieurs boutons sur la console. Veuillez réviser votre configuration et la corriger au besoin. diff --git a/GUI.NET/Dependencies/resources.ja.xml b/GUI.NET/Dependencies/resources.ja.xml index da57695f..52780d64 100644 --- a/GUI.NET/Dependencies/resources.ja.xml +++ b/GUI.NET/Dependencies/resources.ja.xml @@ -218,6 +218,7 @@ プレーヤー4 表示位置: 水平表示 + ガンが接続されている時にマウスポインターを隠す 注意: 使っている設定の中には同じキーが複数のボタン―にマッピングされています。 間違いでこの設定にした場合は、設定を確認して直してください。 diff --git a/GUI.NET/Dependencies/resources.pt.xml b/GUI.NET/Dependencies/resources.pt.xml index 3532a94c..371edec6 100644 --- a/GUI.NET/Dependencies/resources.pt.xml +++ b/GUI.NET/Dependencies/resources.pt.xml @@ -217,6 +217,7 @@ Jogador 4 Posição da tela Mostrar horizontalmente + Hide mouse pointer when using zapper Aviso: a configuração atual contém atribuições conflitantes - alguns botões físicos em seu teclado ou gamepad são mapeados para vários botões no controle NES. Se isso não for intencional, reveja e corrija suas atribuições. diff --git a/GUI.NET/Dependencies/resources.ru.xml b/GUI.NET/Dependencies/resources.ru.xml index 766778c9..02023b3c 100644 --- a/GUI.NET/Dependencies/resources.ru.xml +++ b/GUI.NET/Dependencies/resources.ru.xml @@ -216,6 +216,7 @@ Порт 4 Позиция : Отображать горизонтально + Hide mouse pointer when using zapper Warning: Your current configuration contains conflicting key bindings - some physical buttons on your keyboard or gamepad are mapped to multiple buttons on the NES controller. If this is not intentional, please review and correct your key bindings. diff --git a/GUI.NET/Dependencies/resources.uk.xml b/GUI.NET/Dependencies/resources.uk.xml index fc8cdc5c..35b37c56 100644 --- a/GUI.NET/Dependencies/resources.uk.xml +++ b/GUI.NET/Dependencies/resources.uk.xml @@ -216,6 +216,7 @@ Порт 4 Позиція : Відображати горизонтально + Hide mouse pointer when using zapper Увага: Ваша поточна конфігурація містить конфліктуючі поєднання клавіш - деякі фізичні кнопки на вашому ключовому словнику або геймпадi відображаються на кількох кнопках на контролері NES. Якщо це не навмисне, перегляньте та виправте ключi. diff --git a/GUI.NET/Dependencies/resources.zh.xml b/GUI.NET/Dependencies/resources.zh.xml index 3e24298c..fc8b59e1 100644 --- a/GUI.NET/Dependencies/resources.zh.xml +++ b/GUI.NET/Dependencies/resources.zh.xml @@ -220,6 +220,7 @@ 玩家 4 显示位置: 横向 + Hide mouse pointer when using zapper 警告:您当前的配置包含冲突的键绑定 - 键盘或游戏手柄上的某些物理按钮映射到NES控制器上的多个按钮.如果这不是故意的,请查看并更正您的按键绑定. diff --git a/GUI.NET/Forms/Config/frmInputConfig.Designer.cs b/GUI.NET/Forms/Config/frmInputConfig.Designer.cs index a21ea0f2..8ba56212 100644 --- a/GUI.NET/Forms/Config/frmInputConfig.Designer.cs +++ b/GUI.NET/Forms/Config/frmInputConfig.Designer.cs @@ -70,6 +70,7 @@ this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel(); this.lblDisplayPosition = new System.Windows.Forms.Label(); this.cboDisplayInputPosition = new System.Windows.Forms.ComboBox(); + this.chkHideMousePointerForZapper = new Mesen.GUI.Controls.ctrlRiskyOption(); this.tabMain.SuspendLayout(); this.tpgControllers.SuspendLayout(); this.tlpControllers.SuspendLayout(); @@ -442,7 +443,7 @@ this.tpgAdvanced.Controls.Add(this.tableLayoutPanel2); this.tpgAdvanced.Location = new System.Drawing.Point(4, 22); this.tpgAdvanced.Name = "tpgAdvanced"; - this.tpgAdvanced.Size = new System.Drawing.Size(362, 313); + this.tpgAdvanced.Size = new System.Drawing.Size(362, 216); this.tpgAdvanced.TabIndex = 5; this.tpgAdvanced.Text = "Advanced"; this.tpgAdvanced.UseVisualStyleBackColor = true; @@ -452,13 +453,15 @@ this.tableLayoutPanel2.ColumnCount = 1; this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel2.Controls.Add(this.grpDisplayInput, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.chkHideMousePointerForZapper, 0, 1); this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel2.Name = "tableLayoutPanel2"; - this.tableLayoutPanel2.RowCount = 2; + this.tableLayoutPanel2.RowCount = 3; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.Size = new System.Drawing.Size(362, 313); + this.tableLayoutPanel2.Size = new System.Drawing.Size(362, 216); this.tableLayoutPanel2.TabIndex = 0; // // grpDisplayInput @@ -583,6 +586,16 @@ this.cboDisplayInputPosition.Size = new System.Drawing.Size(121, 21); this.cboDisplayInputPosition.TabIndex = 1; // + // chkHideMousePointerForZapper + // + this.chkHideMousePointerForZapper.Checked = false; + this.chkHideMousePointerForZapper.Dock = System.Windows.Forms.DockStyle.Fill; + this.chkHideMousePointerForZapper.Location = new System.Drawing.Point(0, 96); + this.chkHideMousePointerForZapper.Name = "chkHideMousePointerForZapper"; + this.chkHideMousePointerForZapper.Size = new System.Drawing.Size(362, 23); + this.chkHideMousePointerForZapper.TabIndex = 2; + this.chkHideMousePointerForZapper.Text = "Hide mouse pointer when using zapper"; + // // frmInputConfig // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -663,5 +676,6 @@ private System.Windows.Forms.Label lblCartridge; private System.Windows.Forms.ComboBox cboCartridge; private System.Windows.Forms.Button btnSetupCartridge; + private Controls.ctrlRiskyOption chkHideMousePointerForZapper; } } \ No newline at end of file diff --git a/GUI.NET/Forms/Config/frmInputConfig.cs b/GUI.NET/Forms/Config/frmInputConfig.cs index d212dac9..8dd1fba6 100644 --- a/GUI.NET/Forms/Config/frmInputConfig.cs +++ b/GUI.NET/Forms/Config/frmInputConfig.cs @@ -43,6 +43,7 @@ namespace Mesen.GUI.Forms.Config AddBinding("DisplayInputPort4", chkDisplayPort4); AddBinding("DisplayInputPosition", cboDisplayInputPosition); AddBinding("DisplayInputHorizontally", chkDisplayInputHorizontally); + AddBinding("HideMousePointerForZapper", chkHideMousePointerForZapper); //Sort expansion port dropdown alphabetically, but keep the "None" option at the top SortDropdown(cboExpansionPort, ResourceHelper.GetEnumText(InteropEmu.ExpansionPortDevice.None));