Value $400 makes sense. And also this must be changed then: function KeysToShiftState(Keys: PtrUInt): TShiftState; it uses same constants. Alex