Skip to content

Commit

Permalink
Inject small delay to improve drag+drop reliability.
Browse files Browse the repository at this point in the history
Add two small delays when initiating a hold on the left mouse button:
immediately after bringing Scoot to the background, and (later) immediately
before bringing Scoot back to the foreground.

References #28.
  • Loading branch information
mjrusso committed Dec 10, 2022
1 parent 1e1933f commit 8c82196
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Scoot/KeyboardInputWindow+Keyboard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,12 @@ extension KeyboardInputWindow {
return
case ("=", false, _):
appDelegate?.bringToBackground()
usleep(10000)
mouse.pressDown(.left)
isHoldingDownLeftMouseButton = true
// Automatically bring Scoot to the foreground, so the user can
// continue their drag operation.
usleep(10000)
appDelegate?.bringToForeground()
return
case ("\\", false, _):
Expand Down

0 comments on commit 8c82196

Please sign in to comment.