Mouse Input
Author |
Message |
Mr.Begebies
|
Posted: Mon Oct 20, 2003 4:31 pm Post subject: Mouse Input |
|
|
I'm confused on how to exactly read mouse input using console functions. Can anyone give a brief example?
Thanks. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Mon Oct 20, 2003 4:54 pm Post subject: (No subject) |
|
|
I doubt you can even read mouse input using console functions but I could be wrong. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Mr.Begebies
|
Posted: Mon Oct 20, 2003 6:39 pm Post subject: (No subject) |
|
|
I figured out how to do it in opengl. Heres the code for anyone who has a similar question:
code: |
LRESULT CALLBACK WndProc (HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_CREATE:
return 0;
case WM_CLOSE:
PostQuitMessage (0);
return 0;
case WM_DESTROY:
return 0;
//***Monitors mouse click***
//Ex: WM_LBUTTONDOWN
case WM_MOUSEWHEEL:
//*Actions go here*
return 0;
//***
case WM_KEYDOWN:
switch (wParam)
{
case VK_ESCAPE:
PostQuitMessage(0);
return 0;
}
return 0;
default:
return DefWindowProc (hWnd, message, wParam, lParam);
}
}
|
This function is found near the bottom of your opengl file, you just need to add the part in the commented area. As for 'WM_MOUSEWHEEL' part, thats just the code indicating the mouse event.
A good website, and really, the only website to find a full documentation of C++ and opengl commands, is at http://msdn.microsoft.com/library/ |
|
|
|
|
|
Dan
|
Posted: Mon Oct 20, 2003 10:08 pm Post subject: (No subject) |
|
|
you can get mouse input in console but you need speicale lib file. i think one comes with the borad land comiplers. |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
|
|