// // // Include System.Messaging in the uses clause type TForm1 = class(TForm) private procedure VirtualKeyboardRectChangeMessageHandler(const Sender: TObject; const M: TMessage); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; end; ... uses DW.Messaging, DW.VirtualKeyboard.Helpers; constructor TForm1.Create(AOwner: TComponent); begin inherited; TMessageManager.DefaultManager.SubscribeToMessage(TVirtualKeyboardRectChangeMessage, VirtualKeyboardRectChangeMessageHandler); end; destructor TForm1.Destroy; begin TMessageManager.DefaultManager.Unsubscribe(TVirtualKeyboardRectChangeMessage, VirtualKeyboardRectChangeMessageHandler); inherited; end; procedure TForm1.VirtualKeyboardRectChangeMessageHandler(const Sender: TObject; const M: TMessage); var LRect: TRect; begin LRect := TVirtualKeyboardRectChangeMessage(M).Value; // LRect now contains the actual rect of the VK end;
The full source code is available in a forum thread on the Embarcadero Forums site. You can head over there and see the full thread. The source code is mainly for Android but probably also works on IOS. I would assume it is not meant for Windows, OSX, or Linux. The Kastri Free library also has a lot of other functionality you can check out as well.