Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
tvanderh
Posts: 4
Registered: ‎01-20-2012
My Device: Playbook
My Carrier: n/a

Prompt dialog and virtualkeyboard

Is there any way to set the virtual keyboard options (eg: VIRTUALKEYBOARD_LAYOUT_NUM_PUNC) for a given prompt dialog?  It seems to always use the default keyboard.

Please use plain text.
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Prompt dialog and virtualkeyboard

Can you paste a snip from your code?

Please use plain text.
Regular Contributor
xsacha
Posts: 54
Registered: ‎10-30-2011
My Device: Blackberry Playbook
My Carrier: Telstra LTE

Re: Prompt dialog and virtualkeyboard

[ Edited ]

 

#include <stdbool.h>
#include <sys/platform.h>
#include <bps/virtualkeyboard.h>

int main() {
....
    virtualkeyboard_request_events(0);
....
}

void myfunc() {
....
    virtualkeyboard_show();
    virtualkeyboard_change_options(VIRTUALKEYBOARD_LAYOUT_PHONE, VIRTUALKEYBOARD_ENTER_SEND);
....
}

 

See: https://bdsc.webapps.blackberry.com/native/documentation/keyboard_using_1935244_11.html

 

Please use plain text.
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Prompt dialog and virtualkeyboard

Try calling virtualkeyboard_change_options() before virtualkeyboard_show()

Please use plain text.
New Contributor
tvanderh
Posts: 4
Registered: ‎01-20-2012
My Device: Playbook
My Carrier: n/a

Re: Prompt dialog and virtualkeyboard

Here's an example, from the dialog tutorial, except I've modified the show_alert() function as below:

static void
show_alert()
{
    if (dialog_create_prompt(&prompt_dialog) != BPS_SUCCESS) exit(1);

    if (dialog_set_prompt_message_text(prompt_dialog, "dialog 6 prompt?") != BPS_SUCCESS) exit(1);

   /* Tried this */
   /*virtualkeyboard_hide();*/
   /*
   virtualkeyboard_change_options(VIRTUALKEYBOARD_LAYOUT_PHONE, VIRTUALKEYBOARD_ENTER_CONNECT);
   virtualkeyboard_show();
   */

   if (dialog_show(prompt_dialog) != BPS_SUCCESS) exit(1);

   /*virtualkeyboard_hide();*/  /* And tried this, too */
   virtualkeyboard_change_options(VIRTUALKEYBOARD_LAYOUT_PHONE, VIRTUALKEYBOARD_ENTER_CONNECT);
   virtualkeyboard_show();

   return;
}

 Regardless of what combination I try, the dialog box always comes up with the default keyboard.

Please use plain text.
Regular Contributor
xsacha
Posts: 54
Registered: ‎10-30-2011
My Device: Blackberry Playbook
My Carrier: Telstra LTE

Re: Prompt dialog and virtualkeyboard

Maybe grasping at straws but why not set the keyboard options before creating the dialog.

Please use plain text.
Trusted Contributor
sucroid
Posts: 195
Registered: ‎03-12-2012
My Device: PlayBook
My Carrier: None

Re: Prompt dialog and virtualkeyboard

I am experiencing the same problem.  Even if I change the keyboard layout BEFORE creating the prompt dialog, the keyboard would go back to default type.

 

The strange thing is that the numeric keyboard would flash initially and then turn into the default keyboard.

 

The work around I had is to do the following:

dialog_show( dialog );
usleep(500000);
virtualkeyboard_change_options(VIRTUALKEYBOARD_LAYOUT_PHONE, VIRTUALKEYBOARD_ENTER_CONNECT);

 The sleep is to wait for the keyboard to show up.  Then issuing the keyboard change will change the keyboard type to phone layout.  This is not very elegant but at least it sort of works.

 

I think there is a bug here.  If OP hasn't already filed an issue, I'm going to.

Sucroid.com
Sweet Apps for the Fans
Please use plain text.
New Contributor
tvanderh
Posts: 4
Registered: ‎01-20-2012
My Device: Playbook
My Carrier: n/a

Re: Prompt dialog and virtualkeyboard

Go ahead and file an issue.  I have not filed one.

 

Nice workaround.

Please use plain text.
Trusted Contributor
sucroid
Posts: 195
Registered: ‎03-12-2012
My Device: PlayBook
My Carrier: None

Re: Prompt dialog and virtualkeyboard

I filed an issue.  Here is the link: Issue Tracker

Sucroid.com
Sweet Apps for the Fans
Please use plain text.