PDA

View Full Version : gir.SendKeys equivalent



dringdahl
June 22nd, 2016, 02:31 PM
I am looking for a scripting function to send keystrokes to a window. I could not find such a function in Girder 6.

Ron
July 5th, 2016, 07:58 AM
Sorry we missed you Q here. I'll prepare a new release soon with this function included in Lua.

dringdahl
July 5th, 2016, 10:22 AM
Thank you very much

Ron
July 5th, 2016, 12:36 PM
Girder 6.0.18.1 has been released. You'll find the function under keyboard.sendKeys

dringdahl
August 13th, 2016, 04:50 PM
I was unable to send keystrokes to applications when using the girder service. I even tried to modify the service so it could both interact with the desktop and was logged in as the same user to no avail. The actual problem I encountered is that I could not obtain a window handle for the proper window using win.getWindowMatches(). The same behavior was experienced with or without the girder front end connected and running. Everything functioned as expected if I did not use the girder service, but instead ran the back end as part of the front end.

Ron
August 13th, 2016, 10:26 PM
The service by design cannot interact with the desktop. However what you need to do is run Girder as a service and then on your desktop run Girder remote and connect to the service. Make sure you set the session part of the targeting parameters to target your desktop session.

dringdahl
August 13th, 2016, 10:48 PM
How to specify the desktop target for the lua functions is not documented, at least not anywhere that I could find.

Ron
August 13th, 2016, 11:02 PM
That is a good question. Currently that is not possible from Lua. Only when using the tree actions can you specify the session target. I've added a item to the development list to add this feature.

dringdahl
August 14th, 2016, 12:14 AM
Fair enough. I work around the problem by running Girder with both front end and back end active in the main application. For my use, I don't need the front end at all if the service could interact with desktop applications directly (this would actually be preferred for my use case). In any case, I have a working solution currently so this is not a high priority item, but thank you for looking into it.