Jump to content
Sign in to follow this  
Foaman

cApS lOCk GlItTerinG on aNd off

Recommended Posts

Foaman

Suprised you couldn't read that.

WHen I run an AutoItv3 script, sometimes the keys I press automatically repeat themselves, and my capslock key goes into a constant state of flickering on and off, as evident by the capslock light. I can also tell that the ctrl key is toggling and detoggling.

Edited by Foaman

Share this post


Link to post
Share on other sites
Foaman

Okay, all edited.

Share this post


Link to post
Share on other sites
Foaman

Actually, the keyboard becomes glitchier and glitchier, when I run the script.

Share this post


Link to post
Share on other sites
poisonkiller

Could you post your script or is it with any script you run?

Share this post


Link to post
Share on other sites
Foaman

problem seems to manifest with infinite loops and controlsends

I'll post it...

CODE
;Press esc to "terminate"

;Pause/Break to "pause"

Global $Paused

HotKeySet("{PAUSE}", "TogglePause")

HotKeySet("{ESC}", "Terminate")

$TimesToRun = -1

$Temp0 = 0

$Temp1 = 0

While $Temp0 > $TimesToRun

ControlSend("Untitled", "", "", "a")

ControlSend("Untitled", "", "", "{LCTRL}")

ControlSend("Untitled", "", "", "g");; hold (alt)

Sleep(30)

$Temp0 = $Temp0 + 1

wEnd

Func TogglePause()

$Paused = NOT $Paused

While $Paused

sleep(100)

ToolTip('Script is "Paused"',0,0)

WEnd

ToolTip("")

EndFunc

Func Terminate()

Exit 0

EndFunc

See now, I've changed a few things, so that it may run on anyone's computer.

Seems the problem comes about after some time, but not right away.

Sometimes the keys are sent to the wrong window, too. Very rarely.

After I type a few lines, press shift, press a return or something, myself, that's when the script seems to go downhill. :)

Share this post


Link to post
Share on other sites
Foaman

dang. I can't make it do it, now. i guess it's a come and go problem. what the flogging flogg... i mean it is happening ,just not consistently, and i delete the errors.... it's less frequent, but the same problem.

Share this post


Link to post
Share on other sites
ResNullius

@Foaman,

You're not crazy, I can reproduce the capslock flicker with this script, run it first with your capslock key off:

Opt("SendKeyDelay",1)
;OPT("SendCapslockMode",0)
Run("notepad.exe")
WinWait("Untitled")
WinActivate("Untitled")

For $i = 1 to 25
  ControlSend("Untitled","","Edit1","==== " & $i & " ===")
    ControlSend("Untitled","","Edit1",@CR,1)
    ControlSend("Untitled","","Edit1","test this")
    ControlSend("Untitled","","Edit1",@CR,1)
Next

next, turn capslock on and rerun it; you should see your capslock light flicker on and off.

Next, uncomment the OPT("SendCapslockMode",0) on the second line, make sure capslock key is on, and run again.

Capslock light should stay steady.

I was having a problem where I would send all upper case strings to an editbox and fairly often, especially with longer strings, I would get some lower case letters mixed in and the app would reject them.

I think what's happenning is the Send( ) or ControlSend() with the deafault option of restoring the Capslock state was "tripping" over itself and occasionally letting a keystroke through as lower case. Can any one else confirm?

Share this post


Link to post
Share on other sites
Zedna

@Foaman,

You're not crazy, I can reproduce the capslock flicker with this script, run it first with your capslock key off:

Opt("SendKeyDelay",1)
;OPT("SendCapslockMode",0)
Run("notepad.exe")
WinWait("Untitled")
WinActivate("Untitled")

For $i = 1 to 25
  ControlSend("Untitled","","Edit1","==== " & $i & " ===")
    ControlSend("Untitled","","Edit1",@CR,1)
    ControlSend("Untitled","","Edit1","test this")
    ControlSend("Untitled","","Edit1",@CR,1)
Next

next, turn capslock on and rerun it; you should see your capslock light flicker on and off.

Next, uncomment the OPT("SendCapslockMode",0) on the second line, make sure capslock key is on, and run again.

Capslock light should stay steady.

I was having a problem where I would send all upper case strings to an editbox and fairly often, especially with longer strings, I would get some lower case letters mixed in and the app would reject them.

I think what's happenning is the Send( ) or ControlSend() with the deafault option of restoring the Capslock state was "tripping" over itself and occasionally letting a keystroke through as lower case. Can any one else confirm?

I had a similar problem.

As I can understand it was national keyboard related problem.

Look here and here

Edited by Zedna

Share this post


Link to post
Share on other sites
ResNullius

I had a similar problem.

As I can understand it was national keyboard related problem.

Look here and here

I'm using a standard USA keyboard layout with USA english as my selected language on a north american installation of Windows.

I have noticed the sometimes sending mixed case problem so far for sure only on Windows 2000. I'm going to try some more testing on XP. Basically I can use a variation of the script I posted above that sends more data and probably one out of 5 or 10 runs it will send mixed case; sometimes only one character in the series, other times two or three in the same sequence or in different iterations.

I had also noticed a similar problem when sending CHR() characters, they would sometimes come out as something completey different. As I say, I will do some more testing to see if I can make it absolutely reproducible...

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×