Compartilhar via


Secondary Events

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

You can determine what other events are taking place when a specific event is triggered. For example, when a mouse button is clicked, you may want to know whether the ALT key was down at the same time.

Event Attributes

The following event attributes are supported for skins:

  • altKey
  • button
  • clientX
  • clientY
  • ctrlKey
  • fromElement
  • offsetX
  • offsetY
  • screenX
  • screenY
  • shiftKey
  • srcElement
  • toElement
  • x
  • y
  • keyCode

For more information about these attributes, see the Skin Programming Reference.

Using Secondary Events

You can only process event attributes in JScript code. You must use the following syntax:

event.eventattributename

eventattributename is the name of the event attribute. For example, to determine whether the ALT key was pressed during a click event, you could use the following lines in your JScript code:

wasAlt = event.altKey ;
if (wasAlt = true)
{
   // Do something here.
}

Handling Events