以下全部给你了:<br><br>function GetKeyLock(vcode: Integer):boolean; //获取或设置键盘状态<br> //VK_INSERT VK_CAIPTAL VK_NUMLOCK<br>begin<br>result:=Odd(GetKeyState(vcode));<br>end;<br><br>function SetKeyLock(vcode: Integer; down: Boolean):boolean;<br>begin<br>// if Odd(GetAsyncKeyState(vcode)) <> down then<br> result:=Odd(GetKeyState(vcode));<br> if Odd(GetKeyState(vcode)) <> down then<br> begin<br> keybd_event(vcode, MapVirtualkey(vcode, 0),<br> KEYEVENTF_EXTENDEDKEY, 0);<br> keybd_event(vcode, MapVirtualkey(vcode, 0),<br> KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0);<br> end;<br><br>end;