From: <tj...@us...> - 2010-07-24 13:35:47
|
Revision: 13507 http://alleg.svn.sourceforge.net/alleg/?rev=13507&view=rev Author: tjaden Date: 2010-07-24 13:35:41 +0000 (Sat, 24 Jul 2010) Log Message: ----------- David Capello problems in Windows when you use Alt-Tab. Sometimes the Alt modifier is kept pressed when you focus the Allegro window. Modified Paths: -------------- allegro/branches/4.4/src/win/wkeybd.c Modified: allegro/branches/4.4/src/win/wkeybd.c =================================================================== --- allegro/branches/4.4/src/win/wkeybd.c 2010-07-24 02:27:25 UTC (rev 13506) +++ allegro/branches/4.4/src/win/wkeybd.c 2010-07-24 13:35:41 UTC (rev 13507) @@ -424,27 +424,13 @@ int key_dinput_acquire(void) { HRESULT hr; - int mask, state; - unsigned char key_state[256]; + BYTE keystate[256]; if (key_dinput_device) { - mask = KB_SCROLOCK_FLAG | KB_NUMLOCK_FLAG | KB_CAPSLOCK_FLAG; - state = 0; - /* Read the current Windows keyboard state */ - GetKeyboardState(key_state); + GetKeyboardState(keystate); + update_shifts(keystate); - if (key_state[VK_SCROLL] & 1) - state |= KB_SCROLOCK_FLAG; - - if (key_state[VK_NUMLOCK] & 1) - state |= KB_NUMLOCK_FLAG; - - if (key_state[VK_CAPITAL] & 1) - state |= KB_CAPSLOCK_FLAG; - - _key_shifts = (_key_shifts & ~mask) | (state & mask); - hr = IDirectInputDevice_Acquire(key_dinput_device); if (FAILED(hr)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |