Kal
Posts: 0
Joined: Thu May 22, 2014 11:03 pm

Detect "Next" button press in a telephone keypad

Hi,

I am using the type "tel" for an input widget, which brings up a telephone keypad on the phone to input the number. When the user enters the number and clicks on the "Next" button at the bottom right, the keypad goes away. I would like to detect this button press and take an action based on this. However, "keydown", "keyup" and "keypress" events don't seem to be triggered by this button press. The only event I get is "Value Change", but that is not good enough, because the same event is also triggered if the user accidentally dismisses the keyboard by putting the finger anywhere else on the screen. I want to be able to detect affirmatively that the "Next" button has been pressed. Is there a way? Thanks!

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Detect "Next" button press in a telephone keypad

Hello,

We will test and let you know whether it's possible. It may take some time.

Kal
Posts: 0
Joined: Thu May 22, 2014 11:03 pm

Detect "Next" button press in a telephone keypad

Thanks, Alena.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Detect "Next" button press in a telephone keypad

You can detect events Keydown/Keypress/Keyup with code:
prearguments[0]["keyCode"];/pre

Kal
Posts: 0
Joined: Thu May 22, 2014 11:03 pm

Detect "Next" button press in a telephone keypad

Can you please elaborate? As I said, when I press the "Next" button, Keydown/Keypress/Keyup events do not get triggered. So, how do I use this?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Detect "Next" button press in a telephone keypad

Hello Kal,

It is very strange that they do not work. Could you please provide us with information on what device do you test with what version of the OS? Could you please give us public link to the application? http://docs.appery.io/documentation/s...

Kal
Posts: 0
Joined: Thu May 22, 2014 11:03 pm

Detect "Next" button press in a telephone keypad

The device I am testing with is a Motorola Moto-G Android 4.4.3. The application is rather large and would be confusing to try to debug. But the reproduction steps are very simple:

  1. Create a new page.

  2. Put an Input component on it. On the properties panel, set its "type" to "tel".

  3. Put events on the page to trap "Keyup" "Keydown" and "Keypress".

    That's it! Now, when you build and run the APK on the phone, and click on the Input field, a telephone number keypad will appear. When you press any key on the keypad (e.g., the number keys), you will get all 3 Key events as expected. However, when you press the button called "Next" (which dismisses the keypad), all you get is a ValueChange event on the Input field, no Key events. So, I am unable to determine if the user ever pressed the "Next" button.

    I am afraid this may be a basic limitation in Android that you can do nothing about, but thought I would ask just in case someone has some clever ideas on how to overcome. This is not a big deal for me, more like "nice to have", so if it can't be solved, we can just move on.

    -Kal.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Detect "Next" button press in a telephone keypad

Hello Kal,

I've just tested on Nexus5 Android 4.4.3, on Keydown event:
prearguments[0]["keyCode"]/pre
returns code 9

Kal
Posts: 0
Joined: Thu May 22, 2014 11:03 pm

Detect "Next" button press in a telephone keypad

Interesting! So, it is a Moto G implementation issue then?

I have seen some other "quirky" things on the Moto G as well with respect to keyboard as well - for example, if you put up a search bar input field, it brings up the standard keyboard with a "Go" button at the bottom right. However, when you push the "Go" button, the keyboard does not dismiss itself like you will expect to.

I have deadline pressure, and can't get to these little "quirky" things, so let's drop this here. Good to know that this is not a universal Android issue, just an issue with my device. Thanks for the persistence, Evgene!

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Detect "Next" button press in a telephone keypad

Hi Kal,

Yes, seems to be so.
Let us know if you have any further questions!

Return to “Issues”