[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/khtml
From:       Harri Porten <porten () kde ! org>
Date:       2005-02-28 13:43:21
Message-ID: 20050228134321.56278148A2 () office ! kde ! org
[Download RAW message or body]

CVS commit by porten: 

always return a non-zero keyCode() value even if it is Qt::Key_unknown
as it is the case with the AltGr key for example.

BUGS:86639


  M +6 -0      ChangeLog   1.391
  M +12 -3     xml/dom2_eventsimpl.cpp   1.52


--- kdelibs/khtml/ChangeLog  #1.390:1.391
@@ -1,2 +1,8 @@
+2005-02-28  Harri Porten  <porten@kde.org>
+
+        * xml/dom2_eventsimpl.cpp: always return a non-zero keyCode()
+        value even if it is Qt::Key_unknown as it is the case with the
+        AltGr key for example.
+
 2005-02-28  David Faure  <faure@kde.org>
 

--- kdelibs/khtml/xml/dom2_eventsimpl.cpp  #1.51:1.52
@@ -731,8 +731,17 @@ int TextEventImpl::keyCode() const
         return 0;
 
-    if (m_virtKeyVal != DOM_VK_UNDEFINED)
+    if (m_virtKeyVal != DOM_VK_UNDEFINED) {
         return m_virtKeyVal;
-    else
-        return QChar( charCode() ).upper().unicode();
+    } else {
+        int c = charCode();
+        if (c != 0) {
+            return QChar(charCode()).upper().unicode();
+        } else {
+            c = m_keyEvent->key();
+            if (c == Qt::Key_unknown)
+                kdDebug( 6020 ) << "Unknown key" << endl;
+            return c;
+        }
+    }
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic