in RAD Studio 11 Alexandria there this procedure for Android: -- unit FMX.VirtualKeyboard.Android; line 153
function TAndroidVirtualKeyboard.HideVirtualKeyboard: Boolean; begin Result := False; try if not FTransient then Result := MainActivity.getVirtualKeyboard.hide; except Application.HandleException(Screen.ActiveForm); end; end;
// for iOS on RAD 11 function TiOSVirtualKeyboardService.HideVirtualKeyboard: Boolean; begin if FTransient then Exit(False);
if SharedApplication.keyWindow = nil then Result := False else begin FKeyboardHandler.FKeepFocus := True; try Result := SharedApplication.keyWindow.endEditing(True); finally FKeyboardHandler.FKeepFocus := False; end; end; end;
********** see if this "workaround" to iOS and if help you in Android:
by Embarcadero JIRA: 27/Jul/2020 by Alex Gusman ---------- iOS: Virtual Keyboard not switching mode when changing focus between text input controls?
function TCocoaVirtualKeyboardService.HideVirtualKeyboard: Boolean; var Form: TCommonCustomForm; View: UIView; begin //if FTransient then // <- comment out this // Exit(False); // <- and this
Form := FStoredActiveForm.Form; if Form = nil then Exit(False);
if Form.Focused = nil then View := GetFormView(Form) else View := GetView(Form.Focused.GetObject);
if View = nil then Result := False else begin FKeyboardHandler.FKeepFocus := True; try Result := View.resignFirstResponder; finally FKeyboardHandler.FKeepFocus := False; end; end; end;
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
procedure TEdit.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin inherited MouseDown(Button, Shift, X, Y); // if you want use "ancestral MouseDown procedure"... here // Form1.Caption := Format('X: %f, Y:%f - %s', [X, Y, TimeToStr(Now)]); // // inherited MouseDown(Button, Shift, X, Y); // if you want use "ancestral MouseDown procedure"... or here end;
procedure TEdit.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin inherited MouseDown(Button, Shift, X, Y); // if you want use "ancestral MouseDown procedure"... here // Form1.Caption := Format('X: %f, Y:%f - %s', [X, Y, TimeToStr(Now)]); // // inherited MouseDown(Button, Shift, X, Y); // if you want use "ancestral MouseDown procedure"... or here end;
end.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
the same can be done for any other "class" like TFORM..., TMemo, TButton, etc...
for TMemo and TEDit you can use OnChange"D" event to verify if all is done and so... close keyboard for example.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3