Re: key values on key pressed



On 11/22/13 16:39, Sergei Kolomeeyets wrote:
Hi,
to write a trivial key-press handler like the following:

static gboolean key_pressed (GtkWidget *area, GdkEventKey *event, GPtrArray
*ptLinePoints)
{
  GError *error;
  guint tt;

 if (event->keyval == GDK_Delete) {
    ...
  }

 if (event->keyval == GDK_Return) {
...
   }

  return FALSE;
}

one can use predefined constants from gdk/gdkkeysyms.h. Is there anybody
who could tell me what all those constants written in the file mean (except
the most explicit ones like GDK_Delete or similar)?  The question about the
possible meaning of GDK_KP_Enter, for instance, drivers me up the wall
really. I'm actually able to guess the meaning of "Enter" and "GDK",,, But
what does that KP mean? Of course, the question is not about only one

I believe it stands for KeyPad, for the "other" Enter key by the, well,
keypad.

constant, but about the whole set of names which is in the file. Who knows
it or where can I get the description for them?

In particulary, I badly need to use Alt+<...> and Ctrl+<...> combinations.
It would be very appreciated if someone throw a hint to me at least
relating to hexes for such combinations.
Tricks like
tt = event->keyval;
g_print ("%h", tt);
give nothing.

Maybe try: g_print ("%s", gdk_keyval_name (event->keyval));
Also for Ctrl/Alt/etc those are modifiers, you should check event->state

-j


Thanks!
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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