StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 Windows 10 (1903) / Edge browser / acSendKeys
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Hard.Wired

67 Posts

Posted - 09/30/2019 :  02:35:55  Show Profile  Reply with Quote
Anyone else having odd problems with Windows 10 (1903) and the Edge browser?

I finally had to succumb to the 1903 upgrade and noticed that some of my S+ acSendKeys commands no longer function reliably. In particular things like "^w", "%{LEFT}" and "%{RIGHT}". They still work correctly in other browsers (Chrome, Firefox, Brave).

Things that make you go... Hmmm.

Rob

USA
2591 Posts

Posted - 09/30/2019 :  09:43:32  Show Profile  Visit Rob's Homepage  Reply with Quote
I don't run the original version anymore obviously, but there is a similar issue in S+.net with the Always Activate Window Where Gesture Began option; if it's enabled the same behavior occurs.

There's something very odd about Edge's window hierarchy. So if you have code (like in before action script) which is trying to activate the Edge window first, that might be the source of the issue...but I cannot say for sure.
Go to Top of Page

Hard.Wired

67 Posts

Posted - 09/30/2019 :  14:53:15  Show Profile  Reply with Quote
Bingo...ish. I was using "Allow After Action Script*", "Allow X1 Click Script*" and "Allow X2 Click Script*", but deactivating X1/X2 finally got things working again. I can live without those for the moment. "After" still seems to work.

Thanks!
Go to Top of Page

Hard.Wired

67 Posts

Posted - 09/30/2019 :  15:58:12  Show Profile  Reply with Quote
Drat, spoke too soon. It worked temporarily. Hmm, I'll look into how I am activating the window. Maybe I can find a work around.
Go to Top of Page

Hard.Wired

67 Posts

Posted - 10/01/2019 :  01:21:49  Show Profile  Reply with Quote
Something I just noticed:

Doesn't work...
acSendKeys("^w")

Does work...
acSendControlDown()
acSendKeys("w")
acSendControlUp()

I looked more into Edge's window hierarchy as you mentioned. It was strange before where there would be odd delays when activating the window if it wasn't already in focus, but now it is really weird in 1903 where the order of the hierarchy seems random. I'm sure there is some logic to it (or at least I hope). I'll keep digging.
Go to Top of Page

Rob

USA
2591 Posts

Posted - 10/01/2019 :  09:45:25  Show Profile  Visit Rob's Homepage  Reply with Quote
So what I've found in trying to resolve for S+.net is that when you activate the top level window (ApplicationFrameWindow), it changes the focus to the main body/browser area window of Edge (Windows.UI.Core.CoreWindow). It's during this switch when keyboard input is sent to the top level window (and basically lost), once CoreWindow is active, the input is received fine.

That explains why you send control down works because it sets the keystate globally and buys a little time for CoreWindow to become active. Adding a small delay also seems to work (in S+.net), like acDelay(100) before sending keystrokes to allow CoreWindow to be reactivated and ready to receive input.
Go to Top of Page

Rob

USA
2591 Posts

Posted - 10/01/2019 :  09:49:26  Show Profile  Visit Rob's Homepage  Reply with Quote
Note that it's not all Core apps. For example, Calculator has no problem with this even though its hierarchy is basically the same. It's something specific in the Edge architecture/messaging.
Go to Top of Page

Hard.Wired

67 Posts

Posted - 10/01/2019 :  17:50:12  Show Profile  Reply with Quote
Thank you, very helpful info. I wonder if it also has something to do with Edge's sandboxing methods? This all may change once the new Edge/Chromium version is officially released. PITA!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000