ソースを参照

- removed the no-longer-used code for dealing with the legacy key events

git-svn-id: branches/unicodekvm@41602 -
nickysn 6 年 前
コミット
1c86c0de48
1 ファイル変更0 行追加169 行削除
  1. 0 169
      packages/rtl-console/src/win/keyboard.pp

+ 0 - 169
packages/rtl-console/src/win/keyboard.pp

@@ -709,175 +709,6 @@ begin
   WideCharToOemCpChar:=Res;
 end;
 
-function TranslateKey (t : TFPKeyEventRecord) : TKeyEvent;
-var key : TKeyEvent;
-    ss  : byte;
-{$ifdef  USEKEYCODES}
-    ScanCode  : byte;
-{$endif  USEKEYCODES}
-    b   : byte;
-begin
-  Key := 0;
-  if t.ev.bKeyDown then
-  begin
-    { unicode-char is <> 0 if not a specal key }
-    { we return it here otherwise we have to translate more later }
-    if t.ev.UnicodeChar <> WideChar(0) then
-    begin
-      if (t.ev.dwControlKeyState and ENHANCED_KEY <> 0) and
-         (t.ev.wVirtualKeyCode = $DF) then
-        begin
-          t.ev.dwControlKeyState:=t.ev.dwControlKeyState and not ENHANCED_KEY;
-          t.ev.wVirtualKeyCode:=VK_DIVIDE;
-          t.ev.UnicodeChar:='/';
-        end;
-      {drivers needs scancode, we return it here as under dos and linux
-       with $03000000 = the lowest two bytes is the physical representation}
-{$ifdef  USEKEYCODES}
-      Scancode:=KeyToQwertyScan[t.ev.wVirtualKeyCode AND $00FF];
-      If ScanCode>0 then
-        t.ev.wVirtualScanCode:=ScanCode;
-      Key := byte (WideCharToOemCpChar(t.ev.UnicodeChar)) + (t.ev.wVirtualScanCode shl 8) + $03000000;
-      ss := transShiftState (t.ev.dwControlKeyState);
-      key := key or (ss shl 16);
-      if (ss and kbAlt <> 0) and rightistruealt(t.ev.dwControlKeyState) then
-        key := key and $FFFFFF00;
-{$else not USEKEYCODES}
-      Key := byte (WideCharToOemCpChar(t.ev.UnicodeChar)) + ((t.ev.wVirtualScanCode AND $00FF) shl 8) + $03000000;
-{$endif not USEKEYCODES}
-    end else
-    begin
-{$ifdef  USEKEYCODES}
-      Scancode:=KeyToQwertyScan[t.ev.wVirtualKeyCode AND $00FF];
-      If ScanCode>0 then
-        t.ev.wVirtualScanCode:=ScanCode;
-{$endif not USEKEYCODES}
-      translateKey := 0;
-      { ignore shift,ctrl,alt,numlock,capslock alone }
-      case t.ev.wVirtualKeyCode of
-        $0010,         {shift}
-        $0011,         {ctrl}
-        $0012,         {alt}
-        $0014,         {capslock}
-        $0090,         {numlock}
-        $0091,         {scrollock}
-        { This should be handled !! }
-        { these last two are OEM specific
-          this is not good !!! }
-        $00DC,         {^ : next key i.e. a is modified }
-        { Strange on my keyboard this corresponds to double point over i or u PM }
-        $00DD: exit;   {´ and ` : next key i.e. e is modified }
-      end;
-
-      key := $03000000 + (t.ev.wVirtualScanCode shl 8);  { make lower 8 bit=0 like under dos }
-    end;
-    { Handling of ~ key as AltGr 2 }
-    { This is also French keyboard specific !! }
-    { but without this I can not get a ~ !! PM }
-    { MvdV: not rightruealtised, since it already has frenchkbd guard}
-    if (t.ev.wVirtualKeyCode=$32) and
-       (KeyBoardLayout = FrenchKeyboard) and
-       (t.ev.dwControlKeyState and RIGHT_ALT_PRESSED <> 0) then
-      key:=(key and $ffffff00) or ord('~');
-    { ok, now add Shift-State }
-    ss := transShiftState (t.ev.dwControlKeyState);
-    key := key or (ss shl 16);
-
-    { Reset Ascii-Char if Alt+Key, fv needs that, may be we
-      need it for other special keys too
-      18 Sept 1999 AD: not for right Alt i.e. for AltGr+ß = \ on german keyboard }
-    if ((ss and kbAlt <> 0) and rightistruealt(t.ev.dwControlKeyState)) or
-    (*
-      { yes, we need it for cursor keys, 25=left, 26=up, 27=right,28=down}
-      {aggg, this will not work because esc is also virtualKeyCode 27!!}
-      {if (t.ev.wVirtualKeyCode >= 25) and (t.ev.wVirtualKeyCode <= 28) then}
-        no VK_ESCAPE is $1B !!
-        there was a mistake :
-         VK_LEFT is $25 not 25 !! *)
-       { not $2E VK_DELETE because its only the Keypad point !! PM }
-      (t.ev.wVirtualKeyCode in [$21..$28,$2C,$2D,$2F]) then
-      { if t.ev.wVirtualScanCode in [$47..$49,$4b,$4d,$4f,$50..$53] then}
-        key := key and $FFFFFF00;
-
-    {and translate to dos-scancodes to make fv happy, we will convert this
-     back in translateKeyEvent}
-
-     if rightistruealt(t.ev.dwControlKeyState) then {not for alt-gr}
-     if (t.ev.wVirtualScanCode >= low (DosTT)) and
-        (t.ev.wVirtualScanCode <= high (dosTT)) then
-     begin
-       b := 0;
-       if (ss and kbAlt) <> 0 then
-         b := DosTT[t.ev.wVirtualScanCode].a
-       else
-       if (ss and kbCtrl) <> 0 then
-         b := DosTT[t.ev.wVirtualScanCode].c
-       else
-       if (ss and kbShift) <> 0 then
-         b := DosTT[t.ev.wVirtualScanCode].s
-       else
-         b := DosTT[t.ev.wVirtualScanCode].n;
-       if b <> 0 then
-         key := (key and $FFFF00FF) or (cardinal (b) shl 8);
-     end;
-
-     {Alt-0 to Alt-9}
-     if rightistruealt(t.ev.dwControlKeyState) then {not for alt-gr}
-       if (t.ev.wVirtualScanCode >= low (DosTT09)) and
-          (t.ev.wVirtualScanCode <= high (dosTT09)) then
-       begin
-         b := 0;
-         if (ss and kbAlt) <> 0 then
-           b := DosTT09[t.ev.wVirtualScanCode].a
-         else
-         if (ss and kbCtrl) <> 0 then
-           b := DosTT09[t.ev.wVirtualScanCode].c
-         else
-         if (ss and kbShift) <> 0 then
-           b := DosTT09[t.ev.wVirtualScanCode].s
-         else
-           b := DosTT09[t.ev.wVirtualScanCode].n;
-         if b <> 0 then
-           key := (key and $FFFF0000) or (cardinal (b) shl 8);
-       end;
-  end;
-  translateKey := Key;
-end;
-
-function SysGetKeyEvent: TKeyEvent;
-var t   : TFPKeyEventRecord;
-    key : TKeyEvent;
-begin
-  key := 0;
-  repeat
-     if getKeyEventFromQueueWait (t) then
-       key := translateKey (t);
-  until key <> 0;
-{$ifdef DEBUG}
-  last_ir.Event.KeyEvent:=t;
-{$endif DEBUG}
-  SysGetKeyEvent := key;
-end;
-
-function SysPollKeyEvent: TKeyEvent;
-var t   : TFPKeyEventRecord;
-    k   : TKeyEvent;
-begin
-  SysPollKeyEvent := 0;
-  if getKeyEventFromQueue (t, true) then
-  begin
-    { we get an enty for shift, ctrl, alt... }
-    k := translateKey (t);
-    while (k = 0) do
-    begin
-      getKeyEventFromQueue (t, false);  {remove it}
-      if not getKeyEventFromQueue (t, true) then exit;
-      k := translateKey (t)
-    end;
-    SysPollKeyEvent := k;
-  end;
-end;
-
 
 function SysTranslateKeyEvent(KeyEvent: TKeyEvent): TKeyEvent;
 begin