Skip to content

Commit

Permalink
Changed mouse input reading from dx/dy to screen_dx/dy to become more…
Browse files Browse the repository at this point in the history
… independent from window size.
  • Loading branch information
astrochili committed May 17, 2023
1 parent 06e045c commit 60a14f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions operator/operator/operator.script
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ go.property('inverted_vertical', false)
go.property('minimum', vmath.vector3(-89, -360, 0))
go.property('maximum', vmath.vector3(89, 360, 30))

go.property('sensitivity', 0.7)
go.property('smoothness', 0.1)
go.property('sensitivity', 0.1)
go.property('smoothness', 0.05)

go.property('zoom', 0)
go.property('zoom_step', 0.3)
Expand Down Expand Up @@ -796,13 +796,13 @@ function on_input(self, action_id, action)
input.zoom = 1
end

if action.dx and action.dy and not action_id then
if action.screen_dx and action.screen_dy and not action_id then
if self.is_pointer_locked ~= pointer.locked then
-- Skip the first mouse movement by cursor jumping because locking.
self.is_pointer_locked = pointer.locked
elseif pointer.locked then
input.horizontal = action.dx or 0
input.vertical = action.dy or 0
input.horizontal = action.screen_dx or 0
input.vertical = action.screen_dy or 0
end
end

Expand Down

0 comments on commit 60a14f8

Please sign in to comment.