Input Dialog as variable

Post your questions and help other users.

Moderator: Martin

Post Reply
rj45
Posts: 8
Joined: 03 Jan 2014 09:11

Input Dialog as variable

Post by rj45 » 03 Jan 2014 09:17

Hi,

Is it possible to make Input Dialog Text value as a variable ? I need to pass the value to other part of the script but I have no idea how to do this.

Martin!
Posts: 31
Joined: 26 Oct 2013 18:00

Re: Input Dialog as variable

Post by Martin! » 03 Jan 2014 13:12

According to the help documents, the value from the input dialog is saved to a variable named value, which you can then use elsewhere in your flow.

rj45
Posts: 8
Joined: 03 Jan 2014 09:11

Re: Input Dialog as variable

Post by rj45 » 07 Jan 2014 09:57

Thanks now my plugin works.

I've got another question about Input Dialog - is there any way to run the keyboard in numeric mode. I need to input digits in the text field?

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Input Dialog as variable

Post by MURTUMA » 07 Jan 2014 12:16

That is possible with "enter root command" action and "control ui" action. You'll find the keycodes in the pinned DIY-actions topic above.

rj45
Posts: 8
Joined: 03 Jan 2014 09:11

Re: Input Dialog as variable

Post by rj45 » 07 Jan 2014 14:02

Hi,

Thanks for info but I still cannot force Input Dialog to show numeric keyboard :(

My flow is very simple:

Shortcut
|
|
Input Dialog
|
|
Call Number: 123{value}


Where should I put the root command or control UI - I've tried to put the action execute root command and control UI before and after the Input dialog but nothing happens. The keyboard was selected Automagic Premium as a input method.

rj45
Posts: 8
Joined: 03 Jan 2014 09:11

Re: Input Dialog as variable

Post by rj45 » 07 Jan 2014 20:01

I finally managed to force Input Dialog to show numeric keyboard by adding another action to shortcut trigger - Execute root command: input tap (position x) (position y). I checked position by enabling in Developer Options Show Touches and Pointer Location. It is not elegant solution but working - is there any other way to simulate touch of the button "?123" to show numeric keyboard ??

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Input Dialog as variable

Post by MURTUMA » 07 Jan 2014 21:47

Execute root command
-> input keycode KEYCODE_X (X is directly the number you want to press)

Or if that doesn't work, try this:
Execute root command
-> input keyevent X (these goes from 7 to 16 representing numbers from 0 to 9)

It is device specific if the first method will work, but the second one ALWAYS will.

rj45
Posts: 8
Joined: 03 Jan 2014 09:11

Re: Input Dialog as variable

Post by rj45 » 08 Jan 2014 09:16

You misunderstood me - I don't want to enter digits via action - it has to be done manually. When Input Dialog appears it's opens keyboard with letters and I want keyboard with numbers (numpad)

So I was wondering is there any other solution to bring up the numeric keyboard or maybe the Input Dialog should have one more option - Numbers to bring up the numpad.

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Input Dialog as variable

Post by MURTUMA » 08 Jan 2014 10:39

Sorry, my mistake. I do not know any other way to bring numpad up than changing the text field type to numbers. Maybe you should make a feature request out of that.

I don't really know how this works so this is just a wild guess; if you observe your phone's logs what happens when you press a number field, maybe you can reproduce that event with execute root command or send general broadcast actions?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Input Dialog as variable

Post by Martin » 08 Jan 2014 19:13

Hi,

I will add Number and Phone number to the input types in the next update to show the number keyboards.

Regards,
Martin

Post Reply