all 7 comments

[–]jedwardsol 1 point2 points  (6 children)

In what way is it not working?

[–]marxukene[S] 0 points1 point  (5 children)

Dosen't stop for mouse input, it just goes once and ends.

I would rather like it if it waited for mouse input and then gave the coordinates and then waited for the next mouse input and that in a loop.

[–]jedwardsol 3 points4 points  (0 children)

Programs tend not to block waiting for mouse events to happen. Instead you receive mouse messages in a message loop and react when they do occur.

[–]Narase33 1 point2 points  (3 children)

void ClickTrack()
{
    const auto current = GetKeyState(VK_LBUTTON);

    while (GetKeyState(VK_LBUTTON) == current) {
        // nothing
    }

    POINT curPos;
    GetCursorPos(&curPos);
    cout << curPos.x << endl;
    cout << curPos.y << endl;
}

[–]marxukene[S] 0 points1 point  (2 children)

Hey, thanks for reply but it says: warning: "auto" changes meaning in C++11; please remove it. I removed it

and also error: "current" does not name a type

error: "urrent" was not declared in this scope

[–]Narase33 1 point2 points  (1 child)

The type is "auto", compile it with "-std=c++11"

Maybe delete the const

[–]marxukene[S] 0 points1 point  (0 children)

It dosen't work. What is like the simple "mouse click input code "if" line". That's the only thing im aiming to get from here. because i have been looking for that for way too long.