[Lazarus] RE : read single char from STDIN

Ludo Brands ludo.brands at free.fr
Sat Nov 19 11:43:29 CET 2011

>      ke := GetKeyEvent;
>      kr := TKeyRecord(ke);

The cast to TKeyRecord is wrong. You should use GetKeyEventFlags,
GetKeyEventCode, GetKeyEventShiftState, etc to get the individual parts.
They do fe. a (KeyEvent and $00FF0000) shr 16;  which is endian safe.


More information about the Lazarus mailing list