You can read the mouse buttons like this -
Code:
#include <iostream>
#include <windows.h>
using namespace std;
int main() {
INPUT_RECORD ir;
DWORD read;
HANDLE h = GetStdHandle(STD_INPUT_HANDLE);
SetConsoleMode(h, ENABLE_PROCESSED_INPUT | ENABLE_MOUSE_INPUT);
while(1)
{
FlushConsoleInputBuffer(h);
ReadConsoleInput(h,&ir,1,&read);
if(ir.Event.MouseEvent.dwButtonState&FROM_LEFT_1ST_BUTTON_PRESSED)
cout << "left button" << endl;
}
return 0;
}
**Note - the only way I could get this to work properly was either running the console full screen or disabling QuickEdit Mode from the console properties.