How to simulate the mouse control?

F

flplini

I want to ask how to use C++ to simulate the mouse control?
ex:Let the mouse double-click the left key functions,thanks!
 
P

Phlip

flplini said:
I want to ask how to use C++ to simulate the mouse control?
ex:Let the mouse double-click the left key functions,thanks!

This is a question about your GUI platform (probably Win32). It's not a
question about C++ because your platform supports many languages, and so
there's nothing C++ specific in the answer.

This newsgroup is only qualified to answer questions about the raw C++
language itself. (Always read a newsgroup before posting, and you might have
noticed our reaction to off-topic posts!) You will get the best results on a
newsgroup with win32, programming, and possibly gui in its name.
 
W

W Marsh

I want to ask how to use C++ to simulate the mouse control?
ex:Let the mouse double-click the left key functions,thanks!

void SimulateMouseClick(int x, int y, MouseButton button);
 
B

BobR

Gernot Frisch wrote in message said:
What is a mouse?

A small rodent!!
So, a "mouse control" could just be a mousetrap.

Must be one smart mouse if it knows how to double-click the left key
functions [1]!
If it's that smart, it wouldn't be a matter of "Let", but, how would you stop
him!

OP: Have your mouse post some C++ code, I'd like to see what he's working on.

Real answer:
std::istringstream mouse("126 211 0 250 345 2 111 123 1");
int Mx(0), My(0), Button(0); // yeah, bad 'style'. Put on separate lines.
while( mouse >> Mx >> My >> Button ){
if( Button == 2 ){
std::cout << "Mx=" << Mx << " My=" << My <<std::endl;
} // if(2)
} // while(mouse)

[1] - wonder if he means "function keys" (F1-F12)?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top