From kde-commits Sun Aug 05 04:11:19 2007 From: Charles Samuels Date: Sun, 05 Aug 2007 04:11:19 +0000 To: kde-commits Subject: branches/KDE/3.5/kdelibs/khtml/dom Message-Id: <1186287079.735402.27027.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=118628708810201 SVN commit 696502 by charles: the js keyboard event (mozilla extension) property event returns 0 if the key pressed cannot be expressed as an ascii code (apparently). This behavior is the same as Firefox, /more/ similar to Opera (although opera appears to have an implementation of "event" more buggy than konqueror as a result of this patch). I figure firefox's implementation is canonical as it's a gecko extension. Still, there's a remaining bug in that you can't send "ctrl-something" because Konqueror filters it away from the Part. I'm not going to fix that. M +6 -2 dom2_events.cpp --- branches/KDE/3.5/kdelibs/khtml/dom/dom2_events.cpp #696501:696502 @@ -317,8 +317,12 @@ if( impl->isMouseEvent() ) return static_cast( impl )->button() + 1; else if( impl->isTextInputEvent() || impl->isKeyboardEvent() ) - return static_cast( impl )->keyCode(); - + { + // return 0 unless the key has an ascii value + if ( static_cast( impl )->keyVal() ) + return static_cast( impl )->keyCode(); + } + return 0; }