From 2a98bf516a26c6446728f1f3d3bd5ebabf7d1e98 Mon Sep 17 00:00:00 2001 From: tmk Date: Sat, 2 May 2020 15:46:16 +0900 Subject: [PATCH] ibmpc_usb: Fix Code Set 2 for Z-150 SysRq 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 | 8 ++++---- converter/ibmpc_usb/unimap_trans.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/converter/ibmpc_usb/ibmpc_usb.c b/converter/ibmpc_usb/ibmpc_usb.c index c2b2d9ec..99e65a4a 100644 --- a/converter/ibmpc_usb/ibmpc_usb.c +++ b/converter/ibmpc_usb/ibmpc_usb.c @@ -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: diff --git a/converter/ibmpc_usb/unimap_trans.h b/converter/ibmpc_usb/unimap_trans.h index 471ce707..21819002 100644 --- a/converter/ibmpc_usb/unimap_trans.h +++ b/converter/ibmpc_usb/unimap_trans.h @@ -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 */ }; -- 2.46.2