Browse Source

* fixed bug, where left and right shift were swapped in the i386-go32v2
keyboard unit as well.

Nikolay Nikolov 3 years ago
parent
commit
4ed7bd9f66
1 changed files with 10 additions and 8 deletions
  1. 10 8
      packages/rtl-console/src/go32v2/keyboard.pp

+ 10 - 8
packages/rtl-console/src/go32v2/keyboard.pp

@@ -26,6 +26,14 @@ uses
 {$i keyboard.inc}
 
 
+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
@@ -35,7 +43,7 @@ begin
   realintr($16,regs);
   if (regs.al=$e0) and (regs.ah<>0) then
    regs.al:=0;
-  SysGetKeyEvent:=(kbPhys shl 24) or regs.ax or ((mem[$40:$17] and $f) shl 16);
+  SysGetKeyEvent:=(kbPhys shl 24) or regs.ax or (SysGetShiftState shl 16);
 end;
 
 
@@ -49,13 +57,7 @@ begin
    exit(0);
   if (regs.al=$e0) and (regs.ah<>0) then
    regs.al:=0;
-  SysPollKeyEvent:=(kbPhys shl 24) or regs.ax or ((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 (SysGetShiftState shl 16);
 end;