location of keyboard cursor

D

Doug

Hi

I am trying to find a way to make the mouse cursor move to the keyboard
cursor position in an application. For example, I use an application called
Enterprise Guide, and I control this application using Dragon naturally
speaking as I have a disability that makes using the keyboard quite
difficult.

I often have to say the name of an object to make to be the active or
highlighted object. However to do something such as drag and drop in Dragon
NaturallySpeaking , I need to have the mouse at the same position that I
want to drag from.

I know there are functions such as GetCursorPos - but this appears only to
work in terms of the mouse position. What I would like to do is to find the
coordinates of the current active highlighted object. An example of this
could be, in windows explorer, if your mouse position is on the right-hand
side of your screen, but you have a folder highlighted in the left pane. How
could you move the mouse cursor to the location where the highlighted object
is?

I would appreciate any suggestions, or any links to any sites that may
assist me.

Thank you for your help

Doug
 
N

Nathan Sokalski

If you are looking to get the coordinates of a highlighted object, then I
would suggest declaring two JavaScript variables and assign them the
appropriate values when the onfocus event occurs. To do this without
manually adding the onfocus event handler to all elements, use event
bubbling (sometimes event bubbling can be tricky in JavaScript, but in this
case, it is probably worth it). The only problem that this may present is if
there is an object that cannot have focus (for example, text on webpages
sometimes cannot recieve focus). This is the best suggestion I can give,
hopefully it will help you get closer to what you want.
 
D

Doug

Hi Nathan

Thanks for your suggestion - can you elaborate a little on this?

What is event bubbling?

I write C# and VB but am not too familiar with javascript.

Thanks

Doug
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top