Author Topic: Voice Attack Deselecting Chrome  (Read 2583 times)

x-tremespeed

  • Newbie
  • *
  • Posts: 9
Voice Attack Deselecting Chrome
« on: December 03, 2019, 02:02:58 PM »
Hi There!

I have an issue with keeping Google Chrome the active window when sending keystrokes to the browser. I have done a little bit of testing and it seems to deselect chrome as the active window as soon as I send a keystroke (specifically CTRL+L, hotkey to select the address bar).

I found a post about this from a few years ago where the fix was to use the beta version of voice attack but I'm not sure that is available anymore.

Code: [Select]
Display window '*Google Chrome*' as [Normal]
Press Left Ctrl+L keys and hold for 0.1 seconds and release

The first line works every time to make Chrome the active window but the second line will randomly deselect chrome as the active (sometimes it doesn't, but I am looking for it never deselecting  ;))

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Voice Attack Deselecting Chrome
« Reply #1 on: December 03, 2019, 02:05:06 PM »
What are your command target settings? Do you have the "Set command to target this window" option checked?

x-tremespeed

  • Newbie
  • *
  • Posts: 9
Re: Voice Attack Deselecting Chrome
« Reply #2 on: December 03, 2019, 02:08:19 PM »
I have the command target set to *Google Chrome*

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Voice Attack Deselecting Chrome
« Reply #3 on: December 03, 2019, 02:13:23 PM »
Is focus lost if you send F6 instead of Ctrl-L?

x-tremespeed

  • Newbie
  • *
  • Posts: 9
Re: Voice Attack Deselecting Chrome
« Reply #4 on: December 03, 2019, 02:20:23 PM »
Is focus lost if you send F6 instead of Ctrl-L?
Changing to F6 didn't stop it and, separately, I found that if you press F6 while the address bar is already selected it highlights and selects the tab name while deselecting the address bar.

What happens if you change it to just, '*chrome*' ?  (no quotes)
I changed the Send command to this target to *Chrome* but that didn't stop the (sometimes) deselecting

x-tremespeed

  • Newbie
  • *
  • Posts: 9
Re: Voice Attack Deselecting Chrome
« Reply #5 on: December 03, 2019, 02:33:57 PM »
if it's any help, here is my code:

Code: [Select]
Set Windows clipboard to 'www.twitter.com'    <---- This sets twitter.com to the clipboard so if the new tab opens to twitter, I know the active tab address didn't get copied properly

Display window '*Google Chrome*' as [Normal]    <------ Activates Chrome and un-maximizes it (window move doesn't work if the window is maximized)

Pause 1 second     <------ Added a pause to see if it would fix the issue (doesn't appear to have any effect)

Press Left Ctrl+L keys and hold for 0.1 seconds and release        <--- select the address bar
Press Left Ctrl+C keys and hold for 0.1 seconds and release       <-----copy the website address to clipboard
Press Left Ctrl+W keys and hold for 0.1 seconds and release      <------close tab

Resize window '*Google Chrome*' to Width: 1294, Height: 1407 <----resize and move window (left half of screen)
Move window '*Google Chrome*' to (-7,0)

<------ the rest of the program works as expected

Run application 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe' - wait until it starts
Display window 'New Tab - Google Chrome' as [Normal]
Press Left Ctrl+V keys and hold for 0.1 seconds and release
Press Enter key and hold for 0.1 seconds and release
Resize window '[Active Window]' to Width: 1294, Height: 1407
Move window '[Active Window]' to (1273,0)

What this program does is it takes the active tab, copies the address and closes it, resizes the remaining chrome window to the left side of my screen, then opens a new chrome window, pastes the address of the closed tab, and resizes that to the right side of my screen so I can have a sort of split screen setup.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Voice Attack Deselecting Chrome
« Reply #6 on: December 03, 2019, 02:52:47 PM »
I can't replicate this issue on my machine; The browser remains the focused application when sending keypresses.

Which window gets focus when Ctrl-L is sent? It should be the first (top left) entry when you press and hold Alt and press Tab (keep holding Alt).


As an aside, have you tried
Code: [Select]
Run application 'chrome' -with parameters '--new-window {CLIP}' - wait until it startsinstead of pasting the URL into the new window?

x-tremespeed

  • Newbie
  • *
  • Posts: 9
Re: Voice Attack Deselecting Chrome
« Reply #7 on: December 03, 2019, 03:46:44 PM »
I think I have found the culprit - it appears to lose focus if I start the command while the webpage is still loading (as is evident by the little loading box at the bottom left of the browser when you load a new page).

I did try the alt tab trick and it does still show chrome as the active window, but somehow when it is not fully loaded keypreses sent from Voice Attack deselect it. This seems a little strange as I can manually press CTRL+L when the page is still loading up without any issue.

That new window clipboard parameter is quite handy! That's much tidier and looks like a more secure way of handling the new window.