[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Locating Iup Key Codes in Lua: which Table's Fields Are They?
- From: "Antonio Scuri" <scuri@...>
- Date: Tue, 23 Sep 2008 18:54:18 -0300
Call "iup.key_open()" in Lua. It will initialize the key names.
This function is listed in the System/Reference tree of the manual, but it
is not linked to any article. Something is missing of course, it should be
linked in the Keyboard Codes page, sorry.
Best,
scuri
> -----Original Message-----
> From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-
> bounces@bazar2.conectiva.com.br] On Behalf Of Veli-Pekka Tätilä
> Sent: terça-feira, 23 de setembro de 2008 18:10
> To: Lua list
> Subject: Locating Iup Key Codes in Lua: which Table's Fields Are They?
>
> Hi, I can define a key handler for a tex tfield like this:
>
> local edit = iup.multiline{ expand = "YES" }
> <snip>
> edit.k_any = function(self, key) <snip> end
>
> However, how do I match key codes? As defined by:
>
> iup portable user interface/keyboard/codes
>
> I can see the table of names in the CHM file, like K_a and K_dollar,
> but
> these don't appear to be global names nor fields of the iup table, I've
> traversed both to check. The docs don't mention Lua at all in that
> particular chapter, and in C they are defs in some header. So how does
> one
> retreave one of these Iup keycode values in Lua then?
>
> I'm using Lua for Windows with the version of Iup coming with it, a
> very
> nice, ActivePerl-like distro whose only drawback to me is lack of a
> ppm-like
> binary package manager and a no-install option. At any rate, the answer
> is
> probably something very obvious I'm overlooking. Just recently I wrote:
>
> iup.MainLoop()
>
> And thought I'd define some event handlers below that wondering why
> they
> were not called. Forgetting for the moment that the message loop is
> blocking
> and so the handlers don't get defined before the GUI to begin with,
> <grin>.
> Goes to show you shouldn't code late at night I guess.
>
> --
> With kind regards Veli-Pekka Tätilä
> Accessibility, Apps and Coding plus Synths and Music:
> http://vtatila.kapsi.fi