In FireMonkey, I don't know how to capture mouse and keyboard events at the application level agnostically. I do not think that this has been implemented yet, as from Delphi XE 2 Update 2.
However, by default, FireMonkey forms receive all MouseDown and KeyDown events before the actions of the controls are executed.
If you just override the MouseDown and KeyDown events in your form, you will do the same.
type TForm1 = class(TForm) Button1: TButton; Edit1: TEdit; private { Private declarations } public { Public declarations } procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Single); override; procedure KeyDown(var Key: Word; var KeyChar: System.WideChar; Shift: TShiftState); override; end; { TForm1 } procedure TForm1.KeyDown(var Key: Word; var KeyChar: System.WideChar; Shift: TShiftState); begin
If you want, you can continue to work with MouseMove, MouseUp, MouseWheel, MouseLeave, KeyUp, DragEnter, DragOver, DragDrop and DragLeave.
source share