From 42bcd7288d915a81039d8da6e193f2bc31affcd9 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 26 Apr 2009 19:44:25 +0200 Subject: [PATCH] button: add support for modifiers in __index Signed-off-by: Julien Danjou --- button.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/button.c b/button.c index fc4cea86..805a51e9 100644 --- a/button.c +++ b/button.c @@ -164,6 +164,8 @@ luaA_button_array_get(lua_State *L, button_array_t *buttons) * \lfield press The function called when button press event is received. * \lfield release The function called when button release event is received. * \lfield button The mouse button number, or 0 for any button. + * \lfield modifiers The modifier key table that should be pressed while the + * button is pressed. */ static int luaA_button_index(lua_State *L) @@ -190,9 +192,11 @@ luaA_button_index(lua_State *L) lua_pushnil(L); break; case A_TK_BUTTON: - /* works fine, but not *really* neat */ lua_pushnumber(L, button->button); break; + case A_TK_MODIFIERS: + luaA_pushmodifiers(L, button->mod); + break; default: return 0; }