From 7ddbcf19dc18a99765552b5cad8dd1d198c1cc45 Mon Sep 17 00:00:00 2001 From: an_achronism <87213873+an-achronism@users.noreply.github.com> Date: Thu, 2 Mar 2023 05:54:34 +0000 Subject: [PATCH 1/3] BUGFIX: Updated E0 translation to latest TMK ver Some keys were mapping incorrectly (End <-> Apps, LGUI <-> RCtrl etc.) due to inconsistent cs2_e0code() compared to the rest of the files. Now corrected and tested on 2021 Unicomp New Model M and 1990 IBM p/n 1391406. --- keyboards/converter/ibmpc_usb/matrix.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/keyboards/converter/ibmpc_usb/matrix.c b/keyboards/converter/ibmpc_usb/matrix.c index 354e253558d..b059d418bcc 100644 --- a/keyboards/converter/ibmpc_usb/matrix.c +++ b/keyboards/converter/ibmpc_usb/matrix.c @@ -801,14 +801,23 @@ static int8_t process_cs1(uint8_t code) static uint8_t cs2_e0code(uint8_t code) { switch(code) { // E0 prefixed codes translation See [a]. - case 0x11: return 0x0F; // right alt - case 0x14: return 0x17; // right control - case 0x1F: return 0x19; // left GUI + case 0x11: if (0xAB90 == keyboard_id || 0xAB91 == keyboard_id) + return 0x13; // Hiragana(5576) -> KANA + else + return 0x0F; // right alt + + case 0x41: if (0xAB90 == keyboard_id || 0xAB91 == keyboard_id) + return 0x7C; // Keypad ,(5576) -> Keypad * + else + return (code & 0x7F); + + case 0x14: return 0x19; // right control + case 0x1F: return 0x17; // left GUI case 0x27: return 0x1F; // right GUI - case 0x2F: return 0x5C; // apps + case 0x2F: return 0x27; // apps case 0x4A: return 0x60; // keypad / case 0x5A: return 0x62; // keypad enter - case 0x69: return 0x27; // end + case 0x69: return 0x5C; // end case 0x6B: return 0x53; // cursor left case 0x6C: return 0x2F; // home case 0x70: return 0x39; // insert From b2c2d92d0d0af798535b48a1a93c088a16aa039c Mon Sep 17 00:00:00 2001 From: an_achronism <87213873+an-achronism@users.noreply.github.com> Date: Thu, 2 Mar 2023 06:11:17 +0000 Subject: [PATCH 2/3] Removing unsupported DESCRIPTION from config.h This was causing build warnings and wasn't really needed anyway. --- keyboards/converter/ibmpc_usb/config.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/keyboards/converter/ibmpc_usb/config.h b/keyboards/converter/ibmpc_usb/config.h index a783b190c95..d126a988c23 100644 --- a/keyboards/converter/ibmpc_usb/config.h +++ b/keyboards/converter/ibmpc_usb/config.h @@ -22,8 +22,7 @@ along with this program. If not, see . #define PRODUCT_ID 0x6536 #define DEVICE_VER 0x0101 #define MANUFACTURER QMK -#define PRODUCT Legacy Keyboard Convert -#define DESCRIPTION convert IBM PC keyboard to USB +#define PRODUCT IBM keyboard protocol converter /* matrix size */ #define MATRIX_ROWS 8 From 27e319e65b65b6b7f7675a34cb24fdffcc380a50 Mon Sep 17 00:00:00 2001 From: an_achronism <87213873+an-achronism@users.noreply.github.com> Date: Thu, 2 Mar 2023 06:13:55 +0000 Subject: [PATCH 3/3] Unicomp New Model M Pause/Break key fix The PS/2 controller code on Unicomp's New Model M has a logic design flaw whereby it outputs E0 77 (effectively substituting a press of Num Lock) instead of E0 7E E0 F0 7E (substituting a press and release of Scroll Lock, which is correct for Break, given its legacy from the IBM 5150). Added this into the function that maps E0 scancodes to correct for Unicomp's mistake. Tested, and does not interfere with actually pressing Ctrl + Num Lock, which executes a Pause, as it should. --- keyboards/converter/ibmpc_usb/matrix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/converter/ibmpc_usb/matrix.c b/keyboards/converter/ibmpc_usb/matrix.c index b059d418bcc..8eef286f783 100644 --- a/keyboards/converter/ibmpc_usb/matrix.c +++ b/keyboards/converter/ibmpc_usb/matrix.c @@ -825,6 +825,7 @@ static uint8_t cs2_e0code(uint8_t code) { case 0x72: return 0x3F; // cursor down case 0x74: return 0x47; // cursor right case 0x75: return 0x4F; // cursor up + case 0x77: return 0x00; // Unicomp New Model M Pause/Break key fix case 0x7A: return 0x56; // page down case 0x7D: return 0x5E; // page up case 0x7C: return 0x7F; // Print Screen