-- Turns around 180 degree if pressing A key
if (key.isPressed(0x41)) then
local view = player.getView()
view.y = view.y + 180
player.setView(view)
end
key.isDown(keyCode)
keyCode - The code of the key
Returns true if given key is down right now.
Example:
-- Prints while you hold down D key
while (key.isDown(0x44)) do
print("D key is being held")
end