[Solved] How to change CAPS LOCK status? lazarus / 34-Windows ---------------------------------------------------------------------- loaded · 2022-01-07 05:44 Hi All With the code below, I change the Caps Lock state and switch to Caps Mode. No problem so far, But ; -There is no change in the appearance of the Led light of Caps Lock. -This change only affects my program, other programs in the system are not affected by it. What do you think could be the reason and solution for this? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.FormCreate(Sender: TObject);var  KeyState : TKeyboardState;begin  GetKeyboardState(KeyState);  if (KeyState[VK_CAPITAL] = 0) then  begin  KeyState[VK_CAPITAL] := 1;  SetKeyboardState(KeyState);  end;end; ---------------------------------------------------------------------- balazsszekely · 2022-01-07 06:43 Hi loaded, Try this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses windows; procedure TForm1.Button1Click(Sender: TObject);begin  keybd_event(VK_CAPITAL, 0, 0, 0);  keybd_event(VK_CAPITAL, 0, KEYEVENTF_KEYUP, 0);end; ---------------------------------------------------------------------- loaded · 2022-01-07 06:49 Thank you very much GetMem for the reply. Yes, that's what I wanted.