[maemo-developers] selectively disabling virtual keyboard

From: Austin Che maemo at austinche.name
Date: Mon Nov 26 23:35:50 EET 2007
Julius Luukko <julle.luukko at quicknet.inet.fi> wrote wisely:

> Hello Austin and all,
> I don't think that synthetizing key presses is the way to go. You can
> get a similar effect as is in the device lock screen  by setting your
> GTK_ENTRY's editable property to FALSE:
>   myentry=gtk_entry_new();
>   gtk_editable_set_editable(GTK_EDITABLE(myentry), FALSE);
> Then use gtk_editable_set_text, gtk_editable_insert_text etc. to set
> to text in your text box according to your button presses.
    Thanks Julius. This does work almost similarly to the device lock
    screen. However, it is not identical in that if the GtkEntry has
    visibility=false (i.e. it's a password box like the device lock
    dialog), then when you use gtk_editable_set_text or
    gtk_editable_insert_text, asterisks are directly inserted. The
    device lock box shows the inserted text briefly before turning
    into an asterisk (which I find pretty helpful to know whether you
    actually hit the button you wanted to hit). That's why I asked
    about synthesizing key presses as that's what it looks like the
    device lock screen is doing. 
    In any case, this is a minor issue so I don't think I'll worry
    about it. I mainly didn't want the virtual keyboard coming up and
    squishing my window and that problem seems to be solved. Thanks.

More information about the maemo-developers mailing list