CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2010

    detecting keystrokes

    is there any other way to detect key strokes than in this function
    LRESULT CALLBACK MainProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
          switch (message)
                case WM_KEYDOWN:
    i tried directinput but this:
    if(inputkeyboard->GetDeviceState(256, &keystate) == DI_OK)
    		if(keystate[DIK_ESCAPE] & 0x80)
    works as GetAsyncKeyState, and i need to detect only one stroke

  2. #2
    Join Date
    Dec 2010

    Re: detecting keystrokes

    i figure out GetKeyboardStateand get GetKeyState functions, im using loword to get "the key is toggled", it works but i would like to know what methods professional developers use (im building a "game" )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.