Fixed Landscape input handling.

This commit is contained in:
Giorgio Micotti
2013-06-13 11:32:49 +02:00
parent 70178aaf57
commit fc2d607d78

View File

@@ -323,8 +323,14 @@ function Input:init()
if ev.code == ABS_X then
ev.code = ABS_Y
elseif ev.code == ABS_Y then
ev.code = ABS_X
ev.value = Screen.width - ev.value
ev.code = ABS_X
-- We always have to substract from the physical x,
-- regardless of the orientation
if (Screen.width<Screen.height) then
ev.value = Screen.width - ev.value
else
ev.value = Screen.height - ev.value
end
end
end
return ev