* fixed for new input_record

This commit is contained in:
peter 2001-08-05 12:23:57 +00:00
parent f58a8fc277
commit b84c4f3e1d
3 changed files with 30 additions and 21 deletions

View File

@ -423,33 +423,33 @@ begin
begin
ReadConsoleInputA(TextRec(input).Handle,buf,1,nread);
if buf.EventType = KEY_EVENT then
if buf.KeyEvent.bKeyDown then
if buf.Event.KeyEvent.bKeyDown then
begin
{ Alt key is VK_MENU }
{ Capslock key is VK_CAPITAL }
AltKey := ((Buf.KeyEvent.dwControlKeyState AND
AltKey := ((Buf.Event.KeyEvent.dwControlKeyState AND
(RIGHT_ALT_PRESSED OR LEFT_ALT_PRESSED)) > 0);
if not(Buf.KeyEvent.wVirtualKeyCode in [VK_SHIFT, VK_MENU, VK_CONTROL,
if not(Buf.Event.KeyEvent.wVirtualKeyCode in [VK_SHIFT, VK_MENU, VK_CONTROL,
VK_CAPITAL, VK_NUMLOCK,
VK_SCROLL]) then
begin
keypressed:=true;
if (ord(buf.KeyEvent.AsciiChar) = 0) or
(buf.keyevent.dwControlKeyState=2) then
if (ord(buf.Event.KeyEvent.AsciiChar) = 0) or
(buf.Event.KeyEvent.dwControlKeyState=2) then
begin
SpecialKey := TRUE;
ScanCode := Chr(RemapScanCode(Buf.KeyEvent.wVirtualScanCode, Buf.KeyEvent.dwControlKeyState,
Buf.KeyEvent.wVirtualKeyCode));
ScanCode := Chr(RemapScanCode(Buf.Event.KeyEvent.wVirtualScanCode, Buf.Event.KeyEvent.dwControlKeyState,
Buf.Event.KeyEvent.wVirtualKeyCode));
end
else
begin
SpecialKey := FALSE;
ScanCode := Chr(Ord(buf.KeyEvent.AsciiChar));
ScanCode := Chr(Ord(buf.Event.KeyEvent.AsciiChar));
end;
if Buf.KeyEvent.wVirtualKeyCode in [VK_NUMPAD0..VK_NUMPAD9] then
if Buf.Event.KeyEvent.wVirtualKeyCode in [VK_NUMPAD0..VK_NUMPAD9] then
if AltKey then
begin
Keypressed := false;
@ -459,7 +459,7 @@ begin
else break;
end;
end
else if (Buf.KeyEvent.wVirtualKeyCode in [VK_MENU]) then
else if (Buf.Event.KeyEvent.wVirtualKeyCode in [VK_MENU]) then
if DoingNumChars then
if DoingNumCode > 0 then
begin
@ -851,7 +851,10 @@ end. { unit Crt }
{
$Log$
Revision 1.13 2001-08-01 18:01:20 peter
Revision 1.14 2001-08-05 12:23:57 peter
* fixed for new input_record
Revision 1.13 2001/08/01 18:01:20 peter
* WChar fix to compile also with 1.0.x
Revision 1.12 2001/07/30 15:00:54 marco

View File

@ -114,7 +114,7 @@ var
c : word;
addThis: boolean;
begin
with ir.KeyEvent do
with ir.Event.KeyEvent do
begin
{ key up events are ignored (except alt) }
if bKeyDown then
@ -140,7 +140,7 @@ begin
if addThis then
begin
keyboardeventqueue[nextfreekeyevent]:=
ir.KeyEvent;
ir.Event.KeyEvent;
incqueueindex(nextfreekeyevent);
end;
end;
@ -167,7 +167,7 @@ begin
AsciiChar := char (c);
{and add to queue}
EnterCriticalSection (lockVar);
keyboardeventqueue[nextfreekeyevent]:=ir.KeyEvent;
keyboardeventqueue[nextfreekeyevent]:=ir.Event.KeyEvent;
incqueueindex(nextfreekeyevent);
SetEvent (newKeyEvent); {event that a new key is available}
LeaveCriticalSection (lockVar);
@ -781,7 +781,10 @@ end;
end.
{
$Log$
Revision 1.3 2001-05-20 12:08:17 peter
Revision 1.4 2001-08-05 12:23:57 peter
* fixed for new input_record
Revision 1.3 2001/05/20 12:08:17 peter
* fixed to compile with debug
Revision 1.2 2001/01/14 22:20:00 peter

View File

@ -39,15 +39,15 @@ procedure MouseEventHandler(var ir:INPUT_RECORD);
begin
EnterCriticalSection(ChangeMouseEvents);
e.x:=ir.MouseEvent.dwMousePosition.x;
e.y:=ir.MouseEvent.dwMousePosition.y;
e.x:=ir.Event.MouseEvent.dwMousePosition.x;
e.y:=ir.Event.MouseEvent.dwMousePosition.y;
e.buttons:=0;
e.action:=0;
if (ir.MouseEvent.dwButtonState and FROM_LEFT_1ST_BUTTON_PRESSED<>0) then
if (ir.Event.MouseEvent.dwButtonState and FROM_LEFT_1ST_BUTTON_PRESSED<>0) then
e.buttons:=e.buttons or MouseLeftButton;
if (ir.MouseEvent.dwButtonState and FROM_LEFT_2ND_BUTTON_PRESSED<>0) then
if (ir.Event.MouseEvent.dwButtonState and FROM_LEFT_2ND_BUTTON_PRESSED<>0) then
e.buttons:=e.buttons or MouseMiddleButton;
if (ir.MouseEvent.dwButtonState and RIGHTMOST_BUTTON_PRESSED<>0) then
if (ir.Event.MouseEvent.dwButtonState and RIGHTMOST_BUTTON_PRESSED<>0) then
e.buttons:=e.buttons or MouseRightButton;
{ can we compress the events? }
@ -217,7 +217,10 @@ end;
end.
{
$Log$
Revision 1.3 2001-04-10 21:28:36 peter
Revision 1.4 2001-08-05 12:23:57 peter
* fixed for new input_record
Revision 1.3 2001/04/10 21:28:36 peter
* removed warnigns
Revision 1.2 2001/01/14 22:20:00 peter