[OS/2] Bug 430163: Implement GetToggledKeyState, r=pweilbacher

This commit is contained in:
Rich Walsh 2009-06-23 11:26:45 +02:00
Родитель 0800b2905e
Коммит f425574373
2 изменённых файлов: 28 добавлений и 0 удалений

Просмотреть файл

@ -3448,6 +3448,33 @@ void nsWindow::RemoveFromStyle( ULONG style)
} }
} }
// --------------------------------------------------------------------------
NS_IMETHODIMP nsWindow::GetToggledKeyState(PRUint32 aKeyCode, PRBool* aLEDState)
{
PRUint32 vkey;
NS_ENSURE_ARG_POINTER(aLEDState);
switch (aKeyCode) {
case NS_VK_CAPS_LOCK:
vkey = VK_CAPSLOCK;
break;
case NS_VK_NUM_LOCK:
vkey = VK_NUMLOCK;
break;
case NS_VK_SCROLL_LOCK:
vkey = VK_SCRLLOCK;
break;
default:
*aLEDState = PR_FALSE;
return NS_OK;
}
*aLEDState = (::WinGetKeyState(HWND_DESKTOP, vkey) & 1) != 0;
return NS_OK;
}
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// Drag & Drop - Target methods // Drag & Drop - Target methods
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------

Просмотреть файл

@ -173,6 +173,7 @@ class nsWindow : public nsBaseWidget,
NS_IMETHOD Invalidate( const nsIntRect & aRect, PRBool aIsSynchronous); NS_IMETHOD Invalidate( const nsIntRect & aRect, PRBool aIsSynchronous);
NS_IMETHOD Update(); NS_IMETHOD Update();
NS_IMETHOD Scroll( PRInt32 aDx, PRInt32 aDy, nsIntRect *aClipRect); NS_IMETHOD Scroll( PRInt32 aDx, PRInt32 aDy, nsIntRect *aClipRect);
NS_IMETHOD GetToggledKeyState(PRUint32 aKeyCode, PRBool* aLEDState);
// Get a HWND or a HPS. // Get a HWND or a HPS.
virtual void *GetNativeData( PRUint32 aDataType); virtual void *GetNativeData( PRUint32 aDataType);