{"action":"created","issue":{"url":"https://api.github.com/repos/msanders/autopy/issues/66","labels_url":"https://api.github.com/repos/msanders/autopy/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/msanders/autopy/issues/66/comments","events_url":"https://api.github.com/repos/msanders/autopy/issues/66/events","html_url":"https://github.com/msanders/autopy/issues/66","id":63337529,"number":66,"title":"How to do a double-click?","user":{"login":"gitfoxi","id":584005,"avatar_url":"https://avatars.githubusercontent.com/u/584005?v=3","gravatar_id":"","url":"https://api.github.com/users/gitfoxi","html_url":"https://github.com/gitfoxi","followers_url":"https://api.github.com/users/gitfoxi/followers","following_url":"https://api.github.com/users/gitfoxi/following{/other_user}","gists_url":"https://api.github.com/users/gitfoxi/gists{/gist_id}","starred_url":"https://api.github.com/users/gitfoxi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitfoxi/subscriptions","organizations_url":"https://api.github.com/users/gitfoxi/orgs","repos_url":"https://api.github.com/users/gitfoxi/repos","events_url":"https://api.github.com/users/gitfoxi/events{/privacy}","received_events_url":"https://api.github.com/users/gitfoxi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-21T00:27:36Z","updated_at":"2015-03-22T00:57:29Z","closed_at":null,"body":"mouse.click works great. But i can't figure out how to do a double-click. I've tried various ways. I'm on the mac platform.\r\n\r\n```\r\n            for _ in range(times):\r\n                print \"calling mouseclick\"\r\n                mouse.toggle(True, button)\r\n                # sleep(0.1)\r\n                mouse.toggle(False, button)\r\n                # sleep(0.1)\r\n```\r\n\r\nFor example, this doesn't work with or without the sleep calls.\r\n\r\nI'd also be interested in being able to click and hold to drag a window for example.\r\n\r\nIf you want to try dragging then you might try something like `mouse.toggle(True)` and then later `mouse.toggle(False)`. This does not have the effect of dragging the window smoothly. The window does jump from where it was to Where the mouse is when you you called the second toggle."},"comment":{"url":"https://api.github.com/repos/msanders/autopy/issues/comments/84483801","html_url":"https://github.com/msanders/autopy/issues/66#issuecomment-84483801","issue_url":"https://api.github.com/repos/msanders/autopy/issues/66","id":84483801,"user":{"login":"gitfoxi","id":584005,"avatar_url":"https://avatars.githubusercontent.com/u/584005?v=3","gravatar_id":"","url":"https://api.github.com/users/gitfoxi","html_url":"https://github.com/gitfoxi","followers_url":"https://api.github.com/users/gitfoxi/followers","following_url":"https://api.github.com/users/gitfoxi/following{/other_user}","gists_url":"https://api.github.com/users/gitfoxi/gists{/gist_id}","starred_url":"https://api.github.com/users/gitfoxi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitfoxi/subscriptions","organizations_url":"https://api.github.com/users/gitfoxi/orgs","repos_url":"https://api.github.com/users/gitfoxi/repos","events_url":"https://api.github.com/users/gitfoxi/events{/privacy}","received_events_url":"https://api.github.com/users/gitfoxi/received_events","type":"User","site_admin":false},"created_at":"2015-03-22T00:57:29Z","updated_at":"2015-03-22T00:57:29Z","body":"Your patch works for me. There were a couple lines you had to change to keep  clang happy. I had to switch them back for the same reason. We're probably using different versions of some library.\r\n\r\n```\r\ndiff --git a/src/autopy-key-module.c b/src/autopy-key-module.c\r\nindex b115321..99ec938 100644\r\n--- a/src/autopy-key-module.c\r\n+++ b/src/autopy-key-module.c\r\n@@ -76,7 +76,7 @@ PyMODINIT_FUNC initkey(void)\r\n                                       \"autopy module for working with the \"\r\n                                       \"keyboard\");\r\n #endif\r\n-       if (mod == NULL) return NULL; /* Error */\r\n+       if (mod == NULL) return ; /* Error */\r\n\r\n        /* Needed for type_string(). */\r\n        deadbeef_srand_time();\r\n@@ -117,7 +117,7 @@ PyMODINIT_FUNC initkey(void)\r\n                PyModule_AddIntMacro(mod, K_SHIFT) < 0 ||\r\n                PyModule_AddIntMacro(mod, K_CAPSLOCK) < 0) {\r\n                PyErr_SetString(PyExc_ValueError, \"Error adding keycode constant\r\n-               return NULL;\r\n+               return ;\r\n        }\r\n #ifdef PYTHREE\r\n        return mod;\r\ndiff --git a/src/autopy-mouse-module.c b/src/autopy-mouse-module.c\r\nindex 021be2a..4a1944e 100644\r\n--- a/src/autopy-mouse-module.c\r\n+++ b/src/autopy-mouse-module.c\r\n@@ -85,14 +85,14 @@ PyMODINIT_FUNC initmouse(void)\r\n        mod = Py_InitModule3(\"mouse\", MouseMethods,\r\n                                       \"autopy module for working with the mouse\r\n #endif\r\n-       if (mod == NULL) return NULL; /* Error */\r\n+       if (mod == NULL) return ; /* Error */\r\n\r\n        /* Add mouse button constants for click_mouse(). */\r\n        if (PyModule_AddIntMacro(mod, LEFT_BUTTON) < 0 ||\r\n                PyModule_AddIntMacro(mod, RIGHT_BUTTON) < 0 ||\r\n                PyModule_AddIntMacro(mod, CENTER_BUTTON) < 0) {\r\n                PyErr_SetString(PyExc_ValueError, \"Error adding constants to mou\r\n-               return NULL;\r\n+               return ;\r\n        }\r\n\r\n        deadbeef_srand_time();\r\n```"}}