Author Topic: [v1.7.2.26] "Get User Input - " windows don't always steal focus  (Read 3680 times)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
[v1.7.2.26] "Get User Input - " windows don't always steal focus
« on: November 05, 2018, 02:05:55 AM »
The "Get User Input - " actions(Text, Choice, Integer, Decimal) windows appear to be intended to steal focus when they're created; The manual doesn't state it explicitly, but that is what I infer from the fact that they do most of the time.

However, this doesn't always happen, regardless of whether the "Stay on Top" option is checked.

From what I can tell, if VoiceAttack is manually given focus, and focus is switch to another application, the created window will fail to steal focus.
If VoiceAttack has focus when the window is created it does gain focus, but as it's a child window of that application that makes sense.

  • Click VoiceAttack's main window so it gains focus
  • Click another open application so it gains focus
  • Execute a command containing a "Get User Input - " action
  • Observe that the created window does not gain focus, but is retained by the previously clicked application
  • Click the "Cancel" button on the created window
  • Execute a command containing a "Get User Input - " action
  • Observe that the created window gains focus
  • Click the "Cancel" button on the created window
  • Click VoiceAttack's main window so it gains focus
  • Click another open application so it gains focus
  • Click yet another open application so it gains focus
  • Execute a command containing a "Get User Input - " action
  • Observe that the created window does not gain focus, but is retained by the previously clicked application
  • Close VoiceAttack
  • Start VoiceAttack
  • Click another open application so it gains focus
  • Execute a command containing a "Get User Input - " action
  • Observe that the created window gains focus
  • Click the "Cancel" button on the created window
  • Click VoiceAttack's main window so it gains focus
  • Click another open application so it gains focus
  • Execute a command containing a "Get User Input - " action
  • Observe that the created window does not gain focus, but is retained by the previously clicked application


The only difference the "Stay on Top" option makes is that the input control of the created window will *appear* to have focus(I.E. the contents, if any, are highlighted in blue for Integer, Decimal, and Text, and the latter also displays a blinking cursor which stops blinking after a few seconds) when it is checked.


This could be a Windows issue, but perhaps it can be worked around internally.


The "Perform a Window Function" action does not(currently) affect child windows like these, but as the created window gains focus just fine when VoiceAttack has focus, that action can be used to give VoiceAttack focus explicitly before using a "Get User Input - " action.

E.G.
Code: [Select]
Display window 'VoiceAttack' as [Show]
Get Text Input [test]
However, this will not work if VoiceAttack is minimized to the system tray.

Having the VoiceAttack window in front of the active window may not be desirable, so this could be extended to something like
Code: [Select]
Set Text [~activeWindow] to '{ACTIVEWINDOWTITLE}'
Display window 'VoiceAttack' as [Show]
Get Text Input [test]
Display window '{TXT:~activeWindow}' as [Show]
to attempt to bring the previously active window back to the top.



As an aside, the "Get User Input - Choice" dropdown looks as if it's grayed out(it's uniform gray rather than a white field with a gray button, like the main window), though it's still interactive.

Also, the created window always appears on the monitor that contains the largest surface of VoiceAttack's main window(E.G. if it's 49 percent on monitor one, it will appear on monitor two because 51 percent of the application window resides there). Would it be desirable to have it appear on the monitor where most of the active window resides, instead?


EDIT: Fixed in v1.8.3.22 (not v1.8.3.21 ::))
« Last Edit: March 07, 2020, 10:40:05 PM by Pfeil »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: [v1.7.2.26] "Get User Input - " windows don't always steal focus
« Reply #1 on: November 06, 2018, 09:28:06 AM »
I think I've got the focus thing worked out - I'll post an update later today.

In regards to the gray list box, I believe that is because it is not an editable list (that is, it's not a combo box, but rather a simple list box).  IIRC, Windows will display a white area only if the box is editable.

For the positioning of the input box, that is deferred to Windows' positioning.  I think the expected behavior is wherever the app is located and not where most of the Windows are, unfortunately :(

Thanks for all the work to show how to reproduce the problem, Pfeil!

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: [v1.7.2.26] "Get User Input - " windows don't always steal focus
« Reply #2 on: November 06, 2018, 05:35:19 PM »
I popped a version into the, 'unofficial' bin if you want to try it out:  http://www.voiceattack.com/unofficial
That one has the fix for the command list you had indicated as well.

If that works out, I'll go one more beta and then release of v1.7.3   :)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: [v1.7.2.26] "Get User Input - " windows don't always steal focus
« Reply #3 on: November 07, 2018, 12:09:36 AM »
v1.7.2.27 exhibits the same behavior as v1.7.2.26, on my machine.

However, I discovered both versions exhibit the same effects as this issue.

When the window is open, Mouse Movement Recorder registers a lot of sync issues. Polling rate also seems to drop to roughly half(500Hz instead of 1000Hz).

I only noticed this because after a random reboot the delay was so large that the cursor started lagging severely. This has luckily gone away equally randomly, but Mouse Movement Recorder clearly shows having the window open affects the cursor.


Going back to v1.7.2(hotfix version of the original implementation of this feature), the behavior is also present; Because the delay is usually small enough that I don't personally feel it, it's probably it's been there all along.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: [v1.7.2.26] "Get User Input - " windows don't always steal focus
« Reply #4 on: November 07, 2018, 08:01:14 AM »
I put another build out in the unofficial bin.  Would you mind seeing if that one is a little less aggressive on your mouse?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: [v1.7.2.26] "Get User Input - " windows don't always steal focus
« Reply #5 on: November 07, 2018, 08:52:56 AM »
v1.7.2.28 drops the polling rate down to 10Hz; After moving my mouse around a few times, it took about 30 seconds for the cursor to stop after I physically stopped moving.

Switching back to v1.7.2.27, the delay remains as before, dropping the polling rate to half, but not very noticeable.

Switching to v1.7.2.28 again, the long delay is there immediately when the window opens.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: [v1.7.2.26] "Get User Input - " windows don't always steal focus
« Reply #6 on: November 07, 2018, 04:04:04 PM »
I guess there is more to this puzzle than I thought.  I am rolling these changes back to v1.7.2 since the next full release is not too far out.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: [v1.7.2.26] "Get User Input - " windows don't always steal focus
« Reply #7 on: March 03, 2020, 07:11:52 PM »
I've updated the user input screen to (hopefully) get focus when opened.  This will be in the next update.