~ubuntu-branches/ubuntu/oneiric/kde4libs/oneiric-proposed

« back to all changes in this revision

Viewing changes to khtml/xml/dom2_eventsimpl.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-07-08 00:08:34 UTC
  • mto: This revision was merged to the branch mainline in revision 247.
  • Revision ID: package-import@ubuntu.com-20110708000834-dr9a8my4iml90qe5
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
899
899
{
900
900
    //Keycode on key events always identifies the -key- and not the input,
901
901
    //so e.g. 'a' will get 'A'
902
 
    if (m_virtKeyVal != DOM_VK_UNDEFINED)
 
902
    if (m_virtKeyVal != DOM_VK_UNDEFINED) {
903
903
        return m_virtKeyVal;
904
 
    else
905
 
        return QChar((unsigned short)m_keyVal).toUpper().unicode();
 
904
    } else {
 
905
        unsigned char code = QChar((unsigned short)m_keyVal).toUpper().unicode();
 
906
        // Some codes we get from Qt are things like ( which conflict with
 
907
        // browser scancodes. Remap them to what's on their keycaps in a US
 
908
        // layout.
 
909
        if (virtKeyToQtKey()->hasLeft(code)) {
 
910
            switch (code) {
 
911
                case '!': return '1';
 
912
                case '@': return '2';
 
913
                case '#': return '3';
 
914
                case '$': return '4';
 
915
                case '%': return '5';
 
916
                case '^': return '6';
 
917
                case '&': return '7';
 
918
                case '*': return '8';
 
919
                case '(': return '9';
 
920
                case ')': return '0';
 
921
                default:
 
922
                    kWarning(6000) << "Don't know how resolve conflict of code:" << code
 
923
                                   << " with a virtKey";
 
924
            }
 
925
        }
 
926
        return code;
 
927
    }
906
928
}
907
929
 
908
930
int KeyboardEventImpl::charCode() const