Commit 1a37853f authored by hybrid's avatar hybrid

Fixed key input for composed characters.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@986 dfc29bdd-3216-0410-991c-e03cc46cb475
parent b523d0a5
...@@ -226,30 +226,11 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) ...@@ -226,30 +226,11 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
return 0; return 0;
case WM_KEYDOWN: case WM_KEYDOWN:
{
event.EventType = irr::EET_KEY_INPUT_EVENT;
event.KeyInput.Key = (irr::EKEY_CODE)wParam;
event.KeyInput.PressedDown = true;
dev = getDeviceFromHWnd(hWnd);
WORD KeyAsc=0;
GetKeyboardState(allKeys);
ToAscii(wParam,lParam,allKeys,&KeyAsc,0);
event.KeyInput.Shift = ((allKeys[VK_SHIFT] & 0x80)!=0);
event.KeyInput.Control = ((allKeys[VK_CONTROL] & 0x80)!=0);
event.KeyInput.Char = KeyAsc; //KeyAsc >= 0 ? KeyAsc : 0;
if (dev)
dev->postEventFromUser(event);
return 0;
}
case WM_KEYUP: case WM_KEYUP:
{ {
event.EventType = irr::EET_KEY_INPUT_EVENT; event.EventType = irr::EET_KEY_INPUT_EVENT;
event.KeyInput.Key = (irr::EKEY_CODE)wParam; event.KeyInput.Key = (irr::EKEY_CODE)wParam;
event.KeyInput.PressedDown = false; event.KeyInput.PressedDown = (message==WM_KEYDOWN);
dev = getDeviceFromHWnd(hWnd); dev = getDeviceFromHWnd(hWnd);
WORD KeyAsc=0; WORD KeyAsc=0;
...@@ -258,7 +239,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) ...@@ -258,7 +239,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
event.KeyInput.Shift = ((allKeys[VK_SHIFT] & 0x80)!=0); event.KeyInput.Shift = ((allKeys[VK_SHIFT] & 0x80)!=0);
event.KeyInput.Control = ((allKeys[VK_CONTROL] & 0x80)!=0); event.KeyInput.Control = ((allKeys[VK_CONTROL] & 0x80)!=0);
event.KeyInput.Char = KeyAsc; //KeyAsc >= 0 ? KeyAsc : 0; event.KeyInput.Char = (KeyAsc & 0x00ff); //KeyAsc >= 0 ? KeyAsc : 0;
if (dev) if (dev)
dev->postEventFromUser(event); dev->postEventFromUser(event);
......
Markdown is supported
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