Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Mouse Input
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Mr.Begebies




PostPosted: 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. Very Happy
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Mon Oct 20, 2003 4:54 pm   Post subject: (No subject)

I doubt you can even read mouse input using console functions Confused but I could be wrong.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Mr.Begebies




PostPosted: 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




PostPosted: 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!
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: