diff --git a/Source/Core/Actions/Action.cs b/Source/Core/Actions/Action.cs index 8f9f9899300f91a75928ec6dbed30ab1a9b71db0..08dedecc220cf059a9137b36ad2e53ffb8e2683e 100755 --- a/Source/Core/Actions/Action.cs +++ b/Source/Core/Actions/Action.cs @@ -162,6 +162,16 @@ namespace CodeImp.DoomBuilder.Actions // Make string representation return ctrlprefix + "ScrollUp"; + case (int)SpecialKeys.MScrollLeft: + + // + return ctrlprefix + "ScrollLeft"; + + case (int)SpecialKeys.MScrollRight: + + // + return ctrlprefix + "ScrollRight"; + // Keys that would otherwise have odd names case (int)Keys.Oemtilde: return ctrlprefix + "~"; case (int)Keys.OemMinus: return ctrlprefix + "-"; diff --git a/Source/Core/Actions/SpecialKeys.cs b/Source/Core/Actions/SpecialKeys.cs index b9dd201df548f2057370d80fba301b91aac327fc..e5f8f7b767aebdb15308f03adbc2d9fb8d236843 100755 --- a/Source/Core/Actions/SpecialKeys.cs +++ b/Source/Core/Actions/SpecialKeys.cs @@ -24,5 +24,7 @@ namespace CodeImp.DoomBuilder.Actions { MScrollUp = 65530, MScrollDown = 65531, + MScrollLeft = 65532, + MScrollRight = 65533 } } diff --git a/Source/Core/General/General.cs b/Source/Core/General/General.cs index 4c192910e411b612bad1baf504182c8b929b39f2..2a6b7e3d89f4e78b886f63f69f4ff70f2fbb51e3 100755 --- a/Source/Core/General/General.cs +++ b/Source/Core/General/General.cs @@ -101,7 +101,8 @@ namespace CodeImp.DoomBuilder // SendMessage API internal const int WM_USER = 0x400; internal const int WM_SYSCOMMAND = 0x112; - internal const int SC_KEYMENU = 0xF100; + internal const int WM_MOUSEHWHEEL = 0x020E; // [ZZ] + internal const int SC_KEYMENU = 0xF100; internal const int CB_SETITEMHEIGHT = 0x153; //internal const int CB_SHOWDROPDOWN = 0x14F; //internal const int EM_GETSCROLLPOS = WM_USER + 221; diff --git a/Source/Core/Properties/AssemblyInfo.cs b/Source/Core/Properties/AssemblyInfo.cs index 0c24732c0cba6347cfaaf299ed5868d55da77337..d689871dad2dde83b12726a91791b1dc937eef52 100755 --- a/Source/Core/Properties/AssemblyInfo.cs +++ b/Source/Core/Properties/AssemblyInfo.cs @@ -30,6 +30,6 @@ using CodeImp.DoomBuilder; // Build Number // Revision // -[assembly: AssemblyVersion("2.3.0.2952")] +[assembly: AssemblyVersion("2.3.0.2955")] [assembly: NeutralResourcesLanguageAttribute("en")] -[assembly: AssemblyHash("814fdd9")] +[assembly: AssemblyHash("480a115")] diff --git a/Source/Core/Windows/MainForm.cs b/Source/Core/Windows/MainForm.cs index 01dd52fc86de99d0e10f4b6ff467ad5882d8250b..8dd607c36946e5ebcfb6fca0e10a20ef2ef4aa7e 100755 --- a/Source/Core/Windows/MainForm.cs +++ b/Source/Core/Windows/MainForm.cs @@ -1361,6 +1361,29 @@ namespace CodeImp.DoomBuilder.Windows // Let the base know base.OnMouseWheel(e); } + + // [ZZ] + private void OnMouseHWheel(int delta) + { + int mod = 0; + if (alt) mod |= (int)Keys.Alt; + if (shift) mod |= (int)Keys.Shift; + if (ctrl) mod |= (int)Keys.Control; + + // Scrollwheel left? + if (delta < 0) + { + General.Actions.KeyPressed((int)SpecialKeys.MScrollLeft | mod); + General.Actions.KeyReleased((int)SpecialKeys.MScrollLeft | mod); + } + else if (delta > 0) + { + General.Actions.KeyPressed((int)SpecialKeys.MScrollRight | mod); + General.Actions.KeyReleased((int)SpecialKeys.MScrollRight | mod); + } + + // base? what base? + } // When a key is pressed private void MainForm_KeyDown(object sender, KeyEventArgs e) @@ -4111,6 +4134,12 @@ namespace CodeImp.DoomBuilder.Windows base.WndProc(ref m); } break; + + case General.WM_MOUSEHWHEEL: + int delta = m.WParam.ToInt32() >> 16; + OnMouseHWheel(delta); + m.Result = new IntPtr(delta); + break; default: // Let the base handle the message diff --git a/Source/Core/Windows/PreferencesForm.cs b/Source/Core/Windows/PreferencesForm.cs index 55b47c971ca1789c424f4f28c65cb7e44eaae042..25c1cca2c85a87846eff8a7a87d1fb13195d1b2b 100755 --- a/Source/Core/Windows/PreferencesForm.cs +++ b/Source/Core/Windows/PreferencesForm.cs @@ -596,7 +596,9 @@ namespace CodeImp.DoomBuilder.Windows { actioncontrol.Items.Add(new KeyControl(SpecialKeys.MScrollUp, "ScrollUp")); actioncontrol.Items.Add(new KeyControl(SpecialKeys.MScrollDown, "ScrollDown")); - } + actioncontrol.Items.Add(new KeyControl(SpecialKeys.MScrollLeft, "ScrollLeft")); + actioncontrol.Items.Add(new KeyControl(SpecialKeys.MScrollRight, "ScrollRight")); + } //mxd. Alt if(a.AllowMouse && !a.DisregardAlt) @@ -611,7 +613,9 @@ namespace CodeImp.DoomBuilder.Windows { actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollUp | (int)Keys.Alt, "Alt+ScrollUp")); actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollDown | (int)Keys.Alt, "Alt+ScrollDown")); - } + actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollLeft | (int)Keys.Alt, "Alt+ScrollLeft")); + actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollRight | (int)Keys.Alt, "Alt+ScrollRight")); + } //Ctrl if(a.AllowMouse && !a.DisregardControl) @@ -627,7 +631,9 @@ namespace CodeImp.DoomBuilder.Windows { actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollUp | (int)Keys.Control, "Ctrl+ScrollUp")); actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollDown | (int)Keys.Control, "Ctrl+ScrollDown")); - } + actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollLeft | (int)Keys.Control, "Ctrl+ScrollLeft")); + actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollRight | (int)Keys.Control, "Ctrl+ScrollRight")); + } //Shift if(a.AllowMouse && !a.DisregardShift) @@ -642,7 +648,9 @@ namespace CodeImp.DoomBuilder.Windows { actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollUp | (int)Keys.Shift, "Shift+ScrollUp")); actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollDown | (int)Keys.Shift, "Shift+ScrollDown")); - } + actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollLeft | (int)Keys.Shift, "Shift+ScrollLeft")); + actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollRight | (int)Keys.Shift, "Shift+ScrollRight")); + } //mxd. Alt-Shift if(a.AllowMouse && !a.DisregardShift && !a.DisregardAlt) @@ -657,7 +665,9 @@ namespace CodeImp.DoomBuilder.Windows { actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollUp | (int)Keys.Shift | (int)Keys.Alt, "Alt+Shift+ScrollUp")); actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollDown | (int)Keys.Shift | (int)Keys.Alt, "Alt+Shift+ScrollDown")); - } + actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollLeft | (int)Keys.Shift | (int)Keys.Alt, "Alt+Shift+ScrollLeft")); + actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollRight | (int)Keys.Shift | (int)Keys.Alt, "Alt+Shift+ScrollRight")); + } //mxd. Ctrl-Alt if(a.AllowMouse && !a.DisregardAlt && !a.DisregardControl) @@ -672,7 +682,9 @@ namespace CodeImp.DoomBuilder.Windows { actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollUp | (int)Keys.Control | (int)Keys.Alt, "Ctrl+Alt+ScrollUp")); actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollDown | (int)Keys.Control | (int)Keys.Alt, "Ctrl+Alt+ScrollDown")); - } + actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollLeft | (int)Keys.Control | (int)Keys.Alt, "Ctrl+Alt+ScrollLeft")); + actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollRight | (int)Keys.Control | (int)Keys.Alt, "Ctrl+Alt+ScrollRight")); + } //Ctrl-Shift if(a.AllowMouse && !a.DisregardShift && !a.DisregardControl) @@ -687,7 +699,9 @@ namespace CodeImp.DoomBuilder.Windows { actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollUp | (int)Keys.Shift | (int)Keys.Control, "Ctrl+Shift+ScrollUp")); actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollDown | (int)Keys.Shift | (int)Keys.Control, "Ctrl+Shift+ScrollDown")); - } + actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollLeft | (int)Keys.Shift | (int)Keys.Control, "Ctrl+Shift+ScrollLeft")); + actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollRight | (int)Keys.Shift | (int)Keys.Control, "Ctrl+Shift+ScrollRight")); + } //mxd. Ctrl-Alt-Shift if(a.AllowMouse && !a.DisregardShift && !a.DisregardControl && !a.DisregardAlt) @@ -702,7 +716,9 @@ namespace CodeImp.DoomBuilder.Windows { actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollUp | (int)Keys.Shift | (int)Keys.Control | (int)Keys.Alt, "Ctrl+Alt+Shift+ScrollUp")); actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollDown | (int)Keys.Shift | (int)Keys.Control | (int)Keys.Alt, "Ctrl+Alt+Shift+ScrollDown")); - } + actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollLeft | (int)Keys.Shift | (int)Keys.Control | (int)Keys.Alt, "Ctrl+Alt+Shift+ScrollLeft")); + actioncontrol.Items.Add(new KeyControl((int)SpecialKeys.MScrollRight | (int)Keys.Shift | (int)Keys.Control | (int)Keys.Alt, "Ctrl+Alt+Shift+ScrollRight")); + } } // Item selected diff --git a/Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs b/Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs index 2e06b14c57e2c89a8dcc529621d4801c74eaf4ff..d0045603d874bf0583412166acfd2fb0b89c4668 100755 --- a/Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs +++ b/Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Resources; // Build Number // Revision // -[assembly: AssemblyVersion("2.3.0.2952")] +[assembly: AssemblyVersion("2.3.0.2955")] [assembly: NeutralResourcesLanguageAttribute("en")]