Author Topic: Check for mouse wheel scroll  (Read 2208 times)

eric22222

  • Fanatic
  • ***
  • Posts: 174
    • View Profile
    • Eric Online
    • Email
Check for mouse wheel scroll
« 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.

eric22222

  • Fanatic
  • ***
  • Posts: 174
    • View Profile
    • Eric Online
    • Email
Re: Check for mouse wheel scroll
« Reply #1 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 :)