Changeset 2139

Show
Ignore:
Timestamp:
06/17/08 02:31:04 (5 months ago)
Author:
mdcurran
Message:

Added scripts to the default appModule for clicking the left and right mouse buttons. This is something that has been asked for for a very long time. Please note though that these scripts click the mouse where ever it may currently be on the screen. So if you do want to click the object you are focused on or the object you have navigated to, you need to get the mouse there by using the moveMoseToNavigatorObject script. a leftMouseClick can be performed by pressing extendedDivide (numpad Slash) and a right mouse click can be performed by pressing multiply (numpad star). Also, mouseHandler now ignores injected events, like keyboardHandler. This is pretty much so speech doesn't get interupted just because the user activated these scripts, as they do announce 'left click' or 'right click'.

Location:
trunk/source
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/source/appModules/_default.py

    r2135 r2139  
    7272                        speech.speakSpelling(info._get_text()) 
    7373 
     74        def script_leftMouseClick(self,keyPress): 
     75                speech.speakMessage(_("left click")) 
     76                winUser.mouse_event(winUser.MOUSEEVENTF_LEFTDOWN,0,0,None,None) 
     77                winUser.mouse_event(winUser.MOUSEEVENTF_LEFTUP,0,0,None,None) 
     78        script_leftMouseClick.__doc__=_("Clicks the left mouse button once where ever it may be at the time.") 
     79 
     80        def script_rightMouseClick(self,keyPress): 
     81                speech.speakMessage(_("right click")) 
     82                winUser.mouse_event(winUser.MOUSEEVENTF_RIGHTDOWN,0,0,None,None) 
     83                winUser.mouse_event(winUser.MOUSEEVENTF_RIGHTUP,0,0,None,None) 
     84        script_rightMouseClick.__doc__=_("Clicks the right mouse button once where ever it may be at the time.") 
     85 
     86 
    7487        def script_reportCurrentSelection(self,keyPress): 
    7588                obj=api.getFocusObject() 
  • trunk/source/appModules/_default_desktop.kbd

    r2135 r2139  
    7878Control+NVDA+r=revertToSavedConfiguration 
    7979Control+NVDA+z=activatePythonConsole 
     80extendedDivide=leftMouseClick 
     81multiply=rightMouseClick 
  • trunk/source/mouseHandler.py

    r2135 r2139  
    6969def internal_mouseEvent(msg,x,y,injected): 
    7070        global mouseMoved, curMousePos 
     71        if injected: 
     72                return True 
    7173        if not config.conf['mouse']['enableMouseTracking']: 
    7274                return True