键盘事件捕获

function love.load()
text = ""
drawCircle = false
downFont = false
x = 400
y = 200


--world = love.physics.newWorld(0,200,true)




end








function love.update(dt)


if downFont ==true then
y = y-5
downFont = false
end


end






function love.draw()


love.graphics.print(text,x,y)
if drawCircle ==true then
--love.graphics.setColor(255,0,0)
love.graphics.circle("line",300,200,20)
end


end


function love.keypressed(key,unicode)


if key =="return" then
text = "key:return pressed"
drawCircle = true
elseif key =="down" then
text = "arrow down key is pressed"
downFont = true
end


end

你可能感兴趣的:(键盘事件捕获)