Re: handling key-press events

tantalum <[email protected]> Tue, 19 May 2009 17:20:55 +0200
Newsgroups gmane.lisp.guile.gtk
Message-ID <[email protected]>
now I got it.
the module gdk-event is necessary,
and the name of the procedure is "gdk-event-key:keyval".

Julian

----
Date: Tue, 19 May 2009 09:01:33 -0300
From: David Séverin <[email protected]>
Subject: Re: handling key-press events

Hi Julian,

missing this module

        :use-module (gnome gtk gdk-event)

David

;; --

Le Mon, 18 May 2009 21:19:22 +0200,
tantalum <[email protected]> a écrit :

 > I am sorry, I forgot to write that I am using guile-gnome-platform 
2.16.1.
 >
 > If it should also work with guile-gnome-platform,
 > I am missing something.
 >
 > there is no "gdk-event-keyval" procedure, having
 > modules
 >  (gnome-2)
 >  (oop goops)
 >  (gnome gobject)
 >  (gnome gtk)
 > loaded.
 >
 > exact error message:
 >  ERROR: Unbound variable: gdk-event-keyval
 >
 >
 > thanks for your help!
 >
 > Julian
 >
 > ----
 > tantalum wrote:
 >  > Hi,
 >  >
 >  > Can anyone show me with a little code snippet, how to
 >  > check for a specific key pressed with a key-press-event? I could not
 >  > find the answer myself.
 >  >
 >  >
 >
 >      (gtk-signal-connect entry "key-press-event"
 >              (lambda (event)
 >                (if (= 65293 (gdk-event-keyval event)) ; GDK_Return
 >                (begin
 >                  (handle-your-string entry)
 >                  (gtk-widget-destroy window)))
 >
 > I don't know that the keysyms are available at the guile level - I had to
 > translate from gdkkeysyms.h :)
 >
 > Paul.
 >
 >
 >