Bläddra i källkod

+ added essAltGr to TEnhancedShiftState and added proper AltGr handling for the Linux console

git-svn-id: branches/unicodekvm@41597 -
nickysn 6 år sedan
förälder
incheckning
bac79df17e

+ 3 - 0
packages/rtl-console/src/inc/keyboard.inc

@@ -127,6 +127,9 @@ begin
             ConvertEnhancedToLegacyShiftState:=ConvertEnhancedToLegacyShiftState or kbRightShift;
         end;
     end;
+  { AltGr triggers both kbAlt and kbCtrl in the legacy shift state }
+  if essAltGr in ShiftState then
+    ConvertEnhancedToLegacyShiftState:=ConvertEnhancedToLegacyShiftState or (kbAlt or kbCtrl);
 end;
 
 

+ 1 - 0
packages/rtl-console/src/inc/keybrdh.inc

@@ -64,6 +64,7 @@ type
     essAlt,
     essLeftAlt,
     essRightAlt,
+    essAltGr,
     essCapsLockPressed,
     essCapsLockOn,
     essNumLockPressed,

+ 1 - 3
packages/rtl-console/src/unix/keyboard.pp

@@ -1349,10 +1349,8 @@ begin
        Include(EnhShiftState,essLeftCtrl);
      if (arg and (1 shl KG_CTRLR))<>0 then
        Include(EnhShiftState,essRightCtrl);
-     { 2 corresponds to AltGr so set both kbAlt and kbCtrl PM }
      if (arg and (1 shl KG_ALTGR))<>0 then
-       {shiftstate:=shiftstate or (kbAlt or kbCtrl);}
-       Include(EnhShiftState,essRightAlt);
+       Include(EnhShiftState,essAltGr);
      if (arg and (1 shl KG_SHIFT))<>0 then
        Include(EnhShiftState,essShift);
      if (arg and (1 shl KG_SHIFTL))<>0 then