Log In
New Account
  
Home My Page Project Cloud Code Snippets Project Openings

Browse | Submit A New Snippet | Create A Package

 

Showing the Virtual Keyboard in X11 programs

Type:
Sample Code (HOWTO)
Category:
Other
License:
BSD License
Language:
C
 
Description:
This snippet shows how you can manually show or hide the virtual keyboard (handwriting recognition) Input Method in a plain X11 program. First, you need to create a GDK wrapper around your window (see snippet 3), then you can use this snippet to show or hide the input method. I'll show how you can actually get keyboard input in a separate snippet.

Versions Of This Snippet::

Rene Hexel
Snippet ID Download Version Date Posted Author Delete
412006-11-13 22:19Rene Hexel

Download a raw-text version of this code by clicking on "Download Version"

 


Latest Snippet Version: :1

GdkWindow *gdkWindow;       /* the GDK window wrapped around your X window */
GtkIMContext *im_context;   /* the context for the keyboard input method */

/* create and map your X and GDK windows */
...
gdkWindow = ...;            /* see snippet 3 on how this is done */

/*
 * use this to show the keyboard
 */
im_context = gtk_im_multicontext_new();
gtk_im_context_set_client_window(im_context, gdkWindow);
hildon_gtk_im_context_show(im_context);

while (gtk_events_pending())
    gtk_main_iteration();

...

/*
 * use this to hide the keyboard
 */
hildon_gtk_im_context_hide(im_context);
gtk_im_context_reset(im_context);
g_object_unref(im_context);

while (gtk_events_pending())
    gtk_main_iteration();

...

		

Submit a new version

You can submit a new version of this snippet if you have modified it and you feel it is appropriate to share with others..


Terms of Use    Privacy Policy    Contribution Guidelines    Feedback

Powered By GForge Collaborative Development Environment