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 / Right mouse click

Author
Message
Kerl
User Banned
Posted: 11th Jul 2012 06:45
I am trying to use the right mouse click button for my game. Whenever I right mouse click it performs the left mouse click command.



The code structure works for all other buttons (left mouse click and space bar). So I singled out the problem to be identifying this specific if statement.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 11th Jul 2012 17:19
look into mouse states I believe...

sorry if that does not help much but in DBP we check for erm -1 0 1 2 If I remember correctly...

Kerl
User Banned
Posted: 11th Jul 2012 17:41
"The left button is assigned a value of 1. The right button is assigned a value of 2."

But it doesn't seem to work the way I have it set up.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 11th Jul 2012 18:11
in DBP



something like that... inside the loop...

so perhaps look for the same structure for GDK

Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 11th Jul 2012 18:52
If you press more than one button at the same time they will add up, ie. left + right button down will have dbMouseClick() return 3.
Is it possible that your mouse has some extra buttons and that one of these are accidentally activated when clicking the right one as well?

You should be able to check if the right mouse button is down (along with zero or more other keys) like so:



"Why do programmers get Halloween and Christmas mixed up?"
Kerl
User Banned
Posted: 12th Jul 2012 06:10
I figured out the problem, my first if statement said if dbMouseClick(), simply changing it to if(dbMouseClick() == 1) let the rest of the if statements run.

Login to post a reply

Server time is: 2024-04-24 09:10:26
Your offset time is: 2024-04-24 09:10:26