snow Posted January 17 Share Posted January 17 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 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 17 Share Posted January 17 Hello, I will try to check. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 17 Share Posted January 17 1 hour ago, snow said: Attached is a simple project where it can be reproduced. How should we reproduce this? Quote Link to comment Share on other sites More sharing options...
snow Posted January 17 Author Share Posted January 17 Just set Breakpoints and touch the mentioned button when inside the edit... shouldn't stop there. Thx. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 17 Share Posted January 17 3 minutes ago, snow said: Just set Breakpoints and touch the mentioned button when inside the edit... shouldn't stop there. Have you tried setting a breakpoint other than "Exit"? Quote Link to comment Share on other sites More sharing options...
snow Posted January 17 Author Share Posted January 17 Yes... Exit is not the problem. Quote Link to comment Share on other sites More sharing options...
snow Posted January 17 Author Share Posted January 17 Could you already reproduce the problem? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 17 Share Posted January 17 30 minutes ago, snow said: Could you already reproduce the problem? Sorry, but how to activate the Enter key in gboard in android? 1 Quote Link to comment Share on other sites More sharing options...
snow Posted January 18 Author Share Posted January 18 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. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 18 Share Posted January 18 Well, I think this is not a uniGUI issue. Quote Link to comment Share on other sites More sharing options...
snow Posted January 18 Author Share Posted January 18 But why is it working in TUniComboBox and not in TUniEdit? This is a problem as we often catch KeyDown-Event for Return in our application... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 18 Share Posted January 18 35 minutes ago, snow said: But why is it working in TUniComboBox and not in TUniEdit? I will check. Quote Link to comment Share on other sites More sharing options...
snow Posted January 18 Author Share Posted January 18 Thanks. Quote Link to comment Share on other sites More sharing options...
snow Posted January 19 Author Share Posted January 19 Could you already find out anything? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 19 Share Posted January 19 Sorry, not yet. Quote Link to comment Share on other sites More sharing options...
snow Posted January 22 Author Share Posted January 22 Any news? Please... Quote Link to comment Share on other sites More sharing options...
irigsoft Posted January 22 Share Posted January 22 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. ! Quote Link to comment Share on other sites More sharing options...
snow Posted January 22 Author Share Posted January 22 Unfortunately, there's no key event fired whatsoever when pressing this button inside a TUniEdit. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted January 22 Share Posted January 22 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 Quote Link to comment Share on other sites More sharing options...
snow Posted January 22 Author Share Posted January 22 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... Quote Link to comment Share on other sites More sharing options...
irigsoft Posted January 22 Share Posted January 22 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. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 22 Share Posted January 22 39 minutes ago, snow said: Any news? Please... Try this approach for now: UniEdit1.TabStop = False Quote Link to comment Share on other sites More sharing options...
irigsoft Posted January 22 Share Posted January 22 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_"]);'); Quote Link to comment Share on other sites More sharing options...
snow Posted January 22 Author Share Posted January 22 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? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 22 Share Posted January 22 3 minutes ago, snow said: Unfortunately, this doesn't change the behaviour at all. Are you sure? This approach works for me. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.