| Summary: | [test case] javascript keyboard error with konqueror at shabdkosh.com Shift, Caps, Alt, keys are undefined | ||
|---|---|---|---|
| Product: | [Applications] konqueror | Reporter: | Mohd Asif Ali Rizwaan <maarizwan> |
| Component: | khtml ecma | Assignee: | Konqueror Bugs <konqueror-bugs-null> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | normal | CC: | browserbugs2, maksim |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Key event testcase | ||
|
Description
Mohd Asif Ali Rizwaan
2006-10-11 09:28:41 UTC
You might need a Hindi Font. http://www.kde-look.org/content/show.php?content=16645 Created attachment 19144 [details]
Key event testcase
The reason this doesn't work seems to be that Konqueror sends event.which for
shift, etc. and Firefox doesn't. In the testcase, focus the first text box,
press some keys, the code appears in the second box.
The site, in kbd.js function dk, has filters for specific key events, e.g.
if (keycode ==13) return true;
However, it doesn't filter for 16, the key event for shift
Later on in the function, we have
code = eval (kbd + '[' + keycode + '-32]');
kbd is a variable containing the name of an array, so when this is eval()ed, it
will try to generate an array reference... Of course, with shift pressed, this
looks for index 16-32 , and as you can't have negative array indexes, it fails.
I think the site could easily fix its code, replacing the low keycode checks
with:
if(keycode<32) return true;
Moreover, "Alt" doesn't modify event.charcode which FF,IE and Opera do. When I press a,c,l with alt pressed, I get on this browsers keycodes for ą,ć,ł (Polish) on Konqueror (3.5.9) I get only zeros... For what it's worth, the observations in comments 2 and 3 appear to be still valid in trunk r796129 KeyEvent:Properties http://www.din.or.jp/~hagi3/JavaScript/JSTips/Mozilla/Samples/KeyEvent.htm JavaScript Madness: Keyboard Events http://unixpapa.com/js/key.html states { Shift, Control and Alt, that don't send characters, but modify the characters sent by other keys. For nearly all modern browsers, both keydown and keyup events are triggered by modifier keys, but keypress events are not. This is consistant with their being "key" events not "character" events. } And this is exactly one wrong thing that Konqueror 4.7.0 seems to be doing: it is setting the keypress event to true when a modifier (like shift key) is pressed. 2 interactive test pages on key events: Keyboard events and code: Key and Character Codes vs. Event Types http://www.w3.org/2002/09/tests/keys.html Keyboard events and code: Key and Character Codes vs. Event Types http://www.w3.org/2002/09/tests/keys-cancel2.html W3C DOM 3 events 5.2.6 Keyboard Event Types keydown event keypress event keyup event http://www.w3.org/TR/DOM-Level-3-Events/#events-keyboardevents W3C DOM 3 events 6.2.2 Modifier keys http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers also suggests that modifier keys (like Shift) should not fire a keypress event. By the way, according to W3C DOM 3 events, keyCode, charCode and which are obsolete and have been replaced with key and char event properties. regards, Gérard Dear Bug Submitter, This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond. Thank you for helping us make KDE software even better for everyone! Dear Bug Submitter, This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand. Thank you for helping us make KDE software even better for everyone! Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version? If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you! Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone! This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging Thank you for helping us make KDE software even better for everyone! |