Done. The orders are obeyed smoother, but the mouse still jump
if action.x and action.y and (action_id == hash("wheelclick") or action_id == hash("e")) then
-- moving camera with the mouse
local pos = vmath.vector3(action.x, action.y, 10)
go.set_position(pos)
elseif action_id == hash("right") then
-- moving camera with the keyboard
position.x = position.x + (5 / zoom)
go.set_position(position)
elseif action_id == hash("left") then
position.x = position.x - (5 / zoom)
go.set_position(position)
elseif action_id == hash("up") then
position.y = position.y + (5 / zoom)
go.set_position(position)
elseif action_id == hash("down") then
position.y = position.y - (5 / zoom)
go.set_position(position)
elseif action_id == hash("wheelup") and self.wheel < 1 then
-- zooming
self.wheel = 1
msg.post("/curseur#curseur", "wheel", {wheel = 1})
zoom_state = zoom_state + 1
if zoom_state > zoom_max then
zoom_state = zoom_max
end
go.set("#camera", "orthographic_zoom", 1*(math.pow(zoom_gap, zoom_state)))
elseif action_id == hash("wheeldown") and self.wheel < 1 then
self.wheel = 1
msg.post("/curseur#curseur", "wheel", {wheel = 2})
zoom_state = zoom_state - 1
if zoom_state < zoom_min then
zoom_state = zoom_min
end
go.set("#camera", "orthographic_zoom", 1*(math.pow(zoom_gap, zoom_state)))
end