1
votes

Currently, the Android TEdit when it brings up the Keyboard, will have the keyboard in Caps for first letter.

I would like to turn off Keyboard auto going into Caps for first letter. Note: I don't want to do this in Android - Settings -> which will apply to the whole app. I want to do it on a per TEdit basis.

Surprisingly, I couldn't find info on doing this in Delphi. The properties in TEdit also don't seem to have anything on Capitalization.

I can't use the TEdit.CharCase feature as it forces all input in TEdit to lowercase.

What I want is that user can Type in Mixed Case if they choose to but the Keyboard has to be in lowercase when TEdit first comes into focus.

Android virtual keyboard turn on caps lock

Looking at above link, it seems that it's possible to accomplish.

How do I do this in Delphi?

Delphi 10.2 (moving to 10.4.1 soon)

1

1 Answers

2
votes

When using Delphi 10.4.1, you could do it this way, for example:

uses
  Androidapi.JNI.GraphicsContentViewText,
  FMX.Platform.Android;

procedure TForm1.Edit2Enter(Sender: TObject);
begin
  PlatformAndroid.TextInputManager.GetEditText.setInputType(TJInputType.JavaClass.TYPE_CLASS_TEXT);
end;

I had 2 edit controls in my test app. The above code is the OnEnter event handler for the 2nd edit. It doesn't capitalize the first character

I expect you won't be able to use this with 10.2