Classic VCL question... but how to do the same within FireMonkey?
I have several standard TControl
who can focus...
For instance, in some TEdit
, I want to move to the next focusable control if I press the return key
I have try different approach but without success (replacing the key, keychar with 9 when it's 13, ..., forwarding the key events to the form, ...)
Of course, as it is FMX, I'd like a solution which works on all platforms...
If it can avoid to:
You can place the following code into the OnKeyDown event of the form:
if Key = vkReturn then begin
Key := vkTab;
KeyDown(Key, KeyChar, Shift);
end;
If you want that behaviour only for some of the controls, you must call this code in the OnKeyDown events of those controls.
Be aware that the KeyDown must call the TForm.KeyDown to make it work.
(Tested with XE2)