Question about KeyDown/Up events
Hey.
So I don't really understand the Noesis::Key enum and what it's expecting to be sent to it. I'm trying to implement the Noesis::IView::KeyDown/Up calls from the MessageLoop's WM_KEYDOWN/WM_KEYUP messages. From those I can get the virtual_key, scan_code and some other stuff. But nothing seems to be mapping appropriately to the Key enum expected by Noesis. Is there any remapping function hidden somewhere or what are we supposed to be doing here? Currently all normal ascii input on the keyboard works fine by simply passing the virtual_key to KeyDown (for some reason, since they absolutely don't match?), Then calling Char on WM_CHAR and then KeyUp on WM_KEYUP. But none of the other keys work, like backspace, return, arrows etc etc.
So I don't really understand the Noesis::Key enum and what it's expecting to be sent to it. I'm trying to implement the Noesis::IView::KeyDown/Up calls from the MessageLoop's WM_KEYDOWN/WM_KEYUP messages. From those I can get the virtual_key, scan_code and some other stuff. But nothing seems to be mapping appropriately to the Key enum expected by Noesis. Is there any remapping function hidden somewhere or what are we supposed to be doing here? Currently all normal ascii input on the keyboard works fine by simply passing the virtual_key to KeyDown (for some reason, since they absolutely don't match?), Then calling Char on WM_CHAR and then KeyUp on WM_KEYUP. But none of the other keys work, like backspace, return, arrows etc etc.
Re: Question about KeyDown/Up events
I recommend having a look at our windows implementation for this (Win32Display.cpp):
Code: Select all
case WM_KEYDOWN:
{
if (wParam <= 0xff && mKeyTable[wParam] != 0)
{
mKeyDown(this, (Key)mKeyTable[wParam]);
}
return false;
}
case WM_KEYUP:
{
if (wParam <= 0xff && mKeyTable[wParam] != 0)
{
mKeyUp(this, (Key)mKeyTable[wParam]);
}
return false;
}
case WM_CHAR:
{
mChar(this, (uint32_t)wParam);
return false;
}
Who is online
Users browsing this forum: No registered users and 36 guests