R
Rodrigo Dias Cruz
Hello,
I'm developing a 'web' terminal which emulates the Linux console and
works on top of Firefox. I mean, it has two parts: a server-side part
and client-side one. The former is writen in Python and the later in
Javascript, specifically and intentionally writen to work on Firefox
only.
I'm currently working on the input handling system: the part which
handles keyboard events on the client. It gets a sequence of pressed
keys and builds a string with a sequence of keys codes. It then sends
the string to the server (via XMLHttpRequest) which does some
convertion and writes it on the process which is connected to the
terminal.
Given the context, my question is: does it happen only for myself, or
event.keyCode has always value 0 for onkeydown and onkeyup when
working with a non-english keyboard? (for onkeypress it is always 0
zero too, but with any keyboard, and seems to be a expected Firefox
behavior)
field.onkeydown = function catchCtrlKeys(event) {
alert(event.keyCode)
}
'field' is a DOM object for a text field.
I have no problems in getting the char code for non-english letters,
usually a big unicode number. But I do need to get the keyCode in
order to properly handle CTRL + <key> combinations no matter which is
the language. That works when using an english keyboard. Does anyone
know how whether it is really impossible to do that or doesn't work
only for me?
Just as a note, I'm not really using a non-english keyboard, I'm just
switching keyboard layouts to do my tests. I'm running Firefox 2.0 on
Ubuntu Linux 7.10 and Gnome 2.20.1.
Thank you,
Rodrigo.
I'm developing a 'web' terminal which emulates the Linux console and
works on top of Firefox. I mean, it has two parts: a server-side part
and client-side one. The former is writen in Python and the later in
Javascript, specifically and intentionally writen to work on Firefox
only.
I'm currently working on the input handling system: the part which
handles keyboard events on the client. It gets a sequence of pressed
keys and builds a string with a sequence of keys codes. It then sends
the string to the server (via XMLHttpRequest) which does some
convertion and writes it on the process which is connected to the
terminal.
Given the context, my question is: does it happen only for myself, or
event.keyCode has always value 0 for onkeydown and onkeyup when
working with a non-english keyboard? (for onkeypress it is always 0
zero too, but with any keyboard, and seems to be a expected Firefox
behavior)
field.onkeydown = function catchCtrlKeys(event) {
alert(event.keyCode)
}
'field' is a DOM object for a text field.
I have no problems in getting the char code for non-english letters,
usually a big unicode number. But I do need to get the keyCode in
order to properly handle CTRL + <key> combinations no matter which is
the language. That works when using an english keyboard. Does anyone
know how whether it is really impossible to do that or doesn't work
only for me?
Just as a note, I'm not really using a non-english keyboard, I'm just
switching keyboard layouts to do my tests. I'm running Firefox 2.0 on
Ubuntu Linux 7.10 and Gnome 2.20.1.
Thank you,
Rodrigo.