JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 338
  • Score
    100M100P100Q79514F
  • License MIT

Create an event object

Package Exports

  • create-event

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (create-event) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

create-event

Create an event object.

Rewrite of ianstormtaylor/create-event to add npm+browserify support.

Example

var create = require('create-event');

var event = create('keydown', {
  ctrl: true,
  key: 'enter'
});

Installation

$ npm install create-event

API

var createEvent = require('create-event');

createEvent(type[, options])

Creates an event object, where type is one of the following possible Strings:

  • 'click'
  • 'dlbclick'
  • 'keydown'
  • 'keyup'

Default options:

{
  alt: false,
  bubbles: true,
  button: 0,
  cancelable: true,
  clientX: 0,
  clientY: 0,
  ctrl: false,
  detail: 1,
  key: 0,
  meta: false,
  relatedTarget: null,
  screenX: 0,
  screenY: 0,
  shift: false,
  view: window
}