How detect Mouse wheel direction?

New to Gambas? Post your questions here. No question is too silly or too simple.
Post Reply
iiiypuk.me
Posts: 1
Joined: Thursday 6th April 2023 9:56am

How detect Mouse wheel direction?

Post by iiiypuk.me »

How detect Mouse wheel direction in this event?
Public Sub *_MouseWheel()
  ' ...
End
vuott
Posts: 262
Joined: Wednesday 5th April 2017 6:07pm
Location: European Union

Re: How detect Mouse wheel direction?

Post by vuott »

I point out this page of the wiki of Gambas Italian programmers forum:

https://www.gambas-it.org/wiki/index.ph ... _rotellina
Europaeus sum !

Amare memorentes atque deflentes ad mortem silenter labimur.
User avatar
cogier
Site Admin
Posts: 1125
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: How detect Mouse wheel direction?

Post by cogier »

Hi iiiypuk.me and welcome to the forum. Try the following code: -

Public Sub Form_MouseWheel()

  If Mouse.Delta = 1 Then Print "Rolling forward"
  If Mouse.Delta = -1 Then Print "Rolling backwards"

End
Post Reply