Search code examples
windowswinapiinputraw-input

Passing Values From Raw Input From Within The Window Procedure


Currently, this is the WM_INPUT case in my Window Procedure (WINDPROC).

case WM_INPUT:
{
    // ... Some code to pull out the input from the message
    if(InputType == Keyboard)
    {
        if(KeyCode == KEY_W)
        {
             // Do Stuff Here
        }
    }
 // And so on...
}

But, I want to be able to do the following...

if(KeyCode == KEY_W)
{
    g_InputManager->PressKey(KEY_W);
}

So that my game engine knows when a key is pressed, I would like to know how to get data in/out of the window procedure, or how to process raw input outside of the window procedure. Thanks in advance.


Solution

  • This was a pretty simple question and I see that now, all I did was make a global class pointer, exposed it to the window procedure, and then used it to push data to the external class.