Re: inputCore.manager.emulateGesture() not firing all keystrokes?

Jacob Kruger

Ok, so, for example, if the control ID of the file menu is returned to me as 589989, from the focusObj.windowControlID sample in the tutorial, then, firstly , how would I pass a WM_COMMAND to it, and, could I choose between different ones, like activate/double-click and or just focus/single-click?

Secondly, sticking to mouse cursor methods, Or does it relate to either activating it, or moving mouse to hover over it, when I could then possibly invoke the context menu, if necessary?

In other words, how would I then invoke either a single or double-click of a mouse button? Using mouseHandler module?

And, truly for now, is there a way to retrieve relative coordinates of an element/item - as in, relative to window top, as opposed to relative to whole screen? Does that relate to the positionInfo section of an object that's been retrieved using something like the ID mentioned above -  or, for example, via api.getNavigatorObject()


Jacob Kruger
+2782 413 4791
Skype: BlindZA
"...resistance is futile...but, acceptance is versatile..."

On 2021-01-08 06:08 PM, James Scholes wrote:
If you're attempting to automate Notepad or other Win32 apps, it is far more efficient to send Windows messages to make it do what you want.  For example, you can send a WM_COMMAND message with the ID of a menu item to cause that item to be executed.  In addition, if you're wanting to open the File menu, I'd suggest locating that with object navigation and then clicking on it.  Understood that this will mean changes to your automation test file format.


James Scholes

On 08/01/2021 at 5:19 am, Jacob Kruger wrote:
Robert, this was more or less a test item - what am actually doing at this stage is sequencing activities, keystrokes, etc. one after the other, from lists of activities I am pulling out of a separate text file - with idea being that someone else could edit the automation tasks separately, and, yes, I am implementing pauses between actions, using time.sleep() inbetween, but, tried shifting the delay before this one up to 2 seconds?

Know this may come across as odd, or silly, but, here's the collection of actions in this context -  split them up based on | and || at run-time - purely just a test entry, to see if it worked:


That causes it to execute windows+r to bring up run dialogue, wait 0.5 seconds, paste notepad into edit box and wait 0.2 seconds, execute enter key, wait 2 seconds and then try to invoke alt+f?

This is just to possibly try help some guys automate some activities when they're working in certain contexts, and, yes, I am also using this to try get myself comfortable with NVDA add-on coding - will look into actual object interaction, etc. later on, but, for now, just want to see if can work out the simpler things.

Jacob Kruger
+2782 413 4791
Skype: BlindZA
"...resistance is futile...but, acceptance is versatile..."
On 2021-01-08 12:57 PM, Robert Hänggi wrote:
Do you want it to open a menu?
It might work better sequentially in this case with even a slight
pause in between.

On 08/01/2021, Daniel Gartmann <dgartmann@...> wrote:
These questions are extremely helpful to me as someone who has a hard time
getting started with NVDA add-on writing.

Let’s hope that some of these answers can be picked up by the great
developers on this list and put into the ad-on development guide for the
rest of us 😊.


Fra: <>
På vegne af Jacob Kruger
Sendt: 8. januar 2021 11:00
Til: NVDA-Addons <>
Emne: [nvda-addons] inputCore.manager.emulateGesture() not firing all

Ok, I will try to make this the last question for now - if I try to get it
to emulate a keystroke for something like alt+f or alt+d, it seems to be
ignoring it?

As in:

#code snippet

s_keystroke = "alt+f"

gesture = keyboardHandler.KeyboardInputGesture.fromName(s_keystroke)

#end snippet

And, nothing happens?

Things like control+v work fine, etc., as well as things like enter, etc.?


Jacob Kruger
+2782 413 4791
Skype: BlindZA
"...resistance is futile...but, acceptance is versatile..."


Join to automatically receive all group messages.