Author Topic: Send commands to minimized window  (Read 2892 times)

MalcomR

  • Newbie
  • *
  • Posts: 44
Send commands to minimized window
« on: November 24, 2018, 05:42:31 PM »
I've setup profiles for apps and included them in the global list of profiles.  The ideas is that when I'm working in an app, say a programming editor and I have another app such as a media player going I want to pause or play the current media selection.  Using SMPlayer as an example I have it setup so that even if I'm in another app it will play/pause the selection.  It does not have to have focus but just be displayed. However, I've found that if SMPlayer is NOT minimized - it doesn't have to have focus or it can be covered up by another app, say the browser and it works.  However, if it's minimized the commands do not work. 

I was under the impression that if I told the profile to target the app it will send commands to that app no matter what the state.

I'm using *SMPlayer in my Send commands to and the window name is usually title - SMPlayer.  If I use the process name it still doesn't work if the window is minimized to the task bar.

I'm on Win10.

Thanks.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Send commands to minimized window
« Reply #1 on: November 24, 2018, 06:11:02 PM »
Hi, Malcom.

Does SMPlayer listen for media keys?  That is, if you have Play/Pause/Next/Prev Track buttons on your keyboard, does it react to them?  Most media players have this capability and do not require the app to be focused and active to be addressed.

Windows applications must be in focus and active to receive input (keyboard and mouse).  That is, unless they are actively listening for specific keyboard events (hooking the keyboard... like hotkeys in VoiceAttack) - again, most media players do this out of the box by, 'listening' for media keys.  VA can certainly simulate media keys, even if you don't have them on your keyboard.

On a side note, some applications can address specific out of focus apps with some level of, 'hack' (like multiboxing software), but that is not the normal nature of Windows apps, so, VA is not set up to do that.

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: Send commands to minimized window
« Reply #2 on: November 24, 2018, 08:17:41 PM »
SMPlayer lets you use regular keys or media keys.  Pause comes default with space or Media pause as what they call a key shortcut.  There is also a Play/Pause with Media Play, Toggle Media play as the shortcuts.  You can also use a left mouse click to play/pause the media.

The keyboard  (Razer Blackwidow Chroma 2) has three media keys plus volume control 

This is strange. SMPlayer does  not respond to the media keys when it's minimized or if it does not have focus but does respond to space bar or VA when I send the space for play/pause as long as it's not minimized even when it does not have focus.  SMPlayer appears to catch the space key even when it does not have the focus but once minimized it stops listening for the keys.  For the Media keys I guess it has to have focus.   I guess SMPlayer is not programmed to respond to media keys unless it has Focus and somehow does catch the space bar. It does not respond to other keys such as forward or back unless it has focus.

VLC only responds to the keys if it has focus.

It appears I can't do what I want with this application.  It's a shame we can't send input to a designated application even when minimized.


Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Send commands to minimized window
« Reply #3 on: November 24, 2018, 08:41:05 PM »
Hi, Malcom

Folks have been using VA media keys for years now.  VLC works great with media keys without focus here - as does Spotify and MusicBee.  I don't know about SMPlayer, as I do not have that.

I do remember VLC requiring specific setup to make it listen for global hotkeys.  I did a cursory search to find this:

https://superuser.com/questions/778760/vlc-player-hotkeys-will-only-work-while-it-is-selected


Hope that helps!


Gangrel

  • Caffeine Fulled Mod
  • Global Moderator
  • Full Member
  • *****
  • Posts: 216
  • BORK FNORK BORD
Re: Send commands to minimized window
« Reply #4 on: November 24, 2018, 09:09:17 PM »
With SMPlayer, if you go to the Keyboard and mouse part of the options window, there is the option to tick at the bottom to tick and choose which global media hotkeys it will listen to (These will be the Media play/pause/next/previous/stop Volume up/down/mute

I am going to say that if this box isn't ticked, then it would only listen if it had focus.

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: Send commands to minimized window
« Reply #5 on: November 24, 2018, 10:08:25 PM »
Gary, I never thought of doing the media keys by themselves. I think because I tried them with SMPlayer itself and had problems so I never did any more with VA but just used space which works when it has focus..

Gangrel's found the solution.  I had to tick the box and then change VA to send the media keys and it worked.  I overlooked the box since I figured if I put the keys in the key shortcuts it would listen!!! But that's not how it works.

Thanks, everyone.  It never occurred to me that a media app would not look at the keys all the time but I guess they don't want to interfer with other apps.
« Last Edit: November 25, 2018, 10:27:21 AM by MalcomR »