
NPEvent
Represents an event passed by NPP_HandleEvent to a windowless plug-in.
Syntax
MS Windows
Mac OS
typedef EventRecord NPEvent; TYPE EventRecord = RECORD { what: Integer; message: LongInt; when: LongInt; where: Point; modifiers: Integer; END;
XWindows
Fields
NPEvent on MS Windows
The data structure has the following fields:
EventRecord NPEvent on Mac OS
NPEvent is defined as an EventRecord data structure, which has the following fields:
Description
MS Windows Description
The type NPEvent represents an event passed by NPP_HandleEvent to a windowless plug-in. For information about these events, see your MS Windows documentation.
Mac OS Description
The NPEvent object represents an event passed by NPP_HandleEvent to a windowless plug-in. This structure is defined as EventRecord, the event type used by Mac OS platform. On Mac OS, plug-ins receive the same events for both windowed and windowless plug-ins, as follows.
- Mouse events: Sent if the mouse is within the bounds of the instance.
- Key events: Sent if the instance has text focus (see below).
- Update events: Sent if the update region intersects the instance's bounds.
- Activate events: Sent to all instances in the window being activate or deactivated.
- Suspend/Resume events: Sent to all instances in all windows.
- Null events: Sent to all instances in all windows.
In addition to these standard types, the browser provides three additional event types that can be passed in the event->what field of the EventRecord:
- getFocusEvent: Sent when the instance could become the focus of subsequent key events, when the user clicks the instance or presses the tab key to focus the instance.
- If your instance accepts key events, return true, and key events will be sent to the instance until it receives a loseFocusEvent.
- If your plug-in ignores key events, return false, and the key events will be processed by Netscape itself.
- loseFocusEvent: Sent when the instance has lost the text focus, as a result of the user clicking elsewhere on the page or pressing the Tab key to move the focus. No key events are sent to the instance until the next getFocusEvent.
- adjustCursorEvent: Send when the mouse enters or leaves the bounds of the instance.
- If your plug-in wants to set the cursor when the mouse is within the instance, set the cursor and return true.
- If you don't want a special cursor, return false and the browser will use the standard arrow cursor.
XWindows Description
The NPEvent object represents an event passed by NPP_HandleEvent to a windowless plug-in. The NPEvent structure is defined as XEvent, the definition of the event type used by the XWindows platform. For information about the XEvent structure and XWindows events, see your XWindows documentation.
See Also
NPP_HandleEvent
|
Netscape Communications http://developer.netscape.com |
