-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I'm using sdl2-ffi in my YEng project, and try to handle the escape keypress, which doesn't work as expected. my code:
if event.type == Y.sdl.KEYUP then
print(event.key.keysym.sym,Y.sdl.K.ESCAPE,type(event.key.keysym.sym),type(Y.sdl.K.ESCAPE))
end
output when pressing the escape key:
27 23 number number
Y.sdl defined as:
local core_sdl=require'sdl2'
local additional_sdl = {}
local meta_sdl = {
__index = function(self, key)
return additional_sdl[key]
end
}
local meta_K={
__index = function(self, key)
return tonumber(core_sdl.C['SDLK_'..key])
end
}
additional_sdl.K=setmetatable({},meta_K)
Y.sdl = setmetatable(core_sdl, meta_sdl)
Metadata
Metadata
Assignees
Labels
No labels