39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
-
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
+
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
|
setTimeout(function() {
if (document.activeElement.className != "button") {
focusPin();
}
}, 1);
}
document.getElementById('pin').onkeypress = function(keyEvent) {
document.getElementById('pin').onkeypress = document.getElementById('pin').onkeyup = function(keyEvent) {
var tryKeyPressed;
var keyPressed;
var idx;
if (!keyEvent) {
return(true);
}
tryKeyPressed = [];
if (!keyEvent.keyIdentifier) {
if (keyEvent.keyIdentifier) {
return(true);
tryKeyPressed.push(keyEvent.keyIdentifier);
}
if (keyEvent.keyIdentifier != "Enter") {
if (keyEvent.code) {
return(true);
tryKeyPressed.push(keyEvent.code);
}
for (idx = 0; idx < tryKeyPressed.length; idx++ ) {
keyPressed = tryKeyPressed[idx];
switch (keyPressed) {
case "Enter":
clickOk();
clickOk();
return(false);
return(false);
case "Escape":
clickCancel();
return(false);
}
}
return(true);
};
}, 1);
|