+
+bool wxGetKeyState(wxKeyCode key)
+{
+ wxASSERT_MSG(key != WXK_LBUTTON && key != WXK_RBUTTON && key !=
+ WXK_MBUTTON, wxT("can't use wxGetKeyState() for mouse buttons"));
+
+ const LONG vk = wxCharCodeWXToOS2(key);
+ // if the requested key is a LED key, return true if the led is pressed
+ if ( key == WXK_NUMLOCK || key == WXK_CAPITAL || key == WXK_SCROLL )
+ {
+ // low order bit means LED is highlighted and high order one means the
+ // key is down; for compatibility with the other ports return true if
+ // either one is set
+ return ::WinGetKeyState(HWND_DESKTOP, vk) != 0;
+
+ }
+ else // normal key
+ {
+ return IsKeyDown(vk);
+ }
+}
+
+