[jawsscripts] Re: Modifying keypressed event

  • From: Jim Bauer <holdsworthfan@xxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Fri, 12 Jun 2009 11:46:17 -0500

In my experience, KeyPressedEvent has no bearing on what is and is not
passed to the active application.

A quick and dirty test case can be fabricated using notepad and trying
to return from KeyPressedEvent when an inherent keystroke (i.e.
left/rightControl+S) is detected. The code in your control structure
will execute and the key will still be passed to Notepad.

Original message
from: "Donald Marang" <donald.marang@xxxxxxxxx>
subject: [jawsscripts] Re: Modifying keypressed event
date: Fri, 12 Jun 2009 12:35:40 -0400

>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: