From fb8dcab3bd415886e56defe36d704249b23e2570 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 31 Oct 2022 04:04:47 +0100 Subject: [PATCH] Fixed the handling of the Toshiba Fn keys, fixes #2778. --- src/device/keyboard.c | 8 ++++---- src/device/keyboard_at.c | 2 +- src/device/keyboard_xt.c | 2 +- src/include/86box/keyboard.h | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/device/keyboard.c b/src/device/keyboard.c index ef3dafb11..7d35d41cb 100644 --- a/src/device/keyboard.c +++ b/src/device/keyboard.c @@ -140,10 +140,10 @@ keyboard_input(int down, uint16_t scan) if (recv_key[scan & 0x1ff] ^ down) { if (down) { switch (scan & 0x1ff) { - case 0x01c: /* Left Ctrl */ + case 0x01d: /* Left Ctrl */ shift |= 0x01; break; - case 0x11c: /* Right Ctrl */ + case 0x11d: /* Right Ctrl */ shift |= 0x10; break; case 0x02a: /* Left Shift */ @@ -161,10 +161,10 @@ keyboard_input(int down, uint16_t scan) } } else { switch (scan & 0x1ff) { - case 0x01c: /* Left Ctrl */ + case 0x01d: /* Left Ctrl */ shift &= ~0x01; break; - case 0x11c: /* Right Ctrl */ + case 0x11d: /* Right Ctrl */ shift &= ~0x10; break; case 0x02a: /* Left Shift */ diff --git a/src/device/keyboard_at.c b/src/device/keyboard_at.c index e808f9507..682d28e1c 100644 --- a/src/device/keyboard_at.c +++ b/src/device/keyboard_at.c @@ -866,7 +866,7 @@ add_data_kbd(uint16_t val) } /* Test for T3100E 'Fn' key (Right Alt / Right Ctrl) */ - if ((dev != NULL) && (kbc_ven == KBC_VEN_TOSHIBA) && (keyboard_recv(0xb8) || keyboard_recv(0x9d))) + if ((dev != NULL) && (kbc_ven == KBC_VEN_TOSHIBA) && (keyboard_recv(0x138) || keyboard_recv(0x11d))) switch (val) { case 0x4f: t3100e_notify_set(0x01); diff --git a/src/device/keyboard_xt.c b/src/device/keyboard_xt.c index bd9a9e1c7..dc282e8a6 100644 --- a/src/device/keyboard_xt.c +++ b/src/device/keyboard_xt.c @@ -429,7 +429,7 @@ kbd_adddata(uint16_t val) { /* Test for T1000 'Fn' key (Right Alt / Right Ctrl) */ if (is_t1x00) { - if (keyboard_recv(0xb8) || keyboard_recv(0x9d)) { /* 'Fn' pressed */ + if (keyboard_recv(0x138) || keyboard_recv(0x11d)) { /* 'Fn' pressed */ t1000_syskey(0x00, 0x04, 0x00); /* Set 'Fn' indicator */ switch (val) { case 0x45: /* Num Lock => toggle numpad */ diff --git a/src/include/86box/keyboard.h b/src/include/86box/keyboard.h index 008d5b95c..0e384b39b 100644 --- a/src/include/86box/keyboard.h +++ b/src/include/86box/keyboard.h @@ -150,6 +150,7 @@ extern const device_t keyboard_pravetz_device; extern const device_t keyboard_xt_device; extern const device_t keyboard_xt86_device; extern const device_t keyboard_xt_compaq_device; +extern const device_t keyboard_xt_t1x00_device; extern const device_t keyboard_tandy_device; # if defined(DEV_BRANCH) && defined(USE_LASERXT) extern const device_t keyboard_xt_lxt3_device;