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.

Sending a keystroke to unfocused application

Got a good idea? You can suggest new features here.
GOnzo
Posts: 9
Joined: Tue Jul 03, 2007 12:16 pm

Sending a keystroke to unfocused application

Post by GOnzo »

Hallo to everybody,
I'm sory for that simple question, but I'm new in EG. Can I control with remote controler unfocused application? Situation is simple, my wife is running browser, I listening a music, but I want to change tracks etc.
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Post by Bartman »

Just add a find window action at the beginning of the makros.
GOnzo
Posts: 9
Joined: Tue Jul 03, 2007 12:16 pm

Post by GOnzo »

Bartman wrote:Just add a find window action at the beginning of the makros.
A yes, It was too easy. Thanks a lot.
GOnzo
Posts: 9
Joined: Tue Jul 03, 2007 12:16 pm

Post by GOnzo »

Sorry but, I got one problem more. When I send a keystroke to unfocused application, it also goes to focused application. How to disable it?
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Sending a keystroke to unfocused application

Post by Bitmonster »

Please post the full macro here between CODE tags.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
GOnzo
Posts: 9
Joined: Tue Jul 03, 2007 12:16 pm

Re: Sending a keystroke to unfocused application

Post by GOnzo »

Maby I used wrong words. I'd like to know, it is possible to direct an emulation of keystroke (from remote controller) just to one application. Becouse it is normal, when I send an emulation of keystroke to unfocused application it also goes to focused application, which could have also a key assignment. More simply ->> I push next button on my remote --> hidden music player plays next song --> focused web browser goes to the next page (and I don't want it to do that). For now my macro consist of: Event Forward form remote, Find window of music player, Emulate keystroke. So, how to send an emulation of keystroke only to music player?
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Sending a keystroke to unfocused application

Post by Bitmonster »

If the macro has a FindWindow first, the keystroke should go to this application solely. So either the macro isn't configured right or the other application in front grabs them even though it shouldn't (by not handling window messages right) or EG has a bug. So please post an example macro between CODE tags, so we can see what is happening.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
GOnzo
Posts: 9
Joined: Tue Jul 03, 2007 12:16 pm

Re: Sending a keystroke to unfocused application

Post by GOnzo »

I don't know what you mean as 'CODE tags'. I didn't make any python programming, so I don't have any code if you mean this. A macro consist of 'find window' and 'emulate keystyroke' items only. Find window point to foobar and emulate keystroke get 'v' in configuration form, thats it. I don't know how to get its CODE.
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Sending a keystroke to unfocused application

Post by Bartman »

Choose the macro in the tree and press Ctrl+C to copy it to the clipboard.
Then reply to this topic and hit the code button and then press ctrl+v to insert it. The code tags have be used, so that the formatting stay intact.
GOnzo
Posts: 9
Joined: Tue Jul 03, 2007 12:16 pm

Re: Sending a keystroke to unfocused application

Post by GOnzo »

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="908">
<Macro Name="Next Track" Expanded="True">
<Event Name="X10.Forward">
</Event>
<Action>
Window.FindWindow(u'foobar2000.exe', None, None, None, None, None, False, 0.0, 0)
</Action>
<Action>
Window.SendKeys(u'v', True)
</Action>
</Macro>
</EventGhost>
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Sending a keystroke to unfocused application

Post by Bitmonster »

The macro looks OK so far. Which application receives the keystroke simultaneous to foobar2k?
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
GOnzo
Posts: 9
Joined: Tue Jul 03, 2007 12:16 pm

Re: Sending a keystroke to unfocused application

Post by GOnzo »

Opera web browser.
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Sending a keystroke to unfocused application

Post by Bitmonster »

I remember someone has posted a similiar problem with the opera browser. It seems this is one of the applications, that don't use Windows messages as it should and polls the low-level keyboard-state instead.

BTW: Why don't you use the foobar-plugin?
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
GOnzo
Posts: 9
Joined: Tue Jul 03, 2007 12:16 pm

Re: Sending a keystroke to unfocused application

Post by GOnzo »

yes, I know that there is a foobar plugin, even I put it in autostart tree node, but I don't know how to activate it. In that state it do nothing. I was looking for any help for plugins but I didn't found.
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Sending a keystroke to unfocused application

Post by Bitmonster »

Have you set the installation path to foobar correctly in the plugin?
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
Post Reply