попробуй это...
procedure TMyForm.Button1Click(Sender: TObject); VarKeyState : TKeyboardState;beginGetKeyboardState(KeyState);if (KeyState[VK_NUMLOCK] = 0) thenKeyState[VK_NUMLOCK] := 1elseKeyState[VK_NUMLOCK] := 0;SetKeyboardState(KeyState);end; |
Для Caps Lock замените VK_NUMLOCK на VK_CAPITAL. [000144]