Home AMX User Forum AMX Design Tools

Edit text with virtualKeyboard

Hello,

i need to let the user edit a button text, so the idea is to open a virtual keyboard with the text of the button loaded at the "text area-single line" input field of the virtual keyboard, and then save the changes.

The problem is that the ^TXT command doesn?t work with the "text area-single line" input field (0:4 port:address). Do you know any way load a text to an input button like that?

Thanks for your help!

Salutes!!

Comments

  • JohnMichnrJohnMichnr Posts: 279
    If I am reading your questions correctly. You are looking to pop up a keyboard on the touchpanel, with a text string loaded into it that can be edited.

    There is an old command that still works with the G4 panels - @AKB

    (from the manual)
    "'@AKB-&lt;initial text>;<prompt text>'"

    Pop up the keyboard icon and initialize the text string to that

    specified. Keyboard string is set to null on power up and is stored

    until power is lost. The Prompt Text is optional.



    Syntax:

    SEND_COMMAND <DEV>,"'@AKB-&lt;initial text>;<prompt text>'"



    Variables:

    initial text = 1 - 50 ASCII characters.

    prompt text = 1 - 50 ASCII characters.



    Example:

    SEND_COMMAND Panel,"'@AKB-Texas;Enter State'"

    Pops up the Keyboard and initializes the text

    string 'Texas' with prompt text 'Enter State'.

    Sounds liek that is what you want to do
  • MorgoZMorgoZ Posts: 116
    Hello and thanks!!

    Yes, that is what i was looking for, but i?m using a personal keyboard, modified from the system keyboard, so what i exactly need is a command that changes the text, but without opening the system keyboard popup, because i will open mine (with the text changed).

    So, if you know any command to just change a keyboard text input without having to automatically open the system keyboard, i would appreciate it.

    Thanks!!
  • viningvining Posts: 4,368
    I don't believe there is such a code. Even the previous mentioned code doesn't change the text input area in the system keyboard, it changes the text in the text prompt area above the text input field.

    To do want you want you may have to really make your own and instead of using 0-setup port for buttons and the text input window assigned them the port and channel numbers in the range of the device. Then handle the button and variable text field in code. Now when you open the keyboard you can pass any stored variable into this variable text field, modify it in code and send VT back to the panel after every change.
  • a_riot42a_riot42 Posts: 1,624
    MorgoZ wrote: »
    So, if you know any command to just change a keyboard text input without having to automatically open the system keyboard, i would appreciate it.
    Thanks!!

    I am using a modified system keyboard and I am sending the button text to the text input field and using the standard ^TXT command and it works without issues. I send the @PPN command to popup the keyboard and then the ^TXT command right after. Perhaps you can post your code as there might be some other reason why it isn't working.

    EDIT: I am using an address code not a setup port for the input field.
    Paul
  • dchristodchristo Posts: 177
    Instead of using the "Text Input-Single Line" button, change it to another button with the button type of "Text Input". That way you can change the button address and send variable text to it, but it will still report it's contents when the keyboard "Exit" or "Done" is pushed.

    --D
  • MorgoZMorgoZ Posts: 116
    Ok,

    i?ll try with an input button.
    Trying to find a solution with the system default keyboard, i didn?t see the possibility of using my own input button, thanks for opening my eyes!! ;)

    Thanks and salutes!!!
  • if i popup the keypad using @AKP, how do i get the data entered by the user from the panel. Say once you hit the done button, i need those numbers that where entered from the panel. Where/How do you get that?

    thanks,
    Ian
  • DHawthorneDHawthorne Posts: 4,584
    ibryant wrote: »
    if i popup the keypad using @AKP, how do i get the data entered by the user from the panel. Say once you hit the done button, i need those numbers that where entered from the panel. Where/How do you get that?

    thanks,
    Ian

    They are sent as a string from the panel on port 1, so you need to create a DATA_EVENT with a STRING handler on that panel and port. The text is pre-pended with the label on the text field button.
Sign In or Register to comment.