keydown/press
1) Chapter 9, p.284, "Keyboard events": the book states that both keydown and keypress events "occur repeatedly when key is held down".
However, with Mozilla (in Linux), I only see keypress events when holding down a key; for example, keyEventsExample2.htm (modified to print each event in one line, skipping print of arrKeys when empty) outputs, when pressing "a" and holding:
>event is keydown: target is txtInput, keyCode is 65, charCode is 0
>event is keypress: target is txtInput, keyCode is 0, charCode is 97
>event is keypress: target is txtInput, keyCode is 0, charCode is 97
......
>event is keypress: target is txtInput, keyCode is 0, charCode is 97
>event is keyup: target is txtInput, keyCode is 65, charCode is 0
So it seems that only the keypress is repeated. A small point, but just in case there is a misunderstanding.
2) [Premise: I am reading this book with a previous limited experience in JavaScript]. In Chapter 6, "Checking the node type", p.169, I suddenly found a notation that was never presented before (varNode= ...), which looked similar to a Perl hash reference (replacing the "=>" with ":"). I then found on the web that it is indeed the JavaScript "associative array".
Perhaps, the data type could be added to the first chapters in the 2nd edition of the book (if I am right that it does not appear; I may have missed it, of course, given the amount of information).
(Remarkable book, by the way; what a methodic, colossal effort. I look forward to the next one on Ayax, after I complete this one).
raul
|