lua-users home
lua-l archive

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


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