Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2001-08

Bug in structs.inc / TInputRecord

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Thomas Schatzl

Hello,

noticed a bug in the type definition of the InputRecord record used in Win32 keyboard handling causing problems with input in conjunction with W2k/NT + crt unit. Somehow with W9x this doesn't show up....

Here is the correct type definition:

type
  PInputRecord = ^TInputRecord;
  _INPUT_RECORD = record
    EventType: Word;
    Reserved: Word;   // this record member was missing
    case Integer of
      0: (KeyEvent: TKeyEventRecord);
      1: (MouseEvent: TMouseEventRecord);
      2: (WindowBufferSizeEvent: TWindowBufferSizeRecord);
      3: (MenuEvent: TMenuEventRecord);
      4: (FocusEvent: TFocusEventRecord);
  end;

Note that in Delphi this record is different, it rather looks like the following:

type
  PInputRecord = ^TInputRecord;
  _INPUT_RECORD = record
    EventType: Word;
    Reserved: Word;
    Event : record case Integer of
      0: (KeyEvent: TKeyEventRecord);
      1: (MouseEvent: TMouseEventRecord);
      2: (WindowBufferSizeEvent: TWindowBufferSizeRecord);
      3: (MenuEvent: TMenuEventRecord);
      4: (FocusEvent: TFocusEventRecord);
    end;
  end;

Checked with today's rtl source snapshot (1.1 version).

Regards,
Thomas

Reply by email