-
November 14th, 2006, 05:10 AM
#1
Mouse in c++
hey how do u use amouse in c++,is it possible and if yes to what extent,right click??
[/color][glowpurple]The ladder of sucess is never crowded at top:Napolean[/glowpurple]
-
November 14th, 2006, 05:13 AM
#2
What do you mean by "use a mouse"???
C++ is a programming language..
You can write code to take advantage of mouse clicks, mouse movement and everything in between..
Are you talking about your C++ IDE? Then the answer would be it depends on the IDE.. but 99.9% of the time yes you could use the mouse.(unless you're using a console editor like vi or pico (at a console without a mouse))
Peace,
HT
-
November 14th, 2006, 05:40 AM
#3
could u gimme an example or tell me where i cud get some info abt this
[/color][glowpurple]The ladder of sucess is never crowded at top:Napolean[/glowpurple]
-
November 14th, 2006, 06:11 AM
#4
Originally Posted by phoenixmajestic
could u gimme an example or tell me where i cud get some info abt this
About what??? (How about you type with proper spelling and punctuation as well)... There's nothing to tell you.. You still haven't said which you are talking about... If you want to utilize the mouse in a C++ program that you're writing... then go look up documentation based on the graphics libraries and GUI support that you are including...
-
November 14th, 2006, 09:12 AM
#5
Originally Posted by phoenixmajestic
could u gimme an example or tell me where i cud get some info abt this
http://www.lawrencegoetz.com/programs/mousepractice/
Oliver's Law:
Experience is something you don't get until just after you need it.
-
November 14th, 2006, 01:59 PM
#6
-
November 14th, 2006, 04:56 PM
#7
Junior Member
If you wish to use mouse clicks (this just works for clicking anywhere), then there is a way to do it in C++ (this will briefly tell you what to do):
#define KEY_DOWN(key_code)((GetAsyncKeyState(key_code)&0x8000)?1:0)
#define KEY_UP(key_code)((GetAsyncKeyState(key_code)&0x8000)?0:1)
#define KEY_LBUTTON 1
#define KEY_RBUTTON 2
#include <windows.h>
#include <iostream>
using namespace std;
int main()
{
while(1)
{
if(KEY_DOWN(KEY_LBUTTON)){cout<<"You have left mouse clicked"<<endl; Sleep(105);}
if(KEY_DOWN(KEY_RBUTTON)){cout<<"You have right mouse click"<<endl; Sleep(105);}
}
}
However bare in mind that this will work anywhere you click (outside of console, when console is minimised etc).
Hope this helps.
-
November 16th, 2006, 05:39 AM
#8
[/color][glowpurple]The ladder of sucess is never crowded at top:Napolean[/glowpurple]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|