BakedCakes Posted August 30, 2022 Posted August 30, 2022 I'm trying to send Ctrl+PgUp to an inactive Chrome window (this key combination switches to a previous tab), but it works only if the window is active, it doesn't work with an inactive window: ControlSend("New Tab - Google Chrome", "", "[CLASS:Chrome_RenderWidgetHostHWND]", "^{PGUP}")
BakedCakes Posted August 31, 2022 Author Posted August 31, 2022 Anyone able to send Ctrl+PgUp to an inactive Chrome window? Some observations as I played around with Notepad to see if it's perhaps something Chrome-specific: ControlSend ^{PGUP} works only on an active Chrome window ControlSend ^v (the paste shortcut) works only on an active Notepad window ControlSend {DEL} works on both active and inactive Notepad window ControlSend "foobar" works on both active and inactive Notepad window So it would seem like it's not Chrome-specific and that ControlSend can't send Ctrl sequences to inactive windows? For the reference, I'm running up to date Windows 10 21H2 19044.1889 and using the latest AutoIt v3.3.16.0.
BakedCakes Posted September 12, 2022 Author Posted September 12, 2022 Bump. Still need help with this.
Solution genius257 Posted September 13, 2022 Solution Posted September 13, 2022 Hi @BakedCakes. A quick google search led me to AHK forum where another person had same troubles. It seems it's a limitation with chrome, that it does not accept keys sent while inactive, explained here. So you would need to use a WebDriver based solution or Temporarily activate the window while interacting with the window. BakedCakes 1 To show your appreciation My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser
BakedCakes Posted September 16, 2022 Author Posted September 16, 2022 (edited) Thanks. I was hoping that I'm missing something obvious or making a mistake, instead of Chrome outright not accepting input when inactive, but the lack of replies in this thread and then your post do seem to hint on the latter being the case. Auto-focusing it is then. Edited September 16, 2022 by BakedCakes
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