initWheelEvent method
Initializes a new mouse wheel event that the IDocumentEvent::createEvent method created.
![]() ![]() |
Syntax
HRESULT retVal = object.initWheelEvent(eventType, canBubble, cancelable, view, detail, screenXArg, screenYArg, clientXArg, clientYArg, buttonArg, relatedTargetArg, modifiersListArg, deltaX, deltaY, deltaZ, deltaMode);
Parameters
- eventType [in]
-
Type: BSTR
One of the following values, or a user-defined custom event type.
- canBubble [in]
-
Type: VARIANT_BOOL
- cancelable [in]
-
Type: VARIANT_BOOL
- view [in]
-
Type: IHTMLWindow2
An IHTMLWindow2 variable that specifies the active window, or NULL. This value is returned in the IDOMUIEvent::view property of the event. - detail [in]
-
Type: long
A number that can provide additional information about the event. This value is returned in the IDOMUIEvent::detail property of the event.
- screenXArg [in]
-
Type: long
The x-coordinate of the mouse pointer, relative to the upper-left corner of the screen. This value is returned in the IDOMMouseEvent::screenX property of the event.
- screenYArg [in]
-
Type: long
The y-coordinate of the mouse pointer, relative to the upper-left corner of the screen. This value is returned in the IDOMMouseEvent::screenY property of the event.
- clientXArg [in]
-
Type: long
The x-coordinate of the mouse pointer, relative to the upper-left corner of the browser's client area. This value is returned in the IDOMMouseEvent::clientX property of the event.
- clientYArg [in]
-
Type: long
The y-coordinate of the mouse pointer, relative to the upper-left corner of the browser's client area. This value is returned in the IDOMMouseEvent::clientY property of the event.
- buttonArg [in]
-
Type: unsigned short
The mouse button that caused the event. This value is returned in the IDOMMouseEvent::button property of the event.
- relatedTargetArg [in]
-
Type: IEventTarget
A reference to the related element. For more information, see IDOMFocusEvent::relatedTarget.
- modifiersListArg [in]
-
Type: BSTR
A space-separated list of any of the following values:
-
The left or right Alt key is pressed.
-
The Ctrl and Alt keys are pressed.
-
The Caps Lock toggle is enabled.
-
The left or right Ctrl key is pressed.
-
The Meta/Control key is pressed.
-
The Num Lock toggle is enabled.
-
The Scroll Lock toggle is enabled.
-
The left or right Shift key is pressed.
-
The left or right Windows logo key is pressed.
- deltaX [in]
-
Type: long
The distance that the mouse wheel has rotated around the x-axis. This value is returned in the IDOMWheelEvent::deltaX property of the event.
- deltaY [in]
-
Type: long
The distance that the mouse wheel has rotated around the y-axis. This value is returned in the IDOMWheelEvent::deltaY property of the event.
- deltaZ [in]
-
Type: long
The distance that the mouse wheel has rotated around the z-axis. This value is returned in the IDOMWheelEvent::deltaZ property of the event.
- deltaMode [in]
-
Type: unsigned long
The delta mode of the event. This value is returned in the deltaMode property of the event.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Standards information
- Document Object Model (DOM) Level 3 Events Specification, Section 5.2.4

