Commit d7131ff2 authored by Gargaj's avatar Gargaj
Browse files

separate wm_char and wm_keydown

parent e780a067
...@@ -164,13 +164,16 @@ void main() ...@@ -164,13 +164,16 @@ void main()
else if (bShowGui) else if (bShowGui)
{ {
bool consumed = false; bool consumed = false;
if (Renderer::keyEventBuffer[i].scanCode)
{
mShaderEditor.KeyDown( mShaderEditor.KeyDown(
iswalpha(Renderer::keyEventBuffer[i].scanCode) ? towupper(Renderer::keyEventBuffer[i].scanCode) : Renderer::keyEventBuffer[i].scanCode, iswalpha(Renderer::keyEventBuffer[i].scanCode) ? towupper(Renderer::keyEventBuffer[i].scanCode) : Renderer::keyEventBuffer[i].scanCode,
Renderer::keyEventBuffer[i].shift, Renderer::keyEventBuffer[i].shift,
Renderer::keyEventBuffer[i].ctrl, Renderer::keyEventBuffer[i].ctrl,
Renderer::keyEventBuffer[i].alt, Renderer::keyEventBuffer[i].alt,
&consumed); &consumed);
if (!consumed) }
if (!consumed && Renderer::keyEventBuffer[i].character)
{ {
char utf8[5] = {0,0,0,0,0}; char utf8[5] = {0,0,0,0,0};
wchar_t utf16[2] = {Renderer::keyEventBuffer[i].character, 0}; wchar_t utf16[2] = {Renderer::keyEventBuffer[i].character, 0};
......
...@@ -114,14 +114,14 @@ namespace Renderer ...@@ -114,14 +114,14 @@ namespace Renderer
keyEventBuffer[keyEventBufferCount].alt = GetAsyncKeyState( VK_LMENU ) || GetAsyncKeyState( VK_RMENU ); keyEventBuffer[keyEventBufferCount].alt = GetAsyncKeyState( VK_LMENU ) || GetAsyncKeyState( VK_RMENU );
keyEventBuffer[keyEventBufferCount].shift = GetAsyncKeyState( VK_LSHIFT ) || GetAsyncKeyState( VK_RSHIFT ); keyEventBuffer[keyEventBufferCount].shift = GetAsyncKeyState( VK_LSHIFT ) || GetAsyncKeyState( VK_RSHIFT );
keyEventBuffer[keyEventBufferCount].scanCode = sciKey; keyEventBuffer[keyEventBufferCount].scanCode = sciKey;
keyEventBuffer[keyEventBufferCount].character = sciKey; keyEventBuffer[keyEventBufferCount].character = 0;
keyEventBufferCount++; keyEventBufferCount++;
} }
//pKeys[wParam] = 1; //pKeys[wParam] = 1;
} break; } break;
case WM_CHAR: case WM_CHAR:
{ {
//if (sciKey) if (wParam >= 32)
{ {
keyEventBuffer[keyEventBufferCount].ctrl = GetAsyncKeyState( VK_LCONTROL ) || GetAsyncKeyState( VK_RCONTROL ); keyEventBuffer[keyEventBufferCount].ctrl = GetAsyncKeyState( VK_LCONTROL ) || GetAsyncKeyState( VK_RCONTROL );
keyEventBuffer[keyEventBufferCount].alt = GetAsyncKeyState( VK_LMENU ) || GetAsyncKeyState( VK_RMENU ); keyEventBuffer[keyEventBufferCount].alt = GetAsyncKeyState( VK_LMENU ) || GetAsyncKeyState( VK_RMENU );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment