[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: how to map particular keys



manu aradhya wrote:

>thanx for your reply,here is one simple program, in
>the called fuction how can i print the  key which has
>pressed.how to make use of struct GdkEventKey. may be
>GdkEventKey.val is useful to me. how can i store the
>key pressed value in this element.
>  
>

======== Change this =============
gint call_appln (GtkWidget *window2, GdkEventKey *event, gpointer data1) {
     g_print (" ------- key pressed ---------\n");
}

============= to this ===========
gint 
call_appln (GtkWidget   *window2,
            GdkEventKey *event,
            gpointer    data1) 
{
    g_print (" ------- key pressed [\'%c\'] ---------\n",
             event->keyval);
}


Cheers,
			-Tristan






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]