Jump to content

UniEdit and android soft keyboard


emi.cavaleri

Recommended Posts

Hi, I need on an uniGUI form an UniEdit that doesn't fire Android Soft Keyboard cause this edit will contain barcode scanned from device beam and user, most of times, doesn't write directly the barcode in the edit. I tried using combination of ReadOnly, ReadOnlyMode property but no combination works, it seems work at first time but when the control losts and then regains focus, the soft keyboard appears (and it doesn't), hiding content of the screen.
Which properties and which values I have to set on TUniEdit to do this?

I've tried other solutions proposed on this forum and found on web but none of them works for me.

I'm using UniGUI_1.90.0.1539.

My wish is to replace existing apps written in Firemonkey with unigui applications to be more independent from hardware
In Firemonkey I simply realized this stuff with this instructions:
FMX.Types.VKAutoShowMode := TVKAutoShowMode.Never; //in the onenter event of edit to hide soft keyboard
FMX.Types.VKAutoShowMode := TVKAutoShowMode.DefinedBySystem; // in the onexit event to restore standard behaviour

If setting properties on TUniEdit doesn't work, it will be possible obtain the same result injecting some javascript from unigui code?

Thanks.
Emilio.

Link to comment
Share on other sites

I have a professional edition.

I have to write a unigui app to be installed on windows server and used via browser by android industrial devices.

In this app some edit has not to display soft-keyboard because are edit that receive barcode from laser, and I don't want that android shows the keyboard cause is unuseful and will hide other parts of the form.

Link to comment
Share on other sites

Hi,

35 minutes ago, emi.cavaleri said:

In this app some edit has not to display soft-keyboard because are edit that receive barcode from laser, and I don't want that android shows the keyboard cause is unuseful and will hide other parts of the form.

Are they not editable?

Link to comment
Share on other sites

14 hours ago, alfr said:

why must it be an editbox? Can't you instead just set the barcode text in a uniLabel.caption? (And use an inputbox if need to manually input the number/text.)

I use an edit because I have to receive barcode from scanner and store the string somewhere, so I need a component that have an event that allows me to read data and process it. Yes I can set the barcode text in a Caption but which component can receive the barcode from scanner?

Link to comment
Share on other sites

14 minutes ago, x11 said:

laser beam - it is a virtual keyboard?

There are events OnKeyDown, OnKeyPress, OnKeyUp in TUniForm , try getting symbols here.

Yes, the client is an android industrial device with barcode scanner, to be used to scan products barcodes, show information about product scanned and store the list of products in a database (such as shopping cart in a market).

I've alreadyt tried events you suggest, doesn't work, debugging I see that events only receive carriage return char and not the string scanned by barcode.

Link to comment
Share on other sites

The above sets the inputType, which is not the same attribute you need to set to control the virtual keyboard. That is controlled by the InputMode attribute. This is not published through uniGui. But what you can do is the following. 

1. In your uniedit control choose - ClientEvents - ExtEvents - afterrender

2. 

function afterrender(sender, eOpts)
{
    var me=sender.inputEl;      
    me.set({
        inputmode: "none"
    });
}

 

  • Like 1
Link to comment
Share on other sites

Hi, I use unigui for mobiles for a similar process.

On the screen there is a tunimedit component that has the on exit event (the reader reads the barcode and adds a tab to the end of the string).

in the exit I add the whole process, then and remember this, focus on the input field and then delete the content of the input field, if you do it the other way around, it doesn't work (I don't know why) to enter the next barcode (I use pda zebra with bar reader for this job)

  • Like 1
Link to comment
Share on other sites

On 11/6/2020 at 10:30 PM, alfr said:

The above sets the inputType, which is not the same attribute you need to set to control the virtual keyboard. That is controlled by the InputMode attribute. This is not published through uniGui. But what you can do is the following. 

1. In your uniedit control choose - ClientEvents - ExtEvents - afterrender

2. 


function afterrender(sender, eOpts)
{
    var me=sender.inputEl;      
    me.set({
        inputmode: "none"
    });
}

 

Thanks! This works for me! 

There's only an undesired behaviour: when I tap on the edit, the keyboard appears, but I resolved placing the TUniEdit into a TUniPanel with property enabled = false, so I cannot tap on the edit and the soft-keyboard it's never shown then I use a TUniButton that in the onclick event calls UniEdit1.SetFocus to re-set focus on the TUniEdit if needed.

 

Link to comment
Share on other sites

On 11/9/2020 at 3:47 AM, asapltda said:

Hi, I use unigui for mobiles for a similar process.

On the screen there is a tunimedit component that has the on exit event (the reader reads the barcode and adds a tab to the end of the string).

in the exit I add the whole process, then and remember this, focus on the input field and then delete the content of the input field, if you do it the other way around, it doesn't work (I don't know why) to enter the next barcode (I use pda zebra with bar reader for this job)

Unfortunately I don't have mobile components but if I'll buy them I'll try your solution. Thanks.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...