Forum > Windows
[Solved] How to change CAPS LOCK status?
(1/1)
loaded:
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 [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---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;
GetMem:
Hi loaded,
Try this:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---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:
Thank you very much GetMem for the reply.
Yes, that's what I wanted.
Navigation
[0] Message Index