diff --git a/spec/main_spec.lua b/spec/main_spec.lua index e8dd31c..52ccf6e 100644 --- a/spec/main_spec.lua +++ b/spec/main_spec.lua @@ -564,6 +564,7 @@ describe('fenster', function() local index = 0 while window.keys[index] ~= nil do assert.is_boolean(window.keys[index]) + assert.is_false(window.keys[index]) index = index + 1 end assert.is_equal(index, 256) diff --git a/src/main.c b/src/main.c index 5740954..aed8245 100644 --- a/src/main.c +++ b/src/main.c @@ -184,7 +184,7 @@ static int lfenster_open(lua_State *L) { // initialize the keys table and put it in the registry lua_createtable(L, KEYS_LENGTH, 0); for (int i = 0; i < KEYS_LENGTH; i++) { - lua_pushboolean(L, p_fenster->keys[i]); + lua_pushboolean(L, 0); lua_rawseti(L, -2, i); } lua_pushvalue(L, -1); // copy the keys table since luaL_ref pops it