* fixed bug, where left and right shift were swapped in the i8086-msdos

keyboard unit.
This commit is contained in:
Nikolay Nikolov 2022-03-12 18:53:43 +02:00
parent 398c6519a5
commit 55b8fd6e94

View File

@ -44,6 +44,14 @@ begin
end;
function SysGetShiftState: Byte;
begin
SysGetShiftState:=(mem[$40:$17] and %1100) or
((mem[$40:$17] and %0010) shr 1) or
((mem[$40:$17] and %0001) shl 1);
end;
function SysGetKeyEvent: TKeyEvent;
var
@ -53,7 +61,7 @@ begin
intr($16,regs);
if (regs.al=$e0) and (regs.ah<>0) then
regs.al:=0;
SysGetKeyEvent:=(kbPhys shl 24) or regs.ax or (longint(mem[$40:$17] and $f) shl 16);
SysGetKeyEvent:=(kbPhys shl 24) or regs.ax or (longint(SysGetShiftState) shl 16);
end;
@ -67,13 +75,7 @@ begin
exit(0);
if (regs.al=$e0) and (regs.ah<>0) then
regs.al:=0;
SysPollKeyEvent:=(kbPhys shl 24) or regs.ax or (longint(mem[$40:$17] and $f) shl 16);
end;
function SysGetShiftState: Byte;
begin
SysGetShiftState:=(mem[$40:$17] and $f);
SysPollKeyEvent:=(kbPhys shl 24) or regs.ax or (longint(SysGetShiftState) shl 16);
end;