All windows should have a 'SEL_KEYPRESS' event that you could connect to.

As for the names of the constants... dunno. I always only need a few
keys (like the arrow keys), so while I'm writing it I output the
number returned from the FXEvent.code attribute, and use that
number...

-Rich



On Thu, 26 Aug 2004 03:30:41 +0900, Martin Ankerl
<martin.ankerl / gmail.com> wrote:
> I would like to grab all keyboard events, I especially need the left,
> right, up, down keys. At the moment I have this code:
> 
> @input = FXText.new(@parent)
> @input.connect(SEL_KEYPRESS) do |sender, sel, data|
>     # now what? data.code seems to contain a keycode
>     p data.code
> end
> 
> There the focus has to be on the textbox, which records each keypress.
> data.code seems to contain some kind of keycode, but I could not
> figure out if somewhere constants are defined for the keys (like,
> FX_KEY_DOWN or something like this). Any ideas how to use this
> properly?
> 
> Martin
> 
>