Firefox Up Down key setEvent ("onkeydown" override problem?
Firefox Up Down key setEvent ("onkeydown" override
Hi,
Using up and down key in firefox is unstable. I overwrite the keydown function like this
obj.setEvent("onkeydown", function(e) {
this.trapkey (e);
} );
openmodelinggrid.prototype.trapkey = function (e) {
var kbactions = {
38 : "up",
40 : "down",
33 : "pageUp",
34 : "pageDown",
36 : "home",
35 : "end" };
var nkey = e.keyCode, nindex;
ckey = String.fromCharCode (nkey);
nkey = ckey.charCodeAt ();
if (nkey == 45) { // insert
if (this.parent.addpossible) this.addsearchfilteraction ("Add", "add");
} else if (nkey == 46) { // delete
nindex = this.getProperty("selection/index");
alert ("Delete" + nindex);
} else {
var action = kbactions [nkey];
if (action) {
this.action (action);
e.returnValue = false;
e.cancelBubble = true;
} else {
if (this.getOpenmodelingProperty ("contextmenuvisible") && this.parent && this.parent.page) this.parent.page.trapkey (e);
}
}
return (null);
}
The arrowdown key is doing well but the upkey fires one time and then trapkey is not fired after clicking a row again I can use the uparrow again for one row up.
In IE no problems.
I run on Firefox 1.0 and 1.02
John
Hi,
Using up and down key in firefox is unstable. I overwrite the keydown function like this
obj.setEvent("onkeydown", function(e) {
this.trapkey (e);
} );
openmodelinggrid.prototype.trapkey = function (e) {
var kbactions = {
38 : "up",
40 : "down",
33 : "pageUp",
34 : "pageDown",
36 : "home",
35 : "end" };
var nkey = e.keyCode, nindex;
ckey = String.fromCharCode (nkey);
nkey = ckey.charCodeAt ();
if (nkey == 45) { // insert
if (this.parent.addpossible) this.addsearchfilteraction ("Add", "add");
} else if (nkey == 46) { // delete
nindex = this.getProperty("selection/index");
alert ("Delete" + nindex);
} else {
var action = kbactions [nkey];
if (action) {
this.action (action);
e.returnValue = false;
e.cancelBubble = true;
} else {
if (this.getOpenmodelingProperty ("contextmenuvisible") && this.parent && this.parent.page) this.parent.page.trapkey (e);
}
}
return (null);
}
The arrowdown key is doing well but the upkey fires one time and then trapkey is not fired after clicking a row again I can use the uparrow again for one row up.
In IE no problems.
I run on Firefox 1.0 and 1.02
John
May 9,