]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - converter/xt_usb/matrix.c
xt_usb: Fix */PrtSc key issue #552
[max/tmk_keyboard.git] / converter / xt_usb / matrix.c
index 473151cb32248d21e74e338851ef00e123ee15e0..1123b11f24d9e4ff93d82bfabeae88e28afba33e 100644 (file)
@@ -48,15 +48,14 @@ void matrix_init(void)
 // convert E0-escaped codes into unused area
 static uint8_t move_e0code(uint8_t code) {
     switch(code) {
-        // Original IBM XT keyboard has these keys
+        // Original IBM XT keyboard doesn't use E0-codes probably
+        // Some XT compatilble keyobards need these keys?
+        // http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/translate.pdf
+        // https://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc
         case 0x37: return 0x54; // Print Screen
         case 0x46: return 0x55; // Ctrl + Pause
         case 0x1C: return 0x6F; // Keypad Enter
         case 0x35: return 0x7F; // Keypad /
-
-        // Any XT keyobard with these keys?
-        // http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/translate.pdf
-        // https://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc
         case 0x5B: return 0x5A; // Left  GUI
         case 0x5C: return 0x5B; // Right GUI
         case 0x5D: return 0x5C; // Application
@@ -76,7 +75,7 @@ static uint8_t move_e0code(uint8_t code) {
         case 0x1D: return 0x7A; // Right Ctrl
         case 0x38: return 0x7C; // Right Alt
     }
-    return code;
+    return 0x00;
 }
 
 uint8_t matrix_scan(void)
@@ -92,7 +91,7 @@ uint8_t matrix_scan(void)
 
     uint8_t code = xt_host_recv();
     if (!code) return 0;
-    xprintf("%02X ", code);
+    dprintf("%02X ", code);
     switch (state) {
         case INIT:
             switch (code) {
@@ -204,17 +203,18 @@ XT Scancodes
 54-7F: Not used in original XT keyboard
 
        0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
-    50  -   -   -   -   *   *   x   x   x   x   *   *   *   *   *   *
+    50  -   -   -   -   *   *   x   x   x   x   *   *   *   o   o   o
     60  *   *   *   *   x   x   x   x   x   x   x   x   x   x   x   *
     70  x   *   *   x   *   *   x   *   *   x   *   x   *   x   x   *
 
 -: codes existed in original XT keyboard
 *: E0-escaped codes converted into unused code area(internal use in TMK)
 x: Non-espcaped codes(not used in real keyboards probably, for CodeSet2-CodeSet1 translation purpose)
+o: reserved
 
 Usage in TMK:
 
-    00  reserved*
+    00  (reserved) DO NOT USE
     54  PrintScr*
     55  Pause*
     56  Euro2
@@ -224,9 +224,9 @@ Usage in TMK:
     5A  LGUI*
     5B  RGUI*
     5C  APP*
-    5D  reserved*
-    5E  reserved*
-    5F  reserved*
+    5D  (reserved)
+    5E  (reserved)
+    5F  (reserved)
     60  cursor*
     61  cursor*
     62  cursor*