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 / [HELP] C++ right click function

Author
Message
Sausen Kenny
15
Years of Service
User Offline
Joined: 4th Oct 2008
Location:
Posted: 5th Oct 2008 14:43
i can hardly explain it logically
but please have a look at my code
i just need a function that calls mouse2 to do
this part of code>>>>



//here's my code for scope zooming
if(dbKeyState(20) == 1) // this is the code that needs to be change
{
dbSetCameraFOV( 0 , 25.0f) ; zoom Camera
}
else
{
dbSetCameraFOV( 0 , 62.0f) ; // default Camera
}


well, this is not a good code for an FPS game
it needs to be in MOUSE2 or MOUSE right click....

if the code for calling mouse1 or mouse left click is this

dbMouseClick()

then what's mouse2??


thanks, Sausen
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 5th Oct 2008 15:58
Read the instructions again. dbMouseClick() can return a combination of value. If the left button is down it returns 1. If the right button is down it returns 2. If the third button is held down it returns 4 and the fourth button returns 8. Your return value can contain the additive value of any of these. The values assigned are bit values within the integer. Look at using the and operator to test for any of these positions to be 1 or 0.

Look elsewhere in this forum for my Mouse class. It's source should give examples of testing like this or feel free to use the class itself.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Sausen Kenny
15
Years of Service
User Offline
Joined: 4th Oct 2008
Location:
Posted: 6th Oct 2008 08:21
thanks lilith

Login to post a reply

Server time is: 2024-09-30 07:22:19
Your offset time is: 2024-09-30 07:22:19