Page 1 of 1

Detect "Next" button press in a telephone keypad

Posted: Fri Jul 11, 2014 7:56 pm
by Kal

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!


Detect "Next" button press in a telephone keypad

Posted: Fri Jul 11, 2014 9:38 pm
by Alena Prykhodko

Hello,

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


Detect "Next" button press in a telephone keypad

Posted: Fri Jul 11, 2014 10:33 pm
by Kal

Thanks, Alena.


Detect "Next" button press in a telephone keypad

Posted: Sat Jul 12, 2014 5:37 am
by Alena Prykhodko

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


Detect "Next" button press in a telephone keypad

Posted: Sat Jul 12, 2014 5:26 pm
by Kal

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?


Detect "Next" button press in a telephone keypad

Posted: Mon Jul 14, 2014 10:19 am
by Evgene Karachevtsev

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...


Detect "Next" button press in a telephone keypad

Posted: Wed Jul 16, 2014 3:27 pm
by Kal

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.


Detect "Next" button press in a telephone keypad

Posted: Fri Jul 18, 2014 10:16 am
by Evgene Karachevtsev

Hello Kal,

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


Detect "Next" button press in a telephone keypad

Posted: Fri Jul 18, 2014 2:35 pm
by Kal

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!


Detect "Next" button press in a telephone keypad

Posted: Fri Jul 18, 2014 4:47 pm
by Kateryna Grynko

Hi Kal,

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