Skip to content

Commit

Permalink
only listen to otherMouseDragged when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
caillou committed Aug 3, 2020
1 parent 6d74da9 commit 4d76f7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hammerspoon/scroll-with-trackpoint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ overrideOtherMouseDown = hs.eventtap.new({ hs.eventtap.event.types.otherMouseDow
if scrollMouseButton == pressedMouseButton
then
deferred = true
dragOtherToScroll:start()
return true
end
end)
Expand All @@ -21,6 +22,7 @@ overrideOtherMouseUp = hs.eventtap.new({ hs.eventtap.event.types.otherMouseUp },
local pressedMouseButton = e:getProperty(hs.eventtap.event.properties['mouseEventButtonNumber'])
if scrollMouseButton == pressedMouseButton
then
dragOtherToScroll:stop()
if (deferred) then
overrideOtherMouseDown:stop()
overrideOtherMouseUp:stop()
Expand Down Expand Up @@ -59,4 +61,3 @@ end)

overrideOtherMouseDown:start()
overrideOtherMouseUp:start()
dragOtherToScroll:start()

0 comments on commit 4d76f7b

Please sign in to comment.