mirror of
https://github.com/love2d/love.git
synced 2026-08-13 17:10:54 +02:00
Added love.keyboard.setKeyRepeat and love.keyboard.hasKeyRepeat (resolves issue #717)
This commit is contained in:
@@ -29,7 +29,19 @@ namespace love
|
||||
namespace keyboard
|
||||
{
|
||||
|
||||
static Keyboard *instance;
|
||||
static Keyboard *instance = 0;
|
||||
|
||||
int w_setKeyRepeat(lua_State *L)
|
||||
{
|
||||
instance->setKeyRepeat(luax_toboolean(L, 1));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_hasKeyRepeat(lua_State *L)
|
||||
{
|
||||
luax_pushboolean(L, instance->hasKeyRepeat());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_isDown(lua_State *L)
|
||||
{
|
||||
@@ -53,6 +65,8 @@ int w_isDown(lua_State *L)
|
||||
// List of functions to wrap.
|
||||
static const luaL_Reg functions[] =
|
||||
{
|
||||
{ "setKeyRepeat", w_setKeyRepeat },
|
||||
{ "hasKeyRepeat", w_hasKeyRepeat },
|
||||
{ "isDown", w_isDown },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user