Steam Overlay affecting Auto Correct

Ask gaming related questions (AHK v1.1 and older)
Bori
Posts: 4
Joined: 03 Jan 2017, 14:25

Steam Overlay affecting Auto Correct

03 Jan 2017, 14:40

https://www.autohotkey.com/download/AutoCorrect.ahk

When using this script while in steam overlay, and I type, for example: "dont" it will correct it to "don't" it does this by backspacing out the word and retyping it for me. However in the steam overlay it doesn't do it properly so I am stuck with it changing my apostrophe-less "dont," to "dondon't." I tried "SetKeyDelay", and changing it to "SendMode, Input" but none of these fixed it. Does anyone have an idea of what I could change to fix this aside from having it suspend my script when GameOverlayUI.exe is present? (I had trouble adding the GameOverlayUI.exe to suspend my script, so if you don't know of a fix I'd appreciate that too.)

The only difference between mine and the documents AutoCorrect.ahk is mine has added hotstrings on the bottom, and I also added

Code: Select all

Menu, Tray, Icon, Letter A.ico
return
to the top.
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: Steam Overlay affecting Auto Correct

03 Jan 2017, 16:21

Using #IfWinNotExist ahk_exe GameOverlayUI.exe (or #IfWinNotActive) may be all you need to add to your script to disable it when the overlay is present.

I don't know how to troubleshoot this to understand if it is an AHK problem or a Steam problem myself, so I'm not aware of a better idea besides basically disabling the autocorrect.
Bori
Posts: 4
Joined: 03 Jan 2017, 14:25

Re: Steam Overlay affecting Auto Correct

03 Jan 2017, 17:36

Looks promising. I tried it out in the script and it didn't change. So I made a sperate script with only this:

Code: Select all

#IfWinExist ahk_exe GameOverlayUI.exe
q::msgbox Active
#IfWinNotExist ahk_exe GameOverlayUI.exe
q::msgbox Not Active
It always displayed only displayed "Not Active," same with if I used #IfWinNotActive instead of #IfWinNotExist. So I don't think that works.

To clarify, (because in the main post I didn't explain how it ends up with the result) it only back spaces the "t" of "dont," then it starts typing out "don't" and I end up with "dondon't." This happens with any words (tested outside of AutoCorrect.ahk) no matter the length, always only backspaces once.
Noesis
Posts: 301
Joined: 26 Apr 2014, 07:57

Re: Steam Overlay affecting Auto Correct

04 Jan 2017, 01:59

I've had issues with steam overlay myself, it isn't picked up as active, as it's kind of a background process which hooks into the graphics of the games executable (hence you can't use it unless you start the game with steam, and when you do it's the games exe that is considered active) so to turn it off you'll have to check the games executable instead of the steam one. I think from memory you may be able to get backspace working properly by sending it differently (depending on how it's currently being sent, I didn't look at the code supplied). Things like Send {Backspace 5} don't work in steam overlay but if you do something like:

Code: Select all

Loop, 5 {
	Send {Backspace Down}
	Sleep 100
	Send {Backspace Up}
	Sleep 100
}
It can work but you might need to increase the sleep amounts and I've found it tends to be a bit flaky (that's using sendmode input btw).
User avatar
Nextron
Posts: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: Steam Overlay affecting Auto Correct

04 Jan 2017, 03:48

Since the overlay is integrated into the game, key detection may be similar to games; for which SendInput may be too quick.
Add the following line to your script: #Hotstring K20 SE. This reverts to SendEvent instead of SendInput and increases the default 0 keydelay for hotstrings. Increase the 20 if it doesn't work or reduce it to make it faster until it becomes to fast.
Bori
Posts: 4
Joined: 03 Jan 2017, 14:25

Re: Steam Overlay affecting Auto Correct

04 Jan 2017, 04:44

It signed me out and send my incomplete message, ignore the above because I can't delete it.
Noesis wrote:(depending on how it's currently being sent, I didn't look at the code supplied).
The link is a text file it doesn't auto download. But it's just full of

Code: Select all

::dominaton::domination
::do'nt::don't
::dont::don't
::don't no::don't know
::doulbe::double
Which is something I don't think you can solve that way. I should've just showed a snippet though.

I'd like to figure out how to either suspend my script while the overlay is up, or how to fix the non-complete corrects when it's active and being typed in. If not then a way to make this work:

Code: Select all

Menu, Tray, Icon, Letter A.ico
#MaxThreadsPerHotkey, 2


ProcessCheck:					;Label for loop
Process, Exist, mspaint.exe		;checks for process (test)
	if ErrorLevel				;If exists
		{					
		Suspend, On			;Suspend script
		goto, ProcessCheck		;Go to label for loop
		}
	else 						;If not exists
	{
		Suspend, Off			;enable script
							;Continues with rest of script
::dont::don't 					;Large amounts of Hotstrings and others for AutoCorrect (see link in Op for full script)
		goto, ProcessCheck		;returns to top to see if process state has changed
	}															
							
This works except for the part after Suspend, Off but it doesn't recheck for the process, so I assume goto, ProcessCheck isn't being reached. So if no one has any ideas on the other issue, a good way to do this instead, I would appreciate.
Bori
Posts: 4
Joined: 03 Jan 2017, 14:25

Re: Steam Overlay affecting Auto Correct

04 Jan 2017, 04:52

Nextron wrote:Since the overlay is integrated into the game, key detection may be similar to games; for which SendInput may be too quick.
Add the following line to your script: #Hotstring K20 SE. This reverts to SendEvent instead of SendInput and increases the default 0 keydelay for hotstrings. Increase the 20 if it doesn't work or reduce it to make it faster until it becomes to fast.
This is the same as SetKeyDelay and not defining a SendMode, right? (I tried that, don't think it worked) Either way, this worked but not perfectly. It works in a sense that it properly backspaces it out, but even with it set to 1 delay, I end up typing out "i ddhoin't nk so" instead of "i don't think so". Setting the delay to 0 reverts back to it not erasing enough.

Used a seperate script to test this.

Code: Select all

#Hotstring K1 SE
::dont::don't


Edit: this is embarrassing, it sent a second guest one while i was typing this one >.<
Edit2: Tried swapping it for SetKeyDelay and it didn't mirror your script. I thought by default scripts are in SendEvent, so doing SetKeyDelay should imitate your suggestion?
User avatar
Nextron
Posts: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: Steam Overlay affecting Auto Correct

04 Jan 2017, 05:48

SetKeyDelay influences SendEvent and Send depending on the SendMode. Auto-replacing hotstrings have their own key delay, set with the option I mentioned earlier. Reducing the delay value between keys makes it easier for the game to miss events, so you should increase it (when I mentioned if it is not working).

One limitation is that opposed to SetKeyDelay you can't set the delay of the key being pressed down, which likely is a factor as well. To circumvent that, you'd have to create a non-backspacing non-autoreplacing hotstring which does use Send. Something like:

Code: Select all

#Hotstring B0 ;Backspacing disabled (hotstrings must come below this line)
HotstringSend(Text, Delay:=20, PressDuration:=20){
	bs:=StrLen(A_ThisHotkey A_EndChar)-InStr(A_ThisHotkey,":",0,1,2)
	SetKeyDelay Delay, PressDuration
	SendEvent {BackSpace %bs%}%Text%
}


::dont::
	HotstringSend("don't") ;Needs to be on a separate line to be non-autoreplacing
Return
Guest

Re: Steam Overlay affecting Auto Correct

04 Jan 2017, 18:40

Tried your script, this was the outcome; in .gif format.
https://i.gyazo.com/5ca0d57ab218d731cfd ... b811db.gif

First you see me typing "i dont think so," then I'm just typing "dont dont dont dont" (even here the script comes out as "ddon'odoonddoondon't").

If you wanted to test this as well, just launch any game via Steam and it gives it the overlay, then try to message someone.
User avatar
ThumpieBunnyEve
Posts: 109
Joined: 03 Aug 2016, 19:03

Re: Steam Overlay affecting Auto Correct

10 Aug 2018, 19:19

Having the same issues. still nothing i try is a successful work-around. Your codes look good, and I've tried everything listed. but the automated backspacing of autohotkey just goes too fast, even if you script the following:

Code: Select all

#IfWinActive ahk_class MT FRAMEWORK
#Hotstring B K200 SI
SetKeyDelay, 200
#IfWinActive MONSTER HUNTER: WORLD(151639)
#Hotstring B K200 SI
SetKeyDelay, 200
#IfWinActive
SI SP SE make no difference. neither does extending the delay. B is being used just to make sure Backspaceing is On. as B0 can turn it off. is there a controlGet handle for a steam input window display?

Also Nextron's script isn't especially useful unless you want 1 auto-correct script for everything -not- steam related. and then one nearly identical one made up for using the "send" option as Nextron's script portrayed.

that is to say, Nextron's solution neither works, nor would be useful if it did, because you'd need to keep 2 databases of auto corrections up to date and different, any time you added 1 new word.
User avatar
Nextron
Posts: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: Steam Overlay affecting Auto Correct

11 Aug 2018, 05:56

ThumpieBunnyEve wrote:Nextron's solution neither works,
Have you tried the function with higher delays and press duration, because they could still be too short? I can't help testing because as soon as I set a hotstring to SendEvent mode, it already works properly (natively or using the function).
nor would be useful if it did, because you'd need to keep 2 databases of auto corrections up to date and different, any time you added 1 new word.
Why? the customized hotstring should work in both steam and non-steam applications. If steam requires an increased delay which you don't want to apply in non-steam applications, I would instead change the function to check for the existence of gameoverlayui.exe and adjust the speed (or even output mode) based on that.
User avatar
ThumpieBunnyEve
Posts: 109
Joined: 03 Aug 2016, 19:03

Re: Steam Overlay affecting Auto Correct

12 Aug 2018, 14:41

Nextron said:
Have you tried the function with higher delays and press duration,
yes as i indicated in my above post:
TBE said:
SI SP SE make no difference. neither does extending the delay.
Nextron said:
the customized hotstring should work in both steam and non-steam applications.
the autocorrect.ahk which is downloadable from the AKH site, and my personal version which is about 5000 entries long,
both the official and mine use the format
::wodr::word

Nextrons version uses the format
::wodr::
HotstringSend("word")
Return

this would mean changing 5000 lines, to at-least 15000 lines. adding additional characters, and steer it away from compatibility with existing formats that (useing some scripts already on the site) automaticly generate new entries into a users personal autocorrect.ahk library.
Essentially your version breaks functionality with the standard set by other scripts that allows for automated appending of the autocorrect lib.
.......which again is moot, because delay is having no effect.
TBE said:
SI SP SE make no difference. neither does extending the delay.
User avatar
Nextron
Posts: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: Steam Overlay affecting Auto Correct

13 Aug 2018, 06:19

ThumpieBunnyEve wrote:Nextron said:
Have you tried the function with higher delays and press duration,
yes as i indicated in my above post:
Well you didn't. I'm asking about the function parameters. You're showing the command and directive parameters.
Try this below, which is annoyingly slow, but should show whether speed is the culprit.

Code: Select all

Process,Priority,,A
#Hotstring XB0 ;Backspacing disabled (hotstrings must come below this line)
HotstringSend(Text, Delay:=200, PressDuration:=200){
	bs:=StrLen(A_ThisHotkey A_EndChar)-InStr(A_ThisHotkey,":",0,1,2)
	SetKeyDelay Delay, PressDuration
	SendEvent {BackSpace %bs%}%Text%%A_EndChar%
}


::dont::HotstringSend("don't") ;Single line since AHK 1.1.28
the autocorrect.ahk which is downloadable from the AKH site, and my personal version which is about 5000 entries long,
both the official and mine use the format
::wodr::word

Nextrons version uses the format
::wodr::
HotstringSend("word")
Return

this would mean changing 5000 lines, to at-least 15000 lines. adding additional characters, and steer it away from compatibility with existing formats that (useing some scripts already on the site) automaticly generate new entries into a users personal autocorrect.ahk library.
Essentially your version breaks functionality with the standard set by other scripts that allows for automated appending of the autocorrect lib.
Agreed, using the native format is more legible and easier to use... but also non-functional in-game. The extensive (but limited) hotstring customization options do not allow this to be fixed for you (for me, setting SE is sufficient), so a custom solution has to be used, which I supplied. That does entail implementing a non-native formatting. If applying this to an existing file through a couple of search&replaces is too much work or unwanted, you could have AHK parse a native hotstring script, regex the triggers and outputs and generate a new customized file or dynamically setup the hotstrings using Hotstring(), but that's outside the scope of the original problem.
User avatar
ThumpieBunnyEve
Posts: 109
Joined: 03 Aug 2016, 19:03

Re: Steam Overlay affecting Auto Correct

14 Aug 2018, 14:31

the solution i came up with /am using/ is to turn backspacing off completely with B0 and including a [Ctrl][Shift][←] key press combo so it just leaps back over the prior word using steams highlight function and resumes typing (thus over) the prior word. not the best solution. but ::wodr::^+{left}word is easier on the loading and memory being just 1 internal function.
User avatar
ThumpieBunnyEve
Posts: 109
Joined: 03 Aug 2016, 19:03

Re: Steam Overlay affecting Auto Correct

15 Aug 2018, 15:27

sigh i was incorrect about "where" my ^+{left} option works.

Steam has 2 modes of its UI Overlay. the one i quick tested in was the Windowed mode version.
However in the Fullscreen mode, im still experiencing the same problem even with ^+{left} instead of {backspace #}
Still regardless of B0 or B, SI SP SR SE settings steam chat box when in fullscreen mode refuses to accept backspace or back-highlighting from autohotkey.

Code: Select all

#Hotstring B SI
::december::December
;fails
#Hotstring B SE
::december::December
;fails
#Hotstring B SP
::december::December
;fails
#Hotstring B SR
::december::December
;fails

#Hotstring B0 SI
::december::{control down}{shift down}{left down}{left up}{shift up}{control up}December
;fails
#Hotstring B0 SE
::december::{control down}{shift down}{left down}{left up}{shift up}{control up}December
;fails
#Hotstring B0 SP
::december::{control down}{shift down}{left down}{left up}{shift up}{control up}December
;fails
#Hotstring B0 SR
::december::{control down}{shift down}{left down}{left up}{shift up}{control up}December
;fails


#Hotstring B0 SI
::december::^+{left}December
;fails
#Hotstring B0 SE
::december::^+{left}December
;fails
#Hotstring B0 SP
::december::^+{left}December
;fails
#Hotstring B0 SR
::december::^+{left}December
;fails


;all failures result in the following output in the fullscreen steam overlay chat window:
decemberDecember
It was a pain in the tail to carefully rework my 11000 lines of hotstring autocorrect, and yet nothing worked. Steam refuses inputs from autohotkey in every mode. other then raw textual input. this is true for unicode characters sent to steam overlay in fullscreen mode as well not just backspace or ^+{left}.

Ill add 10$ USD to the bounty on cracking this egg. [̲̅$̲̅(̲̅1̲̅0̲̅)̲̅$̲̅]
User avatar
ThumpieBunnyEve
Posts: 109
Joined: 03 Aug 2016, 19:03

Re: Steam Overlay affecting Auto Correct

28 Aug 2018, 11:01

Ok upping the bounty to [̲̅$̲̅(̲̅30̲̅)̲̅$̲̅]

Steams Full Screen interface, refusing to accept Backspace (more then 1 character) or "ctrl Shift LeftArrow" which would highlight the word to be replaced.

The Regular steam Chat window is fine so don't use that as a test environment. it's the fullscreen steam chat window. You'll know your in it by typing semi fast and watching steam struggle to keep up. Other then actually typing letters, this fullscreen window version of steam-chat does not recognize backspace or ctrl+shift+leftarrow from virtual keyboards under any of these modes SI,SR,SP,SE.

also to Nextron whos been at least trying. Thank you for trying. though its probably best if you actually test it in a steam full-screen-game. As logistically your code should work, but on a driver or virtual keyboard or program access permissions level, it just can not. none of the send modes help thus far.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 66 guests