Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Mouse Wheel?

Author
Message
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 9th Oct 2008 22:41
How do I check if the mouse wheel is being rotated?

dbMouseclick() doesn't seem to have the ability.

Quote: "
dbMouseClick
This command will return a value if a mouse button is pressed. The integer return value will depend on which mouse button has been pressed. A mouse can have up to four buttons, and each one can be detected using this command. Each button is assigned a value. The left button is assigned a value of 1. The right button is assigned a value of 2. Buttons three and four are assigned values of 4 and 8 respectively. When more than one button is pressed, the value of the buttons are added to produce a combined value you can check for.

Syntax
int dbMouseClick ( void ) "
SushiBox
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Ohio
Posted: 9th Oct 2008 22:57


Button 3 = mouse wheel.

www.Helios-Online.net
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 10th Oct 2008 00:02 Edited at: 10th Oct 2008 00:04
Quote: "Button 3 = mouse wheel."


Not correct. The mouse wheel is read as the Z-position of the mouse. Button 3 is a button or it may represent the mouse wheel being pressed if that feature exists. But it doesn't reflect the wheel rotating.

My mouse at home has two extra buttons on the sides of the mouse that represent buttons 3 and 4.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
go2none
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location: London
Posted: 10th Oct 2008 00:07
if (dbMouseClick() == 1) - LMB
if (dbMouseClick() == 2) - RMB
if (dbMouseClick() == 3) - LMB + RMB

dbMouseMoveZ() is a scroll wheel as far as I know.

I remember having problems with this little bugger. I had to:

int mmz = dbMouseMoveZ();

to make it work.
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 10th Oct 2008 18:57
see:
http://darkgdk.wikia.com/wiki/DbMouseMoveZ
Jonas
19
Years of Service
User Offline
Joined: 10th Aug 2005
Location: What day is it?
Posted: 11th Oct 2008 08:45
dbMouseMoveZ() and dbMouseZ() return the movement and position of the scroll wheel in intervals of 120

P4 3.4ghz/2gb RAM (+PF=24gb)/GeForce 6200 A-LE 256meg AGP8x (Altered for 16pipelines, 768mb forced TurboCache-ish)/WinXP Pro/74gb WDRaptor(SATA,OS)/3x 200gb WDCaviar(IDE)/250gb WDCaviar SE16(SATA)
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 11th Oct 2008 15:37
Jonas is right. Also, rather than just using dbMouseMoveZ( ) in your loop, make sure you store it in a variable at the beginning of the loop then use that variable instead, because dbMouseMoveZ( ) can only be called once per loop. Also make the variable a float, so you can divide the value if you want because 120 seems a little big for most uses.

Login to post a reply

Server time is: 2024-11-25 03:31:16
Your offset time is: 2024-11-25 03:31:16