Comparing version 0.3.0 to 0.4.0
@@ -132,7 +132,12 @@ // Generated by CoffeeScript 1.8.0 | ||
this["case"] = exports.Keypad.caselist[0]; | ||
this.on('push', (function(_this) { | ||
this.on('press', (function(_this) { | ||
return function(key) { | ||
return _this.ProcessKey(key); | ||
return _this.ProcessKeyPress(key); | ||
}; | ||
})(this)); | ||
this.on('hold', (function(_this) { | ||
return function(key) { | ||
return _this.ProcessKeyHold(key); | ||
}; | ||
})(this)); | ||
} | ||
@@ -142,8 +147,25 @@ | ||
/** | ||
Process a keyhold | ||
@method ProcessKeyHold | ||
@param {String} key Key character | ||
*/ | ||
_Class.prototype.ProcessKeyHold = function(key) { | ||
if (key == null) { | ||
throw new Error('Please specify pressed key code'); | ||
} | ||
if (key === 'c') { | ||
return this.Backspace(); | ||
} | ||
return this.InsertCharacter(key); | ||
}; | ||
/** | ||
Process a keypress | ||
@method ProcessKey | ||
@method ProcessKeyPress | ||
@param {String} key Key character | ||
*/ | ||
_Class.prototype.ProcessKey = function(key) { | ||
_Class.prototype.ProcessKeyPress = function(key) { | ||
var current_index; | ||
@@ -240,3 +262,3 @@ if (key == null) { | ||
} | ||
inserted = this.GetInsertCharacter(); | ||
inserted = this.GetInsertCharacter(text); | ||
this.text += inserted; | ||
@@ -243,0 +265,0 @@ this.ClearKeys(); |
{ | ||
"name": "keypad", | ||
"description": "12-key keyboard layout emulation, similar to one that is used in mobile phones", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"repository": "https://github.com/muchweb/keypad", | ||
@@ -6,0 +6,0 @@ "license": "GPL-3.0+", |
@@ -1,2 +0,2 @@ | ||
# Keypad [![Build Status](https://travis-ci.org/muchweb/keypad.svg)](https://travis-ci.org/muchweb/keypad) [![NPM version](https://badge.fury.io/js/keypad.svg)](http://badge.fury.io/js/keypad) ![License: GPLv3+](http://img.shields.io/badge/license-GPLv3%2B-brightgreen.svg) | ||
# Keypad [![Build Status](https://travis-ci.org/muchweb/keypad.svg)](https://travis-ci.org/muchweb/keypad) [![NPM version](https://badge.fury.io/js/keypad.svg)](http://badge.fury.io/js/keypad) ![License: GPLv3+](http://img.shields.io/badge/license-GPLv3%2B-brightgreen.svg) [![Dependency Status](https://gemnasium.com/muchweb/keypad.svg)](https://gemnasium.com/muchweb/keypad) | ||
@@ -3,0 +3,0 @@ 12-key keyboard layout emulation, similar to one that is used in mobile phones. |
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
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
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
1
65586
323
1