Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX: fix for doubleclick and dragging #72

Merged
merged 4 commits into from
May 17, 2018
Merged

Conversation

HesselM
Copy link
Contributor

@HesselM HesselM commented Mar 10, 2016

These 4 commits solve the following issues:

General:
2dede35: enables calling multiple dragRel functions with small and large dx/dy in sequence. Previously, dragging lost track when using multiple calls as the OS could not follow the speed.

OSX
dce333d: added 0.01 delay for the OS to catch up in _dragTo. (similar to _moveTo)
a655757 and 14e2ad0 : fixed multi-click support by adding a new function. The calls to 'doubleClick' and 'tripleClick' now function as expected. 'click' with 'click=' just executes single clicks.

This PR fixes issue #71

Edit: As noted at several places, the window in which a double click should be performed has to be active/in-focus! So, in order to use a double click properly:

  1. Focus window
  2. Perform double/multi click in this window

@asweigart
Copy link
Owner

Sorry for the delays on this. I'll have access to a mac laptop to test these changes tonight. Thanks!

@HesselM
Copy link
Contributor Author

HesselM commented Mar 23, 2017

$ git clone https://github.com/asweigart/pyautogui.git
$ cd pyautogui
$ git config --local user.name "name"
$ git config --local user.email "email"
$ git remote add osxfix https://github.com/HesselM/pyautogui.git
$ git fetch osxfix 
$ git rebase master osxfix/master

(from http://stackoverflow.com/questions/6022302/how-to-apply-unmerged-upstream-pull-requests-from-other-forks-into-my-fork )

Edit> If you want to use the double click, make sure you first select the window in which the double click should be performed. If the window is not (yet) active, it will not function.

@ibrr1
Copy link

ibrr1 commented Sep 13, 2017

Still not working for me! Even though I am selecting the window where i want to double click!

@afs2015
Copy link

afs2015 commented May 17, 2018

Tested doubleClick() using http://unixpapa.com/js/testmouse.html on my Mac running Sierra 10.12.6 and it appeared to work fine.

@asweigart asweigart merged commit e9e8694 into asweigart:master May 17, 2018
@specialak
Copy link

pyautogui.moveTo(203,668) and pyautogui.click(x = 203,y = 668) are also not working on high Sierra but pyautogui.position() is working well. Is anyone here to help me??
thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants