mirror of
https://github.com/taigrr/JSKeyCapture
synced 2025-01-18 04:13:12 -08:00
Update lib.js
Added releaseKeys and releaseKey functions
This commit is contained in:
parent
3827378add
commit
d2f0e55854
13
lib.js
13
lib.js
@ -32,6 +32,19 @@ function releaseAllKeys()
|
||||
keyStrokes[i] = false;
|
||||
}
|
||||
}
|
||||
function releaseKeys(toRelease)
|
||||
{
|
||||
if(typeof toRelease !== "object" && (!Array.isArray || Array.isArray(toRelease)))
|
||||
throw new TypeError("Expected array");
|
||||
for(var i=0;i< toRelease.length;i++)
|
||||
{
|
||||
keyStrokes[toRelease[i]] = false;
|
||||
}
|
||||
}
|
||||
function releaseKey(toRelease)
|
||||
{
|
||||
keyStrokes[toRelease] = false;
|
||||
}
|
||||
var key = {
|
||||
A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,
|
||||
ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,
|
||||
|
Loading…
x
Reference in New Issue
Block a user