diff --git a/src/types.cc b/src/types.cc index 0f38eb4..5e591e6 100644 --- a/src/types.cc +++ b/src/types.cc @@ -508,12 +508,20 @@ namespace KeyEventReg { return t.modifier(); } - an make(const string &key) { - return New(key) ; + int raw_make(lua_State *L) { + an res; + int n = lua_gettop(L); + if (n == 1) + res = New( string(lua_tostring(L, 1)) ); + else if (n > 1) + res = New( lua_tointeger(L, 1), lua_tointeger(L, 2) ); + + LuaType>::pushdata(L, res); + return 1; } static const luaL_Reg funcs[] = { - { "KeyEvent", WRAP(make) }, + { "KeyEvent", raw_make }, { NULL, NULL }, };