Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Suppress soft keyboard on Android with input controls
Mon, Aug 21 2017 8:48 AMPermanent Link

Michael Dreher

We have input controls feed by a scanner device and not by manual keystrokes(eg serial numbers, barcodes). On Android the soft keyboard is displayed(I don't want it here) and covers 50% of the screen. Is it possible to suppress the soft keyboard?

Thanks,
Michael Dreher
Tue, Aug 22 2017 11:55 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

<< We have input controls feed by a scanner device and not by manual keystrokes(eg serial numbers, barcodes). On Android the soft keyboard is displayed(I don't want it here) and covers 50% of the screen. Is it possible to suppress the soft keyboard?  >>

I really wish that it were possible to turn it off, but the only way that I know of is to handle the OnEnter event and set the focus to some other control.  However, that *may* cause the soft keyboard to "flash" on the screen for a moment.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Aug 24 2017 9:04 PMPermanent Link

KimHJ

Comca Systems, Inc

Tim Young [Elevate Software] wrote:

<<I really wish that it were possible to turn it off, but the only way that I know of is to handle the OnEnter event and set the focus to some other control.  However, that *may* cause the soft keyboard to "flash" on the screen for a moment.>>

In a windows application we use the Forms Keydown event and just have a label on the screen. We capture the keydown events and add the number to the label and when it have the right length we search the database for the product. This is also to control if the user scans more barcodes, we can capture them all.

In EWB you have to have a input control on the form to be able to use the Keydown event. I don't know if it's possible in a future update to be able to capture Key events without a input control.

Kim
Thu, Aug 24 2017 9:19 PMPermanent Link

KimHJ

Comca Systems, Inc

I had to try if there was a way and I found you just need a button on the form, then the Form's Keyevent works.

function TForm1.Form1KeyDown(Sender: TObject; Key: Integer; ShiftKey, CtrlKey, AltKey: Boolean): Boolean;
var
LabelText: String;
begin
   
   LabelText := Label1.Caption;
   LabelText := LabelText + Chr(Key);
   Label1.Caption := LabelText;
   Result := False;

end;

Kim
Fri, Aug 25 2017 2:18 AMPermanent Link

Michael Dreher

KimHJ wrote:

Tim Young [Elevate Software] wrote:

// ...have a label on the screen. We capture the keydown events and add the number to the label...

What an interesting idea, thanks! Using something capable of receiving key events but does not map to the HTML INPUT tag(which triggers the soft keyboard I guess). Drawing a frame around a lable will make the impression of a native input control. I' ll test that.

I tried the focus setting approach and different JavaScript hacks found on the net with success depending on the browser version used.

Michael Dreher
Fri, Aug 25 2017 12:34 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Kim,

<< In EWB you have to have a input control on the form to be able to use the Keydown event. I don't know if it's possible in a future update to be able to capture Key events without a input control. >>

Yes, as you found out it's definitely possible, and that's a great idea.  An element simply needs to be focusable in order to receive key events in browsers.

Tim Young
Elevate Software
www.elevatesoft.com
Image