[jawsscripts] Re: Modifying keypressed event

  • From: "Brian Hartgen" <jaws@xxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Fri, 12 Jun 2009 17:42:52 +0100

Thanks Don

That seems logical, I'll try it.
Thank you.


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Donald Marang
Sent: Friday, 12 June 2009 5:36 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Modifying keypressed event

Hi Brian,

I will give you an example of what I do.  I will set conditions to watch for

certain keys from certain windows to perform my desired action.  If I do not

want the key passed to the application, I use a Return statement after the 
action to exit my KeyPressedEvent function before it has a chance to call 
the default KeyPressedEvent function.  As in most system Event functions, 
the default event function you are overriding is normally called toward the 
end of your event function.  The default KeyPressedEvent function passes the

key to the application.

Void Function KeyPressedEvent (Int iKeyCode, String sKeyMapName, Int 
iBraille, Int iAttachedToScript)
If GetCurrentControlID () ==WCID_SEARCH Then
 If iKeyCode == key_ENTER  Then
  PerformScript GoToResults()
  Return
 EndIf

 KeyPressedEvent (iKeyCode, sKeyMapName, iBraille, iAttachedToScript)

 If iKeyCode == key_delete
 || iKeyCode == key_Backspace Then
  ; SayMessage (OT_DEBUG, "In KeyPressedEvent: deleting")
  ; SayMessage (OT_DEBUG, "KeyPressed, char pressed = " + sKeyMapName)
  UpdateResults ()
  SayResults ()
 EndIf
ElIf GetControlID (GetFirstChild (GetParent (GetCurrentWindow ()))) 
==WCID_VOICE_MAIL_PLAYER_STATUS Then
 If iKeyCode == key_SPACEBAR Then
  PerformScript PlayVoiceMail()
 EndIf
Else ; not in search edit box or Voice Mail Player
 KeyPressedEvent (iKeyCode, sKeyMapName, iBraille, iAttachedToScript)
EndIf

EndFunction

Don Marang


----- Original Message ----- 
From: "Brian Hartgen" <brian@xxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Friday, June 12, 2009 8:33 AM
Subject: [jawsscripts] Modifying keypressed event


> Hi
> I have modified the keypressed event function in order that, when 
> particular keystrokes are used, jaws speaks information rather than 
> passing the key through to the application.  This is fine, and jaws speaks

> what I want when the keys are pressed, but also jaws passses the key 
> through to the app.  How can I stop the keystroke please being passed to 
> the app?
>
> Thank you.
>
> Brian Hartgen
>
> __________
> Visit and contribute to The JAWS Script Repository http://jawsscripts.com
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
> 

__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

Other related posts: