G
procedure TMyForm.Button1Click(Sender: TObject);
Var
KeyState: TKeyboardState;
begin
GetKeyboardState(KeyState);
if (KeyState[VK_NUMLOCK] = 0) then
KeyState[VK_NUMLOCK] := 1
else
KeyState[VK_NUMLOCK] := 0;
SetKeyboardState(KeyState);
end;
Можно сделать с помощью функции keybd_event:Remarks
Because the SetKeyboardState function alters the input state of the calling thread and not the global input state of the system, an application cannot use SetKeyboardState to set the NUM LOCK, CAPS LOCK, or SCROLL LOCK indicator lights on the keyboard.
procedure TForm1.Button1Click(Sender: TObject);
Var
KeyState: TKeyboardState;
begin
GetKeyboardState(KeyState);
if (KeyState[VK_CAPITAL] = 0) then
begin
keybd_event(VK_CAPITAL, MapVirtualKey(VK_CAPITAL, 0), 0, 0);//нажать клавишу
Sleep(1);
keybd_event(VK_CAPITAL, MapVirtualKey(VK_CAPITAL, 0), KEYEVENTF_KEYUP, 0);//отпустить клавишу
end;
end;
Взломай свой первый сервер и прокачай скилл — Начни игру на HackerLab