Browse Source

+ overloaded the = operator for pairs of TEnhancedKeyEvent

git-svn-id: branches/unicodekvm@40265 -
nickysn 6 years ago
parent
commit
9a2e1b99cb

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

@@ -218,6 +218,16 @@ begin
     PollEnhancedKeyEvent:=DefaultPollEnhancedKeyEvent;
     PollEnhancedKeyEvent:=DefaultPollEnhancedKeyEvent;
 end;
 end;
 
 
+operator = (const a, b: TEnhancedKeyEvent) res: Boolean;
+begin
+  res:=(a.VirtualKeyCode = b.VirtualKeyCode) and
+       (a.VirtualScanCode = b.VirtualScanCode) and
+       (a.UnicodeChar = b.UnicodeChar) and
+       (a.AsciiChar = b.AsciiChar) and
+       (a.ShiftState = b.ShiftState) and
+       (a.Flags = b.Flags);
+end;
+
 type
 type
   TTranslationEntry = packed record
   TTranslationEntry = packed record
     Min, Max: Byte;
     Min, Max: Byte;

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

@@ -225,3 +225,5 @@ function GetEnhancedKeyEvent: TEnhancedKeyEvent;
 function PollEnhancedKeyEvent: TEnhancedKeyEvent;
 function PollEnhancedKeyEvent: TEnhancedKeyEvent;
 { Checks if a keyevent is available, and returns it if one is found. If no
 { Checks if a keyevent is available, and returns it if one is found. If no
   event is pending, it returns 0 }
   event is pending, it returns 0 }
+
+operator = (const a, b: TEnhancedKeyEvent) res: Boolean;