> 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. Ludo