KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Is there a way to move the mouse to the cursor position?
Topic Summary: ...
Created On: 03/19/2009 10:00 AM
Status: Post and Reply
Linear : Threading : Single : Branch
 Is there a way to move the mouse to the cursor position?   - onebigfish - 03/19/2009 10:00 AM  
 Is there a way to move the mouse to the cursor position?   - G.J. Premo - 03/19/2009 01:16 PM  
 Is there a way to move the mouse to the cursor position?   - Pranav Lal - 03/20/2009 08:34 AM  
 Is there a way to move the mouse to the cursor position?   - onebigfish - 03/23/2009 11:53 AM  
 Is there a way to move the mouse to the cursor position?   - Lunis Orcutt - 03/23/2009 06:20 PM  
 Is there a way to move the mouse to the cursor position?   - artsilen - 06/07/2010 05:45 PM  
 Is there a way to move the mouse to the cursor position?   - Chucker - 06/08/2010 06:46 AM  
 Is there a way to move the mouse to the cursor position?   - artsilen - 06/08/2010 03:18 PM  
 Is there a way to move the mouse to the cursor position?   - Lunis Orcutt - 06/08/2010 03:29 PM  
 Is there a way to move the mouse to the cursor position?   - Lunis Orcutt - 06/08/2010 09:32 AM  
 Is there a way to move the mouse to the cursor position?   - Allan - 08/26/2010 07:04 PM  
 Is there a way to move the mouse to the cursor position?   - G.J. Premo - 11/08/2010 02:04 PM  
Keyword
 03/19/2009 10:00 AM
User is offline View Users Profile Print this message

Author Icon
onebigfish
Top-Tier Member

Posts: 628
Joined: 11/08/2007

Is there a way to move the mouse to the current cursor position?


-------------------------


WORK: 12.5 Premium, KB2012, VoiceComputer, Windows7x64, i7 930, 12GB, Sennheiser DWPro1


HOME: 12.5 Premium, KB2012, VoiceComputer, Windows7x64, i5 760, 8GB DDR3, Airline 77/Andrea USB pod.




"Life's hard. It's even harder when you're stupid."


John Wayne


 03/19/2009 01:16 PM
User is offline View Users Profile Print this message


G.J. Premo
Top-Tier Member

Posts: 378
Joined: 05/12/2007

There has to be a way to do it.   There is a WordPerfect macro that will do it.

http://www.wpuniverse.com/vb/showthread.php?s=&threadid=9386&perpage=10&pagenumber=1

so the capability exists in Windows.    Dragon could call a third party macro program.

Whether the capability exists natively in Dragon, I don't know.

 03/20/2009 08:34 AM
User is offline View Users Profile Print this message


Pranav Lal
Senior Member

Posts: 145
Joined: 10/02/2006

This capability is found in most screen readers so it is doable in Windows. What are you trying to do?

 

Unless you write your own command, Dragon cannot route your mouse to the insertion pointer.



-------------------------
 03/23/2009 11:53 AM
User is offline View Users Profile Print this message

Author Icon
onebigfish
Top-Tier Member

Posts: 628
Joined: 11/08/2007

I have a few programs where Dragon does not respond well to "Click < what ever >" for certain buttons. The buttons are not always in a constant location, but they are in a constant location RELATIVE TO the cursor position. If I have the cursor position, I can then move the mouse accordingly to where it needs to be so that it can "click".

 

I can write the command in KnowBrainer.



-------------------------


WORK: 12.5 Premium, KB2012, VoiceComputer, Windows7x64, i7 930, 12GB, Sennheiser DWPro1


HOME: 12.5 Premium, KB2012, VoiceComputer, Windows7x64, i5 760, 8GB DDR3, Airline 77/Andrea USB pod.




"Life's hard. It's even harder when you're stupid."


John Wayne


 03/23/2009 06:20 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 22581
Joined: 10/01/2006

Check out the KnowBrainer Mouse <Direction> <1to100> command. This is an incremental mouse command which you could combine with the KnowBrainer Left Click command. A KnowBrainer example of this command might be:

HeardWord "Mouse", "Right", "67",
ButtonClick 1,1


-------------------------


Click KB 2012 REV D to Download a 30 Day Evaluation of KnowBrainer 2012 


 


 


 

 06/07/2010 05:45 PM
User is offline View Users Profile Print this message

Author Icon
artsilen
Top-Tier Member

Posts: 223
Joined: 12/11/2008

This is one that has been bugging me since I started using DNS. Now that I have KnowBrainer, presumably I have the capability to write a command that could identify the screen coordinates of the cursor/spike, coupled with a "move-to" command that could compute the heading and distance (in pixels) between the pointer and the spike. DNS uses a nine-square grid that is sequentially numbered right-to-left, top-to-bottom. Sequential refinements using the same patterned sequence place the cursor at the desired position on the screen. The process is a bit clumsy, and time-consuming, frequently requiring generating a three- or four-digit number to pinpoint the cursor. What we really want is something that will compute the hypotenuse of the resulting triangle, and move the cursor from its starting position to where we want it to be. If the cursor reflects an X/Y coordinate on the screen, I see no reason why an X/Y coordinate for the spike cannot be pinpointed as well; draw a line from one to the other, and move the cursor along that line accordingly. It seems simple enough, but no one appears to have done it. The other point that I would make is that there is no particular magic associated with the nine-box grid that DNS creates; why not a bull's-eye utilizing nested boxes, circles, or something in between, using the mouse cursor as a focal point?

-------------------------
Art Silen

artsilen@sbcglobal.net; art.silen.mediator@gmail.com  

"Question assumptions"

DSN 11.5, running on Win7;Intel Core i7 CPU 970 @3.20 GHz; System Memory 12 GB; Graphic AMD Radcon HD6570; System Board 2A861.04E01; System Bios 6.15

 06/08/2010 06:46 AM
User is offline View Users Profile Print this message

Author Icon
Chucker
Top-Tier Member

Posts: 9669
Joined: 10/10/2006

Quote:
This is one that has been bugging me since I started using DNS. Now that I have KnowBrainer, presumably I have the capability to write a command that could identify the screen coordinates of the cursor/spike, coupled with a "move-to" command that could compute the heading and distance (in pixels) between the pointer and the spike. DNS uses a nine-square grid that is sequentially numbered right-to-left, top-to-bottom. Sequential refinements using the same patterned sequence place the cursor at the desired position on the screen. The process is a bit clumsy, and time-consuming, frequently requiring generating a three- or four-digit number to pinpoint the cursor. What we really want is something that will compute the hypotenuse of the resulting triangle, and move the cursor from its starting position to where we want it to be. If the cursor reflects an X/Y coordinate on the screen, I see no reason why an X/Y coordinate for the spike cannot be pinpointed as well; draw a line from one to the other, and move the cursor along that line accordingly. It seems simple enough, but no one appears to have done it. The other point that I would make is that there is no particular magic associated with the nine-box grid that DNS creates; why not a bull's-eye utilizing nested boxes, circles, or something in between, using the mouse cursor as a focal point?

Art,

First, what you propose in the way you propose to do it is daunting enough even for the best of programmers.  Not only would it involve considerable time and effort, there are limits.

Second, VoicePower® Ultimate already does this in a superior and comprehensive, patent pending, manner unequaled by anything currently available.  This capability has been a part of VoicePower since DNS 7.0.

VoicePower uses a 100 x 100 X/Y coordinate Screen Grid (MouseGrid) that makes it extremely easy to locate screen coordinates, as well as supporting multiple monitors.  Mouse voice commands can be used with or without the Screen Grid, are easy to say, and support all possible mouse actions via single voice commands.

If you want to see this in action, go to www.VoiceTeach.com and go to the bottom of the landing page, locate, and click on the Voice Mouse demo in the rotating demo carousel.

The following is a listing of all of the VoicePower Mouse Voice commands.



Chuck Runquist
Technical Project Manager
VoiceTeach LLC
Home of VoicePower® Ultimate

"Tell me and I forget. Teach me and I remember. Involve me and I learn." - Benjamin Franklin



-------------------------

 06/08/2010 03:18 PM
User is offline View Users Profile Print this message

Author Icon
artsilen
Top-Tier Member

Posts: 223
Joined: 12/11/2008

Thank you! I looked at the VoicePower website and viewed the demonstration, and I must say that I was impressed. As I now have both DNS and KnowBrainer, I doubt that buying the VoicePower program would be cost-effective for me; and laying down another couple hundred dollars to find out what the differences would be does not appeal to me. If that targeting feature could be integrated into KnowBrainer, I would be all for it. The odd thing about all this is having to have a cheat-sheet tacked onto my computer screen to remind me of the coordinate number sequence to move the mouse cursor where it needs to go... it's like learning to shoot skeet, and how to pull lead on a moving target. The initial MouseGrid screen segments are too large to be really useful, and trying to compensate by dictating a binary number takes lots and lots of practice, and the learning curve is very steep. It hardly seems worth the effort. The only compensating factors appear to be that the hand-operated mouse takes up a lot of table top real estate, and the trackball causes repetitive motion injuries. Not much to choose from there.

One alternative might be a display that numerically identifies each active node on the screen; I recall seeing something like that on using the Windows speech recognition module. Selecting a numerically-identified bookmark on a screen would seem to be a reasonable alternative to having to physically move the mouse cursor from one location to another.

So, what should be a simple operation turns out to be far more complicated than I ever realized.



-------------------------
Art Silen

artsilen@sbcglobal.net; art.silen.mediator@gmail.com  

"Question assumptions"

DSN 11.5, running on Win7;Intel Core i7 CPU 970 @3.20 GHz; System Memory 12 GB; Graphic AMD Radcon HD6570; System Board 2A861.04E01; System Bios 6.15

 06/08/2010 03:29 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 22581
Joined: 10/01/2006

The numbers on the screen option will probably appear in DNS Ver. 11.

-------------------------


Click KB 2012 REV D to Download a 30 Day Evaluation of KnowBrainer 2012 


 


 


 

 06/08/2010 09:32 AM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 22581
Joined: 10/01/2006

KnowBrainer includes a Find Mouse Position command to locate your x & y coordinates but it only works in conjunction with DNS Pro; not Preferred. However, there are a number of freeware applications to locate exact mouse coordinates. Because we frequently need to take snapshots of part of our screen for our user guides and this forum, we use a utility called SnagIt 10 which automatically records the x & y coordinates. KnowBrainer also includes the ability to record rapid MouseGrid movements if you need to go that route However, it would appear that VoicePower is more ideally suited to controlling the mouse and creating mouse commands.

-------------------------


Click KB 2012 REV D to Download a 30 Day Evaluation of KnowBrainer 2012 


 


 


 

 08/26/2010 07:04 PM
User is offline View Users Profile Print this message


Allan
Top-Tier Member

Posts: 329
Joined: 03/25/2008

I have written a Natlink python script that does this exactly.

 

# Mouse to Cursor
# Python Macro Language for Dragon NaturallySpeaking
#   (c) Copyright 1999 by Joel Gould
#   Portions (c) Copyright 1999 by Dragon Systems, Inc.
#

import natlink
from natlinkutils import *

import win32ui, win32com, win32con, commctrl, win32api, traceback
import pythoncom
import SendKeys

from ctypes import *
user32 = windll.user32
import natlinkutils
import mousemacro
import time

class POINT(Structure):
    _fields_ = [("x", c_ulong),
                ("y", c_ulong)]
class RECT(Structure):
 _fields_ = [
     ("left", c_ulong),
     ("top", c_ulong),
     ("right", c_ulong),
     ("bottom", c_ulong)
 ]
class GUITHREADINFO(Structure):
 _fields_ = [
     ("cbSize", c_ulong),
     ("flags", c_ulong),
     ("hwndActive", c_ulong),
     ("hwndFocus", c_ulong),
     ("hwndCapture", c_ulong),
     ("hwndMenuOwner", c_ulong),
     ("hwndMoveSize", c_ulong),
     ("hwndCaret", c_ulong),
     ("rcCaret", RECT)
 ]
 #For mouse stuff
PUL = POINTER(c_ulong)
class KeyBdInput(Structure):
    _fields_ = [("wVk", c_ushort),
             ("wScan", c_ushort),
             ("dwFlags", c_ulong),
             ("time", c_ulong),
             ("dwExtraInfo", PUL)]
class HardwareInput(Structure):
    _fields_ = [("uMsg", c_ulong),
             ("wParamL", c_short),
             ("wParamH", c_ushort)]   
class MouseInput(Structure):
    _fields_ = [("dx", c_long),
             ("dy", c_long),
             ("mouseData", c_ulong),
             ("dwFlags", c_ulong),
             ("time",c_ulong),
             ("dwExtraInfo", PUL)]
class Input_I(Union):
    _fields_ = [("ki", KeyBdInput),
              ("mi", MouseInput),
              ("hi", HardwareInput)]
class Input(Structure):
    _fields_ = [("type", c_ulong),
             ("ii", Input_I)]       

class ThisGrammar(GrammarBase):

    gramSpec = """
        exported = mouse to cursor;
    """
   
    def initialize(self):
        self.load(self.gramSpec)
        self.activateAll()
    def gotResults_MouseToCursor(self,words,fullResults):
        print'gotResults_MouseToCursor'
        testing = 0
        if testing:natlink.playString('MouseToCursor rule caught'      
        guiInfo = GUITHREADINFO() #This creates a 'new' instance needed for ctypes
        guiInfo.cbSize = sizeof(GUITHREADINFO)               
        #Find the focused Window
        user32.GetGUIThreadInfo(0, byref(guiInfo))
        focussedWindow = guiInfo.hwndFocus
        #move the mouse to the cursor position or offset it to a location
        #a known distance away.
        x = 0;
        y = 0;
        user32.SetCursorPos(guiInfo.rcCaret.left+x,guiInfo.rcCaret.top+y)
        mousemacro.click()
        time.sleep(1)
        print 'moved mouse to cursor'
       
thisGrammar = ThisGrammar()
thisGrammar.initialize()

def unload():
    global thisGrammar
    if thisGrammar: thisGrammar.unload()
    thisGrammar = None

 11/08/2010 02:04 PM
User is offline View Users Profile Print this message


G.J. Premo
Top-Tier Member

Posts: 378
Joined: 05/12/2007

How to implement this Phython macro using Natlink?

 

Statistics
27361 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 2 users logged in.
The most users ever online was 2028 on 04/05/2013 at 07:36 PM.
There are currently 94 guests browsing this forum, which makes a total of 96 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2013 FuseTalk™ Inc. All rights reserved.