瀏覽代碼

+ get the current DOS code page in the go32v2 keyboard unit, so enhanced key
events Unicode characters are returned correctly (provided that the cpall and
fpwidestring unit are included as well)

Nikolay Nikolov 3 年之前
父節點
當前提交
c881067b23
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      packages/rtl-console/src/go32v2/keyboard.pp

+ 6 - 0
packages/rtl-console/src/go32v2/keyboard.pp

@@ -30,6 +30,8 @@ var
 
 
 procedure SysInitKeyboard;
+const
+  fCarry=1;
 var
   regs: trealregs;
 begin
@@ -41,6 +43,10 @@ begin
       if regs.ax<>$1200 then
         keyboard_type:=$10;
     end;
+  regs.ax:=$6601;
+  realintr($21,regs);
+  if (regs.flags and fCarry) = 0 then
+     CurrentLegacy2EnhancedKeyEventTranslationCodePage:=regs.bx;
 end;