Event Function Reference
This reference gives you basic information about event functions utilized by JAWS, MAGic and PAC Mate Omni. Most of these functions can be found in the default script file, Default.jss. You can view the code of each function by opening the default script file within the Script Manager.
AppWillNotSpeakEvent
Description This function is performed when an unauthorized application is opened in restricted mode. The function produces the "Cannot speak in Restricted Mode" message when authorization is either not found or inaccurate.
Syntax AppWillNotSpeakEvent (strApp)
Parameters strApp - String; the name of the application that will not speak in restricted mode
Returns None
Category Application info
AutoFinishEvent
Description This event Function is performed when the application is closed. The function is also performed when the application is switched from or looses focus, as with ALT + TAB.
Syntax AutoFinishEvent ()
Parameters None
Returns None
Category Application info
AutoStartEvent
Description This event Function is performed when the application is started. This function is also performed when the application is switched to or gets focus, as with ALT + TAB.
Syntax AutoStartEvent ()
Parameters None
Returns None
Category Application info
BottomEdgeEvent
Description This function is performed when the active cursor attempts to move beyond the bottom edge of the active window. The function receives the window handle as a parameter.
Syntax BottomEdgeEvent (WinHandle)
Parameters WinHandle - handle; handle of the window whose bottom edged was reached
Returns None
Category Cursors
CellChangedEvent
Description This function is performed when the cursor moves from one cell in a table to a new cell in either the same table, a nested table or parent table.
Syntax CellChangedEvent (nNewCol, nNewRow, nNewNesting, nNewRowColCount, nPrevCol, nPrevRow, nPrevNesting, nPrevRowColCount)
Parameters
nNewCol - integer; the number of the new column
nNewRow - integer; the number of the new row
nNewNesting - integer; the number of the new nesting
nNewRowColCount - integer; number of the new row and column counts
nPrevCol - integer; the number of the previous column
nPrevRow - integer; number of the previous row
nPrevNesting - integer; the number of the previous nesting
nPrevRowColCount - integer; number of the previous row and column counts
Returns None
Category Screen text
ClipboardChangedEvent
Description This event is performed when the contents of the Windows clipboard is replaced.
Syntax ClipboardChangedEvent ()
Parameters None
Returns None
Category Clipboard
CursorShapeChangedEvent
Description This function is performed when the mouse pointer changes shape. The name of the new shape is passed to this function via a string variable.
Syntax CursorShapeChangedEvent (CursorType)
Parameters CursorType - String; the string value for the current cursor type
Returns None
Category Cursors
DialogPageChangedEvent
Description This function is performed when switching between pages of a multipage dialog box.
Syntax DialogPageChangedEvent(hwndNewPage, hwndOldPage)
Parameters
hWndNewPage - Handle; handle of the new page in a multi page dialog box
hWndOldPage - Handle; handle of the old page in the multi page dialog box
Returns None
Category Dialogs
DocumentLoadedEvent
Description This function is performed when a document is loaded in Internet Explorer. The function starts SayAll when the web page loads.
Syntax DocumentLoadedEvent ()
Parameters None
Returns None
Category HTML
FocusChangedEventEx
Description This function is performed when focus moves between applications, dialogs, dialog controls, or to another item within a control with child items. The function must determine the type of focus change and then call the proper event to handle the type of focus change that has occurred.
Syntax FocusChangedEventEx (hWndFocus, nObject, nChild, hWndPrevFocus, nPrevObject, nPrevChild, nChangeDepth)
Parameters
hWndFocus - handle; the handle of the window that has received the focus
nObject - integer; the number of the object that has received the focus
nChildObject - integer; the number of the current child object
hWndPrevFocus - handle; the handle of the window that previously had the focus
nPrevObject - integer; the number of the object that previously had the focus
nPrevChild - integer; the number of the child object that previously had the focus
nChangeDepth - integer; the change depth (number of levels in the window hierarchy affected by the change)
Returns None
Category Window
FocusChangedEvent
Description This function is performed when focus moves between applications, dialogs, and dialog controls. The window handles of the previous and current windows are passed to this function. This function calls either SayWindowTypeAndText, SayFocusedWindow or SayFocusedObject in order to ensure that the active control is properly spoken.
Syntax FocusChangedEvent (FocusWindow, PrevWindow)
Parameters
FocusWindow - Handle; handle of the window that has received the focus
PrevWindow - Handle; handle of the window that previously had the focus
Returns None
Category Window
FocusPointMovedEvent
Description This function is performed when the pixel location of the blinking caret or highlight changes. Examples of focus changes include moving focus from one control to a different control within an application or dialog and moving the insertion point through a document. The pixel location is determined by video resolution as in row and column coordinates. Processor intensive code should not be included in this function as it is performed each time the PC cursor moves.
Syntax FocusPointMovedEvent (nX, nY, nOldX, nOldY, Unit, nDir, nTimeElapsed)
Parameters
nX - Integer; current horizontal coordinate of the PC cursor
nY - Integer; current vertical coordinate of the PC cursor
nOldX - Integer; previous horizontal coordinate of the PC cursor
nOldY - Integer; previous vertical coordinate of the PC cursor
nUnit - Integer; the movement unit as constant variables defined in hjconst.jsh
nDir - Integer; the direction of movement as constant variables defined in hjconst.jsh
nTimeElapsed - Integer; the amount of time (milliseconds) that has elapsed since the movement occurred
Returns None
Category Cursors
ForegroundIconicEvent
Description This event function is performed when all apps are minimized or closed and the focus is not placed on the desktop. More testing is needed before it is implemented.
Syntax ForegroundIconicEvent(HANDLE hwndForeground)
Parameters hwndForeground - Handle; handle of current foreground window (not focus)
Returns None
Category Window
ForegroundWindowChangedEvent
Description This function is performed each time a new real window gains focus. A real window is a window that has a title. Real windows are often application, and dialog main windows.
Syntax ForegroundWindowChangedEvent (newWindow)
Parameters NewWindow - Handle; handle of the new window
Returns None
Category Window
FormsModeEvent
Description This function is performed when forms mode is entered or exited. The function is passed a Boolean value indicating which of these actions has taken place. If bEntering is equal to true, forms mode has been turned on. If bEntering is equal to false, forms mode has been turned off
Syntax FormsModeEvent(bEntering)
Parameters bEntering - Integer; boolean value representing the current state of forms mode
Returns None
Category HTML
FrameLoadedEvent
Description This function is performed when a web page updates or loads content to a frame contained on the page. It is currently implemented in only the Internet Explorer script file.
Syntax FrameLoadedEvent (hDoc, sFrameName)
Parameters
hDoc - handle; the handle of the window of the parent document
sFrameName - string; the name of the frame being updated
Returns None
Category HTML
HelpBalloonEvent
Description This function is performed for Windows XP Help Balloons. In Windows XP two kinds of bubbles are displayed to provide help. The first is a ToolTip that is processed by the ToolTipEvent. The second is a Help Balloon that triggers this event.
Syntax HelpBalloonEvent(hwnd, sText)
Parameters
hWnd - Handle; the handle to the help balloon window
sText - String; the text of the help balloon
Returns None
Category Window
ItemNotFoundEvent
Description This event is performed when the item cannot be found in the Off Screen Model.
Syntax ItemNotFoundEvent (int hwnd)
Parameters hWnd - Integer; Window handle
Returns None
Category Screen text
JavaFocusChangedEvent
Description This function is performed when focus moves between Java applications, dialogs, and dialog controls.
Syntax JavaFocusChangedEvent (FocusWindow, PrevWindow)
Parameters
FocusWindow - handle; the handle of the window that has received focus
PrevWindow - handle; the window that previously had the focus
Returns None
Category Window
KeyPressedEvent
Description This function is performed when a keystroke is pressed. All key presses cause this function to fire. If the key is assigned to a script, then KeyPressedEvent is called before the script itself. Because this function will be called quite frequently, it is recommended that you refrain from intensive tasks that will be performed each time a keystroke is pressed.
Syntax KeyPressedEvent (nKey, strKeyName,IsBrailleKey, IsScriptKey)
Parameters
nKey - integer; numeric key value
strKeyName - string; key name as it is used in the key map file
IsBrailleKey - Integer; set to 1 if the key is on a Braille display
IsScriptKey - integer; set to one if the key is assigned to a script
Returns None
Category Keyboard
MagSendKeyEvent
Description If a MAGic key event is attached to a key in a key map file, then you can use this function to send the key event on to the MAGic interface. For example, when the key is pressed to toggle magnification, the KI_MAGONOFF needs to be passed on to the MAGic user interface for processing.
Syntax MAGSendKeyEvent (nKICode)
Parameters nKICode - integer; The code for the key event. These codes can be found in magcodes.jsh.
Returns Integer - If MAGic is not running, or nKICode is out of range, then the function will return FALSE. Otherwise, TRUE is returned.
Category MAGic
MenuModeEvent
Description This function is performed when the status of a menu changes. There are three menu modes as defined in HJCONST.JSH. They are: MENU_INACTIVE, MENUBAR_ACTIVE, and MENU_ACTIVE. This event receives the Handle of the menu and the mode of the menu as parameters.
Syntax MenuModeEvent (WinHandle, mode)
Parameters
WinHandle - Handle; handle of the menu
mode - Integer; the mode of the menu whose status has just changed
::: {#returns-21}
Returns
:::
None
::: {#category-22}
Category
:::
Menus
MouseMovedEvent
::: {#description-24}
Description
:::
This function is performed when the mouse is moved. This function is passed two integers. The first value specifies the x-coordinate at the position of the mouse pointer. The second parameter specifies the y-coordinate and the position of the mouse pointer.
::: {#syntax-22}
Syntax
:::
MouseMovedEvent (int x, int y)
::: {#parameters-22}
Parameters
:::
x - Integer; the horizontal position of the mouse pointer in pixels
y - Integer; the vertical position of the mouse pointer in pixels
::: {#returns-22}
Returns
:::
None
::: {#category-23}
Category
:::
Mouse
NewTextEvent
Description This function is performed when new text is written to the screen. When this function is called, it receives information pertaining to the newly written text. If the text was written in a frame, then the text is spoken according to the frame's echo setting. Otherwise the text is sent to SayHighlightedText () or SayNonHighlightedText ().
Syntax NewTextEvent (hwnd, buffer, nAttributes, nTextColor, nBackgroundColor, nEcho, sFrameName)
Parameters
hWnd - handle; Handle of the window containing the text that was written
Buffer - String; string containing the text that was written
nAttributes,- Integer; The attributes of the text that was written
nTextColor - Integer; The foreground color of the text that was written
nBackgroundColor - Integer; the background color of the text that was written
nEcho - Integer; the echo setting associated with this text
sFrameName - String; the name of the frame containing the newly written text if applicable
Returns None
Category Screen text
SayAllStoppedEvent
Description This function is performed when the SayAll function stops.
Syntax SayAllStoppedEvent ()
Parameters None
Returns None
Category Screen text
ScreenStabilizedEvent
Description This event is performed after no screen writes have occured within a reasonable amount of time. The window handle of the last window to which text was written is passed as the parameter to this event function.
Syntax ScreenStabilizedEvent (hWndLastTextWrite)
Parameters hWndLastTextWrite - handle; the window handle where the last text write occurred
Returns None
Category Screen text
SpeechToggledEvent
Description This function is performed whenever speech is turned on or off.
Syntax SpeechToggledEvent (bSpeechOn )
Parameters bSpeechOn - integer; This is the Boolean value whether speech has been turned on or off.
Returns None
Category Voices
TextSelectedEvent
Description This event is performed when text is selected or unselected.
Syntax TextSelectedEvent(strText, bUnSelecting)
Parameters
strText - String; the selected text.
bUnselecting - Integer; Boolean value used to indicate when text is being unselected.
bContainsSpeechMarkup - integer; Boolean value used to indicate whether or not text contains speech mark up. This parameter is optional.
Returns None
Category Selection
ToolTipEvent
Description This function event is called if the JCF option OPT_PROCESSTOOLTIPEVENT is set to one. It is also called by the autographics labeler. This event runs each time a tool tip appears. It currently is used only to store the text of the last tool tip in the global string variable STRLastTooltip.
Syntax ToolTipEvent (hWnd, strText)
Parameters
hWnd - Handle;
strText - String; tool tip text
Returns None
Category Window
TopEdgeEvent
Description This function is performed when the active cursor attempts to move beyond the top edge of the active window. The function receives the window handle as a parameter.
Syntax TopEdgeEvent (WindowHandle)
Parameters WindowHandle - handle; handle of the window whose top boundary was reached.
Returns None
Category Cursors
TutorMessageEvent
Description This event is performed after the FocusChangedEvent and when the focus moves between menu items. It is always called after NewTextEvent and hence SayHighlightedText. The function speaks tutor or access key messages.
Syntax tutorMessageEvent(hwndFocus, nMenuMode)
Parameters
hWndFocus - Handle; handle of the window with focus
nMenuMode - Integer; menu mode
Returns None
Category Help
WindowActivatedEvent
Description This function is generally triggered when focus changes because of the opening or closing of a top-level window, such as when a dialog appears or disappears.
Syntax WindowActivatedEvent (hWindow)
Parameters hWindow - handle; handle of the window just activated
Returns None
Category Window
WindowCreatedEvent
Description This function is performed when a window is created. Processor intensive code should not be included in this function, as The code within this function is processed very frequently.
Syntax WindowCreatedEvent (handle hWindow, int nLeft, int nTop, int nRight, int nBottom)
Parameters
hWindow - Handle; handle of the window just created
nLeft - Integer; left edge of the window
nTop - Integer; top edge of the window
nRight - Integer; right edge of the window
nBottom - Integer; bottom edge of the window
Returns None
Category Window
WindowDestroyedEvent
Description This function is performed when a window is closed. This function can be modified for application specific needs.
Syntax WindowDestroyedEvent (handle hWindow)
Parameters hWindow - Handle; handle of the window that is about to be closed
Returns None
Category Window
WindowMinMaxEvent
Description This function is performed when the Minimize/Maximize status of a window changes. nMinMaxRest gives general information about what is happening to the window. It can be WE_MINIMIZE, WE_MAXIMIZE, or WE_RESTORE. nShow is more specific. For a complete list of nShow values, look for "SW_" in hjconst.jsh.
Syntax WindowMinMaxEvent (hWindow, nMinMaxRest, nShow)
Parameters
hWindow - Handle; the handle of the window whose status is about to change
nMinMaxRest - Integer; describes the general action about to take place on the window
nShow - Integer; describes the specific action taking place on the window
Returns None
Category Window
WindowResizedEvent
Description This function is performed when a window is about to be resized. This function can be modified for application specific needs.
Syntax WindowResizedEvent (handle hWindow, int nLeft, int nTop, int nRight, int nBottom)
Parameters
hWindow - Handle; handle of the window about to be resized
nLeft - Integer; the left edge of the window that is about to be resized
nTop - Integer; the top edge of the window that is about to be resized
nRight - Integer; the right edge of the window that is about to be resized
nBottom - Integer; the bottom edge of the window that is about to be resized
Returns None
Category Window