]> git.lyx.org Git - lyx.git/blobdiff - src/kbsequence.C
add bindings for latin charsets, use self-insert as intended from the beginning
[lyx.git] / src / kbsequence.C
index 9289bf60a208497db25abf468eafb1a3f509694b..459185aacc113812b5a5f10579802e92b80e320d 100644 (file)
@@ -260,11 +260,32 @@ unsigned int kb_sequence::getsym() const
 
 char kb_sequence::getiso() const
 {
-       int const c = getsym();
+       unsigned int const c = getsym();
+
+       lyxerr << "Raw keysym: " << hex << c << dec << endl;
+       lyxerr << "byte 3: " << hex << (c & 0x0000FF00) << dec << endl;
        
-       if (c > 0xff)
+       switch (c & 0x0000FF00) {
+               // latin 1 byte 3 = 0
+       case 0x00000000:
+               return c;
+               // latin 2 byte 3 = 1
+       case 0x00000100:
+               // latin 3 byte 3 = 2
+       case 0x00000200:
+               // latin 4 byte 3 = 3
+       case 0x00000300:
+               // latin 8 byte 3 = 18 (0x12)
+       case 0x00001200:
+               // latin 9 byte 3 = 19 (0x13)
+       case 0x00001300:
+               return c & 0x000000FF;
+       default:
                return '\0';
-       return c;
+       }
+
+       // not a latin char we know of
+       return '\0';
 }