Re: [Xsltforms-support] a dead key
Brought to you by:
alain-couthures
From: COUTHURES A. <ala...@ag...> - 2011-01-23 15:46:51
|
Hello Jens, > The problem relates to both input and textarea. > > The problem occurs on WebKit browsers. I have tested Chrome/Chromium on all three platforms and on different machines, and Safari and OmniWeb on Mac OS. It also occurs with Opera, which uses Presto. It does not occur with Firefox or SeaMonkey (which use Gecko). > > The problem is - - - that I cannot input the character 'p'. I know this sounds cracy, 'P' is OK, and as far as I can see, 'p' is the only character affected. When the key for 'p' is pressed, nothing is input. It is not that 'p' does not get saved - it simply does not appear in the input field. Pasting in 'p's is OK, just as 'p's are loaded. - And no, there is not a piece of gum in my keyboard! 112 is the ascii code for 'p'! > The problem must have something to do with the change in xsltforms.js revision 469: line 1348 to revision 470 lines: 1348-1364 (since this is the only change between the two revisions): > > document.onhelp = new Function("return false;"); > window.onhelp = new Function("return false;"); > Event.attach(document, "keydown", function(evt) { > if (evt.keyCode == 112) { > alert("XSLTForms version id: Rev. 470\n\nhttp://www.agencexml.com/xsltforms\n\n(c) Alain Couthures - agenceXML - 2010"); > event.stopPropagation(); > event.preventDefault(); > return false; > } > }); > Event.attach(document, "keypress", function(evt) { > if (evt.keyCode == 112) { > event.stopPropagation(); > event.preventDefault(); > return false; > } > }); > > Keycode 112 would be F1. Pressing F1 brings up the loading times, but how does F1 relate to p?!? The issue is in the "keypress" handler because the keyCode property for this event should contain the ascii code instead. FireFox is not correct... I will simply remove the "keypress" handler, which doesn't seem to be useful anyway, and commit this as soon as possible. Thanks! -Alain |