Almost there... Now, I just need to restrict to numpad and make the shift key work. The shift key is working with the numbers on top of keyboard, but not with numpad numbers. function main() {
var w = new Window("dialog" , "Script by LFCorullón");
var e = w.add("edittext" , [0,0,140,24] , "");
var v = w.add("edittext" , [0,0,140,24] , "");
e.addEventListener("keydown" , keypress);
function keypress(k) {
str = [];
if (k.ctrlKey) str.push("Ctrl");
if (k.altKey) str.push("Alt");
if (k.metaKey) str.push("Win");
if (k.shiftKey) str.push("Shift");
e.addEventListener("keyup" , keyup);
function keyup(k) {
if (k.keyName >= 0 && k.keyName <= 9) {
str.push(k.keyName);
e.text = "";
e.text = str.join("+");
}
}
}
w.show();
}
... View more