Scrolling Game Development Kit Forum

SGDK Version 2 => Help, Errors, FAQ => Topic started by: eric22222 on 2014-04-26, 01:54:57 PM

Title: Check for mouse wheel scroll
Post by: eric22222 on 2014-04-26, 01:54:57 PM
Is there any method built-in that will let me check if the mouse wheel has been scrolled? IsMouseButtonPressed let's me check if the mouse wheel is clicked, but I'm looking for scroll up/down events.
Title: Re: Check for mouse wheel scroll
Post by: eric22222 on 2014-04-26, 09:04:36 PM
Got a solution: in GameForm.cs, add this line to the InitializeComponent function:

Code: [Select]
this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.MouseWheelHandler);
And add in this function:

Code: [Select]
private void MouseWheelHandler(object sender, System.Windows.Forms.MouseEventArgs e) {
   MessageBox.Show(e.Delta.ToString());
}

Not really built-in, but it works. Bluemonkmn, thanks for making all the classes easy to access :)