Page 1 of 1

Is Autohokeys causing unwanted switch to overtype ?

Posted: 25 Apr 2019, 01:04
by Sebastian42
I have used Autohotkeys for years. More recently I've been experiencing unwanted random switching from INSERT to OVERTYPE - in documents, chats, mail and elsewhere. Swapping keyboards, and their connections (PS/2 v USB) has left the problem intact. A dozen HELP forums have been unable to give me a solution, but my latest inquiring triggered 'Are you using a text-insert program ?' - and I am. It's called Autohotkeys. So I am asking here, can anyone see a way that AutoHotkeys may be causing my problem ?

Re: Is Autohokeys causing unwanted switch to overtype ?

Posted: 25 Apr 2019, 03:14
by Rohwedder
Hallo,
that of course depends on the autohotkey scripts you run.
If you don't want OVERTYPE, try:

Code: Select all

SetTimer, OverType, 1000
Return
OverType:
IF GetKeyState("Ins","T")
	Send, {Ins}
Return
#IF !GetKeyState("Ins","T")
Ins::Return
#IF

Re: Is Autohokeys causing unwanted switch to overtype ?

Posted: 27 Apr 2019, 05:16
by Sebastian42
It is not that I do not want overtype - it is that I do not want it switched on at random.

Re: Is Autohokeys causing unwanted switch to overtype ?

Posted: 27 Apr 2019, 15:58
by Osprey
I've had this happen several times while testing my Autohotkey scripts. I don't know why it happens, since I don't usually use the Insert key in my scripts. It could be as simple as me accidentally pressing Insert or maybe it's an example of keyboard ghosting, where pressing a bunch of keys at once (something which is more common when scripting keypresses) sends one that wasn't pressed. Anyways, this probably doesn't help much, but I just wanted you to know that you're not the only one who's had this happen.

Re: Is Autohokeys causing unwanted switch to overtype ?

Posted: 27 Apr 2019, 18:37
by swagfag
well, what kinda scripts are u running?
and btw though it may seems random, it likely isnt. try to pinpoint what u were doing exactly the last time it got switched. clues, look for them
check the keyhistory pane

Re: Is Autohokeys causing unwanted switch to overtype ?

Posted: 29 Apr 2019, 06:00
by Sebastian42
The kind of scripts I run - some 50 of them - are pressing a windows key and another to insert a string of text. I also have a script to close save and close spreadsheets.

"check the keyhistory pane" - please introduce me to that; never heard of it before. Googling it revealed a code "keybdhook:" Does that have to appear in every script ?

Re: Is Autohokeys causing unwanted switch to overtype ?

Posted: 29 Apr 2019, 06:10
by Sebastian42
Osprey wrote:
27 Apr 2019, 15:58
I've had this happen several times while testing my Autohotkey scripts. I don't know why it happens, since I don't usually use the Insert key in my scripts. It could be as simple as me accidentally pressing Insert or maybe it's an example of keyboard ghosting, where pressing a bunch of keys at once (something which is more common when scripting keypresses) sends one that wasn't pressed. Anyways, this probably doesn't help much, but I just wanted you to know that you're not the only one who's had this happen.
On the contrary, hearing that I am not alone is very useful. I agree with your reasoning - however, it implies that the unwanted switch should follow on the use of an autokey hotkey. That is NOT the case. It happens during typing text.

Re: Is Autohokeys causing unwanted switch to overtype ?

Posted: 29 Apr 2019, 08:42
by Rohwedder
Hallo,
I don't know any unwanted switching from INSERT to OVERTYPE.
However, I usually only have 3 scripts running at the same time (main script, keylogger and an experimental script).
Maybe this will help against this keyboard ghosting:

Code: Select all

*Ins:: ;Sends Ins only if physically pressed
IF GetKeyState("Ins","P")
	Send, {Blind}{Ins}
Return
^#!k::Keyhistory ;to check the keyhistory pan

Re: Is Autohokeys causing unwanted switch to overtype ?

Posted: 29 Apr 2019, 23:18
by Sebastian42
I have added a shortcut to that script into the StartUp folder - and am hoping for the best.

Re: Is Autohokeys causing unwanted switch to overtype ?

Posted: 29 Apr 2019, 23:55
by Sebastian42
As stated above, I added that code of your into StartUp and it triggered an error message which I would like to post a snap of, but don't know how to achieve that.The text in it runs as follows : Error at line 1.
Line Text: Code: Select all
Error: This line does not contain a recognized action.
The program will exit.

Re: Is Autohokeys causing unwanted switch to overtype ?

Posted: 30 Apr 2019, 00:07
by gregster
Code: Select all is not part of the code but of the forum codebox that contains the code (that means, you shouldn't copy that line - on the contrary, if you click 'Select All', it will actually select all the code in codebox, ready for you to copy.)

Code: Select all

; Only this here is the code area of the codebox, nothing above
; Try to click 'Select All'

Codeboxes can be inserted with [code][/code] tags in posts and are highly recommended to make code look better; commands are clickable in the codebox and will link to the corresponding docs and indentation via tabs is possible.

Re: Is Autohokeys causing unwanted switch to overtype ?

Posted: 30 Apr 2019, 06:00
by Sebastian42
I tested clicking 'select all' and sure enough that is what happened.
I have added the code to a batch file in the StartUp folder which used to launch Autohotkeys and an ahk.
If I do not get an error code at reboot, it will be a matter of time to see if random switching to overtype still occurs.
I guess this is the end of the thread, unless I report an error message or the nuisance continuing despite your best efforts.

Re: Is Autohokeys causing unwanted switch to overtype ?

Posted: 01 May 2019, 02:56
by Sebastian42
There is no error message, and so far INSERT has not been changed to Overtype - so this might be the solution I was looking for.

Re: Is Autohokeys causing unwanted switch to overtype ?

Posted: 01 May 2019, 20:48
by Sebastian42
Sad to say, INSERT is still switching randomly (?) to Overtype, so the above was not a solution. Does that mean Autohotkeys is NOT implicated in the fault ?