brotherhobbes Posted November 3, 2004 Share Posted November 3, 2004 Greetings, long time lurker, first time poster. Usually I can resolve my problems by reading through posts here, but this one I thought I'd ask about. I have a simple script that uses capslock to indicate when it enabled. Starts with capslock off. Press capslock to start it up. Pressing capslock or enter disables the main functionality. Pressing capslock again re-enables. The problem is that sometimes the capslock light will be off, but typing results in all caps. This can be seen by pushing capslock, enter, capslock, enter. the capslock light will be off, but anything typed will be in all caps. Perhaps someone could help me find what should be an obvious bug, I just can't see it. expandcollapse popup; set initial values AutoItSetOption("SendCapslockMode", 0) Send("{CAPSLOCK off}") HotKeySet("{CAPSLOCK}", "Toggle") $bToggle = 0 ; main loop While 1 If $bToggle = 1 Then ; functionality here EndIf Wend ; called when user presses capslock Func Toggle() If $bToggle = 0 Then $bToggle = 1 HotKeySet("{CAPSLOCK}") Send("{CAPSLOCK on}") HotKeySet("{CAPSLOCK}", "Toggle") HotKeySet("{ENTER}", "Enter") Else $bToggle = 0 HotKeySet("{CAPSLOCK}") Send("{CAPSLOCK off}") HotKeySet("{CAPSLOCK}", "Toggle") EndIf EndFunc ; called when enter is pressed, but only if toggle is on Func Enter() $bToggle = 0 HotKeySet("{CAPSLOCK}") Send("{CAPSLOCK off}") HotKeySet("{CAPSLOCK}", "Toggle") HotKeySet("{ENTER}") Send("{ENTER}") EndFunc Link to comment Share on other sites More sharing options...
Josbe Posted November 3, 2004 Share Posted November 3, 2004 Add this line at start... Opt("SendAttachMode", 1) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
brotherhobbes Posted November 4, 2004 Author Share Posted November 4, 2004 thanks josbe, works great now! Link to comment Share on other sites More sharing options...
Administrators Jon Posted November 4, 2004 Administrators Share Posted November 4, 2004 Add this line at start...Opt("SendAttachMode", 1)Thought I was the only person who knew this existed I am planning a change that will make it redundant at some point Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Helge Posted November 6, 2004 Share Posted November 6, 2004 Just a comment (not useful though ), but it´s possible to change the status of the capslock if you hold down Alt, Ctrl or Shift when pressing Capslock... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now