Author Topic: Loss of Game Focus when using button press command  (Read 198 times)

Doughnutsu

  • Newbie
  • *
  • Posts: 1
Loss of Game Focus when using button press command
« on: July 17, 2017, 07:18:54 am »
I lose game focus when I use a button press command I've setup.  The command types "!wasted" and press enter in another program however whenever it does the mouse appears over my game screen as if I've opened a menu or alt tabbed and I have to click on it again to resume control of the game.

http://voiceattack.com/smf/index.php?topic=1034.0

I've setup everything in that thread as described unless I've done something wrong.


Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 1225
Re: Loss of Game Focus when using button press command
« Reply #1 on: July 17, 2017, 08:49:31 am »
Hi, there.

VoiceAttack does not send input to other applications unless those applications are in focus.  So, in order to send info to a secondary application, the secondary application must be the top-most, focused window before any input can be sent to it.  Just like a human would do, you will need to focus the secondary application first, send the input (send keys, click mouse) and then get the focus of your primary application again to send it input.  This is the way Windows works.

The easiest way I can think of to facilitate that in VA is to set the, 'Send commands to' to your primary app in the Profile options screen.  Then for each command that sends input to the secondary app, set the, 'Send commands to' to your secondary app.  That way, the default is always to your game, and the focus is only changed when interacting with the secondary app.