Ludo Brands wrote:
     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.

Thanks Ludo, I was anticipating that but this was the result of a quick-and-dirty late-night experiment which relied on http://lazarus-ccr.sourceforge.net/docs/rtl/keyboard/tkeyevent.html being correct: it explicitly says a typecast should work.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to