Jump to content

Key event not firing when pressing Enter on Android virtual keyboard


snow

Recommended Posts

Hi there,

my problem is that neither OnKeyDown nor OnKeyPress is firing when I press the Enter/Return key on the Android virtual keyboard (GBoard) inside a TUniEdit component.

Inside a TUniComboBox it's working though...

Any ideas how to catch the event?

Using Professional Edition v1.90.0.1563

Attached is a simple project where it can be reproduced.

Thanks in advance.

 

Project1.zip

Link to comment
Share on other sites

I mean the blue Open/Ok-Button (see attached screenshot).
When pressing this button inside a TUniEdit none of the above mentioned key events is fired. Instead focus changes to the next control.

pic.JPG

Link to comment
Share on other sites

9 minutes ago, snow said:

Any news? Please...

Hello, sorry, but this button has changed its meaning. They are now used as Tab, not Enter. So try to check if when you press the button Tab is activated.

This impressed me when I want to switch from Tuniedit to another component with onkeypress event handling. !

Link to comment
Share on other sites

4 minutes ago, snow said:

Unfortunately, there's no key event fired whatsoever when pressing this button inside a TUniEdit.

Real this key do: go to Next Control.

To  check if Enter Key is work, try to connect standard keyboard and get keypress event

Link to comment
Share on other sites

With a standard keyboard everything work's fine.

We are using our software on different scanner models. On models with hardware keyboard there's no problem.

The problem appears on models without hardware keyboard where the virtual keyboard has to be used.

Here no keyboard event is fired whatsoever... instead focus changes to the next control.

As this behaviour of TUniEdit is different from e.g. TUniComboBox your help on how to catch OnKeyDown in this case is greatly appreciated...

Link to comment
Share on other sites

Just now, snow said:

With a standard keyboard everything work's fine.

We are using our software on different scanner models. On models with hardware keyboard there's no problem.

The problem appears on models without hardware keyboard where the virtual keyboard has to be used.

Here no keyboard event is fired whatsoever... instead focus changes to the next control.

As this behaviour of TUniEdit is different from e.g. TUniComboBox your help on how to catch OnKeyDown in this case is greatly appreciated...

I am sorry but changing controls with Enter key from Android keyboard, maybe is made by javascript (onClient Side) and this is not fire onKeyEvent (is not going to) on server.

Here @Sherzod maybe will help.

Link to comment
Share on other sites

39 minutes ago, snow said:

Here no keyboard event is fired whatsoever... instead focus changes to the next control.

Did you know that barcode scanners can be programmed to use a different prefix or suffix character, and your software can handle that character (like STX, or #, or whatever) in text fields. Not a much better idea, but it might turn out to be a solution.

Another way is to change the default Android keyboard to another one.

Another way you can also use "blur" on the client side and send an ajax event with some commands.

1. YOUREdit.JSInterface.JSAddListener('blur',
                          'function(){this.setValue(YOURFUNCTION(this.getValue()))}'
                    );
or 2. ' ajaxRequest(this,''brender'',["_sKey_"]);'
or 3. uniSession.AddJS('ajaxRequest (' + YOURForm.JSName + ',''blur'',["this=" + ' + YOUREdit.JSName + ',"_sKey_"]);');

Link to comment
Share on other sites

2 hours ago, Sherzod said:

Try this approach for now:

UniEdit1.TabStop = False

 

Unfortunately, this doesn't change the behaviour at all.

 

2 hours ago, irigsoft said:

Did you know that barcode scanners can be programmed to use a different prefix or suffix character, and your software can handle that character (like STX, or #, or whatever) in text fields. Not a much better idea, but it might turn out to be a solution.

Another way is to change the default Android keyboard to another one.

Another way you can also use "blur" on the client side and send an ajax event with some commands.

1. YOUREdit.JSInterface.JSAddListener('blur',
                          'function(){this.setValue(YOURFUNCTION(this.getValue()))}'
                    );
or 2. ' ajaxRequest(this,''brender'',["_sKey_"]);'
or 3. uniSession.AddJS('ajaxRequest (' + YOURForm.JSName + ',''blur'',["this=" + ' + YOUREdit.JSName + ',"_sKey_"]);');

We're already using special prefixes/suffixes for the scanners to handle scans.

However, in this case nothing is scanned but the program shall handle input via the virtual keyboard.

Different virtual keyboards don't seem to help. With Samsung virtual keyboard (on mobile phone) it just behaves the same.

I don't see how "blur" event can help me in this case. It fires every time the control loses focus... is there any way to catch the pressed key with this event?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...