Socket
Socket
Sign inDemoInstall

@hscmap/keybind

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 0.0.2

16

lib/index.js

@@ -22,3 +22,5 @@ "use strict";

var key = keys[0];
this.key = key.length == 1 ? this.key = "Key" + key.toUpperCase() : key;
if (key.length != 1)
throw new Error("invalid keybind source: " + source);
this.key = keyCode2code(key.charCodeAt(0));
}

@@ -33,3 +35,3 @@ KeyCombination.prototype.match = function (e) {

KeyCombination.prototype.html = function () {
var m = this.key.match(/^Key([A-Z])$/);
var m = this.key.match(/^Key([A-Z1-9])$/);
var key = m ? m[1] : this.key;

@@ -47,6 +49,10 @@ return [

function whichKey(e) {
if (e.code)
return e.code;
return "Key" + String.fromCharCode(e.keyCode);
// if (e.code)
// return e.code
return keyCode2code(e.keyCode);
}
function keyCode2code(keyCode) {
var key = String.fromCharCode(keyCode);
return "Key" + key;
}
var Keybind = /** @class */ (function () {

@@ -53,0 +59,0 @@ function Keybind(kc, handler) {

{
"name": "@hscmap/keybind",
"version": "0.0.1",
"version": "0.0.2",
"main": "./lib/index.js",

@@ -5,0 +5,0 @@ "types": "./lib/index.d.ts",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc