Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Is there a way to send a keystroke to a background program?

If you have a question or need help, this is the place to be.
Post Reply
DMcK
Posts: 9
Joined: Sun Mar 27, 2011 5:22 am

Is there a way to send a keystroke to a background program?

Post by DMcK »

Hi,

Is there some way to send a "space" to a background program without bringing it to the front?

Thanks,
Doug
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Is there a way to send a keystroke to a background progr

Post by jonib »

DMcK wrote:Is there some way to send a "space" to a background program without bringing it to the front?
Sure, just add a Find a window action before.
Some programs can be very picky what window you choose in the Find a window action.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
DMcK
Posts: 9
Joined: Sun Mar 27, 2011 5:22 am

Re: Is there a way to send a keystroke to a background progr

Post by DMcK »

Thanks! I can see how some programs would be picky...toolbars, workspaces, etc are all windows. I tried emulating a Keystroke by sending {Space}, but it doesn't do anything. Is there a better way to send a keystroke?

Thanks again!
mickelin
Experienced User
Posts: 85
Joined: Sun Jan 04, 2009 5:54 pm

Re: Is there a way to send a keystroke to a background progr

Post by mickelin »

Please provide some more context and info on what you are trying to do. What window? What do you expect from sending the space? Are you sending just the space or other keys as well? Is there a keyboard shortcut you could use instead? There are lots of possibilities, but we need to know what you are trying to do.
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Is there a way to send a keystroke to a background progr

Post by jonib »

DMcK wrote:I tried emulating a Keystroke by sending {Space}, but it doesn't do anything.
You might need to send it to a hidden window, using the Search invisible items option.
Is there a better way to send a keystroke?
Sorry don't know.

What program are you trying to send the keystroke to? And did you put the Find window action right before the keystroke action? you could test to send a key to for example Notepad just so you know the macro is correct.

Edit: Did you try the Alternate method in the keystroke action?

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
DMcK
Posts: 9
Joined: Sun Mar 27, 2011 5:22 am

Re: Is there a way to send a keystroke to a background progr

Post by DMcK »

Hi,
It turns out all I needed to do was wait long enough for the window to appear. My script was being aborted because the windows wasn't there...yet. It now works.

mickelin, you're probably the same mickelin as on the MP forum for the EventTrigger plugin so you'll probably get all this. I'm having trouble with 1080p24 content stuttering after switching from 60Hz to 24Hz. I think I've found a workaround and it involves launching GraphStudio when a video is played in MP, playing a video clip in GraphStudio (in the background) for a moment, and then exiting. This gets rid of my stuttering.

Thanks for the help, all!

Doug
Post Reply