1.0.14 • Published 2 years ago

create-event v1.0.14

Weekly downloads
304
License
MIT
Repository
github
Last release
2 years ago

create-event

Create an event object.

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

Example

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

var event = createEvent('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'
  • 'dblclick'
  • '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
}
1.0.14

2 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

5 years ago

1.0.9

8 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago