Android Question [Solved] Gboard Enterpressed

Roger Daley

Well-Known Member
Licensed User
Hi All,
I have found a problem with SetCustomFilter when used with Gboard keyboard [ and probably others]. When I attempt to use the following with the soft keyboard Gboard hitting the return key does not take me to the Sub DispInput_EnterPressed. With the Samsung keyboard and Swiftkey all works.

B4X:
Private DispInput  As EditText
Private kb As IME

    DispInput.BringToFront
    DispInput.RequestFocus
    DispInput.SelectionStart = 0
    DispInput.ForceDoneButton = True
    Sleep(10)                 
    kb.ShowKeyboard(DispInput)
    kb.SetCustomFilter(DispInput, DispInput.INPUT_TYPE_TEXT, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz _-")

The Single Line function is unchecked in the designer.

If I remove the filter, all works correctly.
If I add CRLF to the filter it does a CRLF.

Any Ideas?

Regards Roger
 
Last edited:

JohnC

Expert
Licensed User
Last edited:
Upvote 0

Roger Daley

Well-Known Member
Licensed User
Hi All.

UPDATE: I have a second App with almost identical SetCustomFilter set up but works with GBoard.

I have searched for anything that is different between the two Apps without success. [Designer tick boxes, code, the order of specifying parameters etc.] Obviously it is something in my code I will keep searching but close this question.


Regards Roger

FURTHER UPDATE:
In Activity Create:
B4X:
    DispInput.InputType = DispInput.INPUT_TYPE_NONE                    'Prevents pop up keyboard
    DispInput.InputType = Bit.Or(0x00080000, 0x00000090)            'NO IDEA WHAT THIS DOES
    'DispInput.SingleLine = False
    DispInput.Enabled = False

Commenting out the above line solves the GBoard problem.

As an aside, what does the line above do? It sets DispInput.InputType = 524432, but to what effect?

Roger
 
Last edited:
Upvote 0
Top