1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 10:52:46 +00:00

Merge pull request #83 from Hoikas/moar-input

More input fixes
This commit is contained in:
Branan Purvine-Riley
2011-10-22 19:52:46 -07:00
2 changed files with 7 additions and 10 deletions

View File

@ -173,19 +173,16 @@ void plKeyboardDevice::HandleKeyEvent(plOSMsg message, plKeyDef key, bool bKeyDo
if (key == KEY_SHIFT)
{
fShiftKeyDown = bKeyDown;
// return;
}
if (key == KEY_CTRL)
{
fCtrlKeyDown = bKeyDown;
// return;
}
if (key == KEY_CAPSLOCK)
{
// Keyboards toggle the light on key-down, so I'm going with that.
if (bKeyDown && !bKeyRepeat)
if (!bKeyRepeat)
{
fCapsLockLock = !fCapsLockLock;
fCapsLockLock = (GetKeyState(KEY_CAPSLOCK) & 1) == 1;
plAvatarInputInterface::GetInstance()->ForceAlwaysRun(fCapsLockLock);
}
}
@ -206,7 +203,8 @@ void plKeyboardDevice::HandleWindowActivate(bool bActive, HWND hWnd)
{
if (bActive)
{
fCtrlKeyDown = false;
// Refresh the caps lock state
HandleKeyEvent(KEYDOWN, KEY_CAPSLOCK, nil, false);
}
else
{

View File

@ -297,15 +297,14 @@ void plInputManager::HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM
Wparam == KEY_TAB || Wparam == 0x0D)
break;
UINT scan = Lparam >> 16;
scan = MapVirtualKeyEx(scan, MAPVK_VSC_TO_VK, nil);
if (scan == 0) scan = -1;
BYTE scan = Lparam >> 16;
UINT vkey = MapVirtualKey(scan, MAPVK_VSC_TO_VK);
bExtended = Lparam >> 24 & 1;
hsBool bRepeat = ((Lparam >> 29) & 0xf) != 0;
bool down = !(Lparam >> 31);
for (int i=0; i<fInputDevices.Count(); i++)
fInputDevices[i]->HandleKeyEvent( CHAR_MSG, (plKeyDef)scan, down, bRepeat, (wchar_t)Wparam );
fInputDevices[i]->HandleKeyEvent( CHAR_MSG, (plKeyDef)vkey, down, bRepeat, (wchar_t)Wparam );
}
break;
case MOUSEWHEEL: