keyboard shortcuts doesnt work in fullscreen

If you have a question or need help, this is the place to be.
Post Reply
Terr
Posts: 14
Joined: Wed Jul 11, 2018 8:42 am

keyboard shortcuts doesnt work in fullscreen

Post by Terr » Fri Jul 27, 2018 7:27 pm

keyboard shortcuts doesnt work in fullscreen
is it normal ?
or i can to solve this problem ?

User avatar
kgschlosser
Site Admin
Posts: 4623
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: keyboard shortcuts doesnt work in fullscreen

Post by kgschlosser » Mon Jul 30, 2018 5:14 pm

keyboard shortcuts? do you mean using the send keystrokes action?

if that is the case you should always target the window using the find window action first. and then send the keystrokes.
If you like the work I have been doing then feel free to Image

rebirth24
Posts: 7
Joined: Sat Jul 15, 2017 7:40 pm

Re: keyboard shortcuts doesnt work in fullscreen

Post by rebirth24 » Sun Dec 16, 2018 12:59 am

I am having SERIOUS issues getting this to work reliably. I am trying to do something simple when it comes to focusing on an already running iTunes instance and hit {CTRL+.} in order to stop whatever is playing (standard itunes command) It seems eventghost doesn't do well with CTRL combinations for some reason. Testing a Space bar keyboard send is no issue but CTRL works 1 out of 10 times. Any help would be appreciated as just hitting space bar is a toggle of playing/stopping a song and would not help in this case.

User avatar
kgschlosser
Site Admin
Posts: 4623
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: keyboard shortcuts doesnt work in fullscreen

Post by kgschlosser » Sun Dec 16, 2018 3:45 am

ok let me explain this..

when you want to emulate keyboard input you need to have a destination to send the input to. Now by default windows will use the window at the top of the zorder, what that means is it will send to whatever window is in focus. Unless a specifiic window handle is given to send the keystrokes.

Now do not misinterpret the term window handle. a window handle is not the ID of the "Window" it is but it goes a little further then that. Just about every element inside of an application Window is also a Window. every button. every text entry field. every menu. so on and so forth. each one of these "widgets" also has a Window handle. so for instance if you wanted to press the OK button in an application. You would not target the window handle that is assigned to the whole application window, you would want to target specifically the OK button and then send the keystroke of {Enter} to it. this will ensure that the proper element gets the keystroke.

I am thinking that what is happening is that one out of every 10 times you actually have the proper thing in focus and the send keystroke action does it's job properly.

so we now want to make sure that it does it's job every time. You do not need to have the window in focus in order to send a keystroke to it. you simply need to have the correct handle to the element you want to send the keystrokes to. Sometimes this is a trial and error process. you may have to target specifically the music playback section of the application and send the keystrokes to that.

I hope that makes some sense I know it is a bit confusing but you will get the idea once you start messing around with it some.

So this is where we are going to want to start off.. you will want to use the Find Window Action before the Send Keystrokes Action. So create that Find Window Action. in that action there is a whole lot of options. we are interested specifically in one feature. the cross hairs on the upper right. when you click and hold down on those cross hairs you will be able to drag it over the application you want to control. when you do this you will see different elements in that application get an outline around them. each element that gets an outline has it's own handle. so you will then want to target what you think you need to send the keystrokes to.


There is a slew of options in the Find Window Action. But for the time being we are only going to use those cross hairs and we also want to click on the button on the upper left that says stop macro if target is not found. we want that item checked off. this will make sure that if the program is not opened and EventGhost is not able to locate it. the keystrokes will not end up some place you may not want them. then down at the bottom check off the Only return and in the box to the right of that make sure there is a 1 in there. then click on apply. and then OK

now add the Send Keys action. and in that action enter {Ctrl+.} I think you have that portion down. Those are the only 2 actions you will need. there is no reason to change the focus to the application you want the keystrokes to. EG will find it if it is open and then it will send the keystrokes to it. and if it cannot find it then it will terminate the macro and not send any keystrokes at all.

depending on the application you can have some difficulties locating specific controls and depending on the application it may not use the same window handles that it does when the application is windowed vs full screen. That is where a program like Window Inspector can be handy. You can explore various window elements using that. specifically the zorder dialog in it. this will give you the class name and the process name. of the item that you have focused on and if you perform the keystrokes manually and it works then those are the items you will manually enter into the Find Window Action.

There are other alternatives as well. you can also use the Process Watcher+ plugin. this will generate an event when you open the program. the information attached to the event as the payload is an interface to that specific application window. It allows you to do all sorts of things like moving the window around. minimizing it. restoring it. making it flash. And of course sending keystrokes to it.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4623
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: keyboard shortcuts doesnt work in fullscreen

Post by kgschlosser » Sun Dec 16, 2018 4:03 am

Trust me I know this can frazzle ya a lot. I have been suing EG for a number of years now. I didn't have anyone explain to me what I am explaining to you now. I learned the really hard way. and lot some hair in the process. Remember to breathe. And ask me all the questions you like. If i have the answer I will give you one. If I don't' I'll BS my way through it.. LOL.. nah I will do my best to help ya with get an answer. One thing you also have to remember.. this is Microsoft Windows we are dealing with here. that should be all I have to say. so you really gotta appreciate what EG can do to manipulate the OS in the manner that it does. And also fix the shortfalls and problems associated with Windows as well. Windows is a HUGE piece of software. written by (if i had to guess) no less then 10K different programmers. and none of them knew what the hell the other was doing. It is shocking that Windows even runs like it does. In some cases there are things that are out of our control. when application developers do half ass'd things as well. things like hanging up the Windows Notification system because instead of launching a thread to handle whatever it is it needs to do when a notification comes in it does it right from the thread that sent in the notification. and that causes a failure in the notification from getting passed down the chain. Thiis is something that could be going on as well. There are alot of hands in the cookie jar here. and there is an enormous number of applications that do things like breaking the clipboard chain. and cause notifications to not propagate like they should. EG is a very small piece of software. and we do out best to fix these kinds of issues and as much as I would love to make the statement that EG will always do what it needs to do. I cannot. As much as we try to "monkey patch" and code around issues in Windows and other software we cannot catch every single glitch.

Now I will say this. How well do you think the Mac programmers made a piece of software that runs on Windows??? In all honesty... They could really give a rats ass if they screw up the Windows notification system and cause other apps not to function properly. So long as iTunes is not affected they don't care. It is the Apple mentality. and the same would go for Microsoft developers making applications that run on OSX. So long as their app is functioning. And you know as well as I that iTunes on Windows does not run correctly.

Maybe someone else that uses itunes and uses keyboard emulation on it can chime in and provide some input. if they encountered any problems and if/how they were overcome. I personally do not use the application. So I have no specific information if this kind of thing is a common problem with iTunes. I would have to do some digging about to find out. I think that iTunes may have a Windows notification API or a COM API so instead of emulating keystrokes it would be a direct function call to make it do what you want.

Let me do a little digging on that end of things
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4623
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: keyboard shortcuts doesnt work in fullscreen

Post by kgschlosser » Sun Dec 16, 2018 4:05 am

and look at what I found

http://www.joshkunz.com/iTunesControl/

Now I need to know specifically what you are trying to accomplish
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4623
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: keyboard shortcuts doesnt work in fullscreen

Post by kgschlosser » Sun Dec 16, 2018 8:28 am

I wanted to give you a heads up on this.

I thought my membership to Apple developer expired a very long time ago. I guess it didn't. so I got my hands on the most recent release of the iTunes Windows COM SDK.

I have already converted the SDK to python. You can have a look see at the attached file.
I still have some more work to do but basically You will be able to manipulate iTunes in any way you like when I am done with this.
Attachments
iTunesCOMInterface_h.py
(115.46 KiB) Downloaded 6 times
If you like the work I have been doing then feel free to Image

Post Reply