I'm working on a pre-existing codebase and I'm looking to have the user type any 1-2 digits followed by the enter key at any time during the code being run and pass that number to a function. Currently, user input is handled like so:
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
switch (message)
{
case WM_KEYDOWN:
Engine::GetInstance()->GetInput()->GetKeyboard()->SetKeyPressed(static_cast<int>(wParam));
break;
//snip
Now, I'm not sure of a few things,
a) Why would the keypressed be passed as an integer rather than a character?
b) What would be the result of "F1" being sent in this case aaand
c) How can I use this to read in a 1-2 digit number and pass that only when enter is pressed?