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.

DarkBASIC Discussion / weird mouse click glitch

Author
Message
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 16th May 2009 16:18
Hello!

As you all may know:

Left mouse button = mouseclick()=1
right mouse button= mouseclick()=2
middle mouse button=mouseclick()=4



Now if you run the next code displayed beneath, you will notice that the middle mouse button will equal 0 when it is pressed. This happens when the program is in windowed mode. Why?



How can I fix this? Is this just my mouse?

TheComet

Peachy, and the Chaos of the Gems

That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 16th May 2009 18:50
it may have disabled the middle button because some windows will need to be scrolled to see

so windowed mode disables the middle button from use in code, i guess

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 16th May 2009 19:02
Quote: "so windowed mode disables the middle button from use in code, i guess"


Or, it could be that windows uses a different numbering conventions (its windows, it doesn't need to make sense) and since it is windowed, the Windows method overrules the DBC method.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 16th May 2009 19:14
So how do I return a value that windows detected?

Peachy, and the Chaos of the Gems

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th May 2009 19:46
It's not exactly a glitch, more like how DB was coded (I think). When it was written I think the most common mouse had 2 buttons and for DBC to read a third button, they coded the result as
button1 | button2

That means if button1=1 and button2=2, then the result is 3 if both are pressed at the same time. I think this carried over as a stand in for button 3. Anyway, with a middle mouse button, the result is 4 so it doesn't jive well with 3 being returned from the DBC function mouseclick().

The solution, the windows api - works in both fullscreen and windowed mode:



Enjoy your day.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 16th May 2009 22:14
And yet another dll to add to my program Thanks for saving my day, Latch!

TheComet

Peachy, and the Chaos of the Gems

Login to post a reply

Server time is: 2025-05-14 16:33:12
Your offset time is: 2025-05-14 16:33:12