This is a migrated thread and some comments may be shown as answers.

RadEntry - KeyPress / OnKeyPress

4 Answers 517 Views
Entry
This is a migrated thread and some comments may be shown as answers.
Headygains
Top achievements
Rank 1
Veteran
Headygains asked on 17 Jun 2020, 09:30 PM

I've been attempting to figure out if I can use a KeyPress event with the RadEntry on Xamarin.Forms.

I realize that a(n) KeyPress event is most likely platform specific. But I can't seem to determine if there is a way to detect "Tab" being sent (\t). I have a scan engine providing data the RadEntry and I would like to detect a scan being present utilizing that tab event.

I can do this in Xamarin.Android using keypress events on EditText views. However, OnTextChanged event doesn't seem to have the (\t) Tab input.

4 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 18 Jun 2020, 07:28 AM

Hello Dalton,

I would need more details on the scenario - since you mentioned tab key, what key on the Android keyboard do you mean? Could you send me some sample code showing the exact scenario?

In general, RadEntry provides TextChanged and Completed events - Completed is raised when entering text is finalized with the keyboard return key.

Since you mentioned Xamarin.Android - you can create a custom renderer for the Entry on Android and handle the keypress of the native EditText there. Would such an approach be acceptable?

I look forward to your reply.

Regards,
Yana
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Headygains
Top achievements
Rank 1
Veteran
answered on 18 Jun 2020, 04:57 PM

From your description I may actually be able to use either the completed Event or the custom render option. 

The exact scenario is this:

- User (using Zebra TC70x Barcode Scanner) scans a barcode

- I have programmed the barcode scanner settings to send the "TAB" or "\t" Postamble (at the end of the scan's content)

- I then want to move the user to the next field (EditText.RequestFocus() in native) or (Entry.Focus() in forms)

I may just end up changing the standard post-amble for devices and use the keyboard return somehow (but that may not even be possible, are the returns the same across all platforms. Is it as simple as an "Enter")

I'll update the post with my full solution when I've determined the best course of action, Thank you for your guidance Yana!

0
Headygains
Top achievements
Rank 1
Veteran
answered on 18 Jun 2020, 07:03 PM

In the end, due to time constraints and my requirement to only be functional on the Android platform I went with the OnCompleted Event.

 

I used datawedge on the Zebra TC70X device to send the Enter key after the data. Everything worked as expected.

0
Yana
Telerik team
answered on 19 Jun 2020, 05:14 AM

Hello Dalton,

I am glad to hear you've found a suitable approach to handle the scenario.

If you have any additional questions, let me know.

Regards,
Yana
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Entry
Asked by
Headygains
Top achievements
Rank 1
Veteran
Answers by
Yana
Telerik team
Headygains
Top achievements
Rank 1
Veteran
Share this question
or