keysim
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -121,2 +121,6 @@ (function (global, factory) { | ||
/** | ||
* @typedef {"keydown" | "keypress" | "keyup" | "textInput" | "input"} KeyEventsName | ||
*/ | ||
/** | ||
* Simulates a keyboard with a particular key-to-character and key-to-action | ||
@@ -167,3 +171,3 @@ * mapping. Use `US_ENGLISH` to get a pre-configured keyboard. | ||
* | ||
* @param {string} type One of "keydown", "keypress", "keyup", or "textInput". | ||
* @param {KeyEventsName} type | ||
* @param {Keystroke} keystroke | ||
@@ -193,2 +197,3 @@ * @param {HTMLElement} target | ||
case 'textInput': | ||
case 'input': | ||
event.data = String.fromCharCode(this.charCodeForKeystroke(keystroke)); | ||
@@ -259,2 +264,3 @@ break; | ||
* textInput data=A | ||
* input data=A | ||
* keyup keyCode=65 (A) charCode=0 shiftKey=true | ||
@@ -307,2 +313,5 @@ * keyup keyCode=16 (SHIFT) charCode=0 shiftKey=false | ||
target.dispatchEvent(textinputEvent); | ||
var inputEvent = this.createEventFromKeystroke('input', keystroke, target); | ||
target.dispatchEvent(inputEvent); | ||
} | ||
@@ -309,0 +318,0 @@ } |
{ | ||
"name": "keysim", | ||
"version": "2.1.0", | ||
"description": "Keyboard simulator for JavaScript.", | ||
@@ -11,3 +12,3 @@ "main": "dist/keysim.js", | ||
"type": "git", | ||
"url": "https://github.com/eventualbuddha/keysim.js" | ||
"url": "https://github.com/eventualbuddha/keysim.js.git" | ||
}, | ||
@@ -22,4 +23,3 @@ "scripts": { | ||
"test:node": "mocha", | ||
"prepublishOnly": "yarn build", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
"prepublishOnly": "yarn build" | ||
}, | ||
@@ -61,6 +61,4 @@ "files": [ | ||
"rollup-plugin-node-resolve": "^3.3.0", | ||
"semantic-release": "^4.3.5", | ||
"watchify": "^3.11.0" | ||
}, | ||
"version": "2.0.1" | ||
} | ||
} | ||
} |
@@ -23,5 +23,5 @@ # keysim.js | ||
for typing input into an element and one for typing non-input "action" | ||
keystrokes. _Note that none of the methods provided by keysim will trigger the | ||
keystrokes. **Note that none of the methods provided by keysim will trigger the | ||
browser's default behavior, such as inserting text or moving the cursor. It only | ||
allows you to test your event handling code by sending the correct DOM events._ | ||
allows you to test your event handling code by sending the correct DOM events.** | ||
@@ -28,0 +28,0 @@ ### Entering Text |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
116424
23
1109
1