button: add support for modifiers in __index
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
5476665ba2
commit
42bcd7288d
6
button.c
6
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 press The function called when button press event is received.
|
||||||
* \lfield release The function called when button release 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 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
|
static int
|
||||||
luaA_button_index(lua_State *L)
|
luaA_button_index(lua_State *L)
|
||||||
|
@ -190,9 +192,11 @@ luaA_button_index(lua_State *L)
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
break;
|
break;
|
||||||
case A_TK_BUTTON:
|
case A_TK_BUTTON:
|
||||||
/* works fine, but not *really* neat */
|
|
||||||
lua_pushnumber(L, button->button);
|
lua_pushnumber(L, button->button);
|
||||||
break;
|
break;
|
||||||
|
case A_TK_MODIFIERS:
|
||||||
|
luaA_pushmodifiers(L, button->mod);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue