]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
ibmpc_usb: Fix Code Set 2 for Z-150 SysRq
authortmk <hasu@tmk-kbd.com>
Sat, 2 May 2020 06:46:16 +0000 (15:46 +0900)
committertmk <hasu@tmk-kbd.com>
Fri, 8 May 2020 12:45:45 +0000 (21:45 +0900)
Zenith Z-150 AT sends scan code 0x7F for SysRq.
Accoding to i8042 translation table it maps both 0x7F and
0x84 into 0x54(Print Screen).
https://geekhack.org/index.php?topic=103648.msg2897404#msg2897404

Swap MUTE and PSCR in unimap_cs2.

converter/ibmpc_usb/ibmpc_usb.c
converter/ibmpc_usb/unimap_trans.h

index c2b2d9ec00ef971e563c645405b5a62aeb373717..99e65a4a3bfbb29654cae43572fe4ea1a604e3e5 100644 (file)
@@ -632,12 +632,12 @@ static uint8_t cs2_e0code(uint8_t code) {
         case 0x75: return 0x4F; // cursor up
         case 0x7A: return 0x56; // page down
         case 0x7D: return 0x5E; // page up
-        case 0x7C: return 0x6F; // Print Screen
+        case 0x7C: return 0x7F; // Print Screen
         case 0x7E: return 0x00; // Control'd Pause
 
         case 0x21: return 0x65; // volume down
         case 0x32: return 0x6E; // volume up
-        case 0x23: return 0x7F; // mute
+        case 0x23: return 0x6F; // mute
         case 0x10: return 0x08; // (WWW search)     -> F13
         case 0x18: return 0x10; // (WWW favourites) -> F14
         case 0x20: return 0x18; // (WWW refresh)    -> F15
@@ -718,7 +718,7 @@ static int8_t process_cs2(void)
                     state = INIT;
                     break;
                 case 0x84:  // Alt'd PrintScreen
-                    matrix_make(0x6F);
+                    matrix_make(0x7F);
                     state = INIT;
                     break;
                 case 0xAA:  // Self-test passed
@@ -765,7 +765,7 @@ static int8_t process_cs2(void)
                     state = INIT;
                     break;
                 case 0x84:  // Alt'd PrintScreen
-                    matrix_break(0x6F);
+                    matrix_break(0x7F);
                     state = INIT;
                     break;
                 default:
index 471ce707c8bfdddc2447cd261b4413fbb3085e82..218190026513bb32f11237d1c78d7eaa083c069f 100644 (file)
@@ -149,9 +149,9 @@ const uint8_t PROGMEM unimap_cs2[MATRIX_ROWS][MATRIX_COLS] = {
     { UNIMAP_F22,   UNIMAP_RO,    UNIMAP_QUOTE, UNIMAP_LEFT,  UNIMAP_LBRC,  UNIMAP_EQUAL, UNIMAP_PGDN,  UNIMAP_F23   }, /* 50-57 */
     { UNIMAP_CAPS,  UNIMAP_RSHIFT,UNIMAP_ENTER, UNIMAP_RBRC,  UNIMAP_APP,   UNIMAP_BSLASH,UNIMAP_PGUP,  UNIMAP_F24   }, /* 58-5F */
     { UNIMAP_PSLS,  UNIMAP_NUBS,  UNIMAP_PENT,  UNIMAP_PEQL,  UNIMAP_HENK,  UNIMAP_VOLD,  UNIMAP_BSPACE,UNIMAP_MHEN  }, /* 60-67 */
-    { UNIMAP_NUHS,  UNIMAP_P1,    UNIMAP_JYEN,  UNIMAP_P4,    UNIMAP_P7,    UNIMAP_PCMM,  UNIMAP_VOLU,  UNIMAP_PSCR  }, /* 68-6F */
+    { UNIMAP_NUHS,  UNIMAP_P1,    UNIMAP_JYEN,  UNIMAP_P4,    UNIMAP_P7,    UNIMAP_PCMM,  UNIMAP_VOLU,  UNIMAP_MUTE  }, /* 68-6F */
     { UNIMAP_P0,    UNIMAP_PDOT,  UNIMAP_P2,    UNIMAP_P5,    UNIMAP_P6,    UNIMAP_P8,    UNIMAP_ESC,   UNIMAP_NLCK  }, /* 70-77 */
-    { UNIMAP_F11,   UNIMAP_PPLS,  UNIMAP_P3,    UNIMAP_PMNS,  UNIMAP_PAST,  UNIMAP_P9,    UNIMAP_SLCK,  UNIMAP_MUTE  }, /* 78-7F */
+    { UNIMAP_F11,   UNIMAP_PPLS,  UNIMAP_P3,    UNIMAP_PMNS,  UNIMAP_PAST,  UNIMAP_P9,    UNIMAP_SLCK,  UNIMAP_PSCR  }, /* 78-7F */
 };