From ea3520be14b3b352d0c8e9e257fb54ccd419aa59 Mon Sep 17 00:00:00 2001 From: tmk Date: Tue, 1 Jun 2021 12:12:24 +0900 Subject: [PATCH] ibmpc_usb: Add support for 7F7F and unknown ID #687 --- converter/ibmpc_usb/ibmpc_usb.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/converter/ibmpc_usb/ibmpc_usb.c b/converter/ibmpc_usb/ibmpc_usb.c index 6a65169a..cfd94060 100644 --- a/converter/ibmpc_usb/ibmpc_usb.c +++ b/converter/ibmpc_usb/ibmpc_usb.c @@ -323,8 +323,21 @@ uint8_t matrix_scan(void) keyboard_kind = PC_AT; } else if (0xBF00 == (keyboard_id & 0xFF00)) { // CodeSet3 Terminal keyboard_kind = PC_TERMINAL; + } else if (0x7F00 == (keyboard_id & 0xFF00)) { // CodeSet3 Terminal 1394204 + keyboard_kind = PC_TERMINAL; } else { - keyboard_kind = PC_AT; + xprintf("\nUnknown ID: Report to TMK "); + if ((0xFA == ibmpc_host_send(0xF0)) && + (0xFA == ibmpc_host_send(0x02))) { + // switch to code set 2 + keyboard_kind = PC_AT; + } else if ((0xFA == ibmpc_host_send(0xF0)) && + (0xFA == ibmpc_host_send(0x03))) { + // switch to code set 3 + keyboard_kind = PC_TERMINAL; + } else { + keyboard_kind = PC_AT; + } } xprintf("\nID:%04X(%s) ", keyboard_id, KEYBOARD_KIND_STR(keyboard_kind));