{ "info": { "author": "Paul Barton , Pepijn de Vos ", "author_email": "pablo.barton@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "PyUserInput\n===========\n\nA module for cross-platform control of the mouse and keyboard in python that is\nsimple to use.\n\nMouse control should work on Windows, Mac, and X11 (most Linux systems).\nScrolling is implemented, but users should be aware that variations may\nexist between platforms and applications.\n\nKeyboard control works on X11(linux) and Windows systems. Mac control is a work\nin progress.\n\nDependencies\n------------\n\nDepending on your platform, you will need the following python modules for\nPyUserInput to function:\n\n * Linux - Xlib\n * Mac - Quartz, AppKit\n * Windows - pywin32, pyHook\n\nHow to get started\n------------------\n\nAfter installing PyUserInput, you should have pymouse and pykeyboard modules in\nyour python path. Let's make a mouse and keyboard object:\n\n```python\n\nfrom pymouse import PyMouse\nfrom pykeyboard import PyKeyboard\n\nm = PyMouse()\nk = PyKeyboard()\n```\n\nHere's an example of clicking the center of the screen and typing \"Hello, World!\":\n\n```python\n\nx_dim, y_dim = m.screen_size()\nm.click(x_dim/2, y_dim/2, 1)\nk.type_string('Hello, World!')\n```\n\nPyKeyboard allows for a range of ways for sending keystrokes:\n\n```python\n\n# pressing a key\nk.press_key('H')\n# which you then follow with a release of the key\nk.release_key('H')\n# or you can 'tap' a key which does both\nk.tap_key('e')\n# note that that tap_key does support a way of repeating keystrokes with a interval time between each\nk.tap_key('l',n=2,interval=5)\n# and you can send a string if needed too\nk.type_string('o World!')\n```\n\n\nand it supports a wide range of special keys:\n\n```python\n\n#Create an Alt+Tab combo\nk.press_key(k.alt_key)\nk.tap_key(k.tab_key)\nk.release_key(k.alt_key)\n\nk.tap_key(k.function_keys[5]) # Tap F5\nk.tap_key(k.numpad_keys['Home']) # Tap 'Home' on the numpad\nk.tap_key(k.numpad_keys[5], n=3) # Tap 5 on the numpad, thrice\n```\n\nNote you can also send multiple keystrokes together (e.g. when accessing a keyboard shortcut) using the press_keys method:\n\n```python\n\n# Mac example\nk.press_keys(['Command','shift','3'])\n# Windows example\nk.press_keys([k.windows_l_key,'d'])\n```\n\nConsistency between platforms is a big challenge; Please look at the source for the operating system that you are using to help understand the format of the keys that you would need to send. For example:\n\n```python\n\n# Windows\nk.tap_key(k.alt_key)\n# Mac\nk.tap_key('Alternate')\n```\n\nI'd like to make a special note about using PyMouseEvent and PyKeyboardEvent.\nThese objects are a framework for listening for mouse and keyboard input; they\ndon't do anything besides listen until you subclass them. I'm still formalizing\nPyKeyboardEvent, so here's an example of subclassing PyMouseEvent:\n\n```python\n\nfrom pymouse import PyMouseEvent\n\ndef fibo():\n a = 0\n yield a\n b = 1\n yield b\n while True:\n a, b = b, a+b\n yield b\n\nclass Clickonacci(PyMouseEvent):\n def __init__(self):\n PyMouseEvent.__init__(self)\n self.fibo = fibo()\n\n def click(self, x, y, button, press):\n '''Print Fibonacci numbers when the left click is pressed.'''\n if button == 1:\n if press:\n print(self.fibo.next())\n else: # Exit if any other mouse button used\n self.stop()\n\nC = Clickonacci()\nC.run()\n```\n\nIntended Functionality of Capturing in PyUserInput\n--------------------------------------------------\n\nFor PyMouseEvent classes, the variables \"capture\" and \"capture_move\" may be\npassed during instantiation. If `capture=True` is passed, the intended result\nis that all mouse button input will go to your program and nowhere else. The\nsame is true for `capture_move=True` except it deals with mouse pointer motion\ninstead of the buttons. Both may be set simultaneously, and serve to prevent\nevents from propagating further. If you notice any bugs with this behavior,\nplease bring it to our attention.\n\nA Short Todo List\n-----------------\n\nThese are a few things I am considering for future development in\nPyUserInput:\n\n * Ensuring that PyMouse capturing works for all platforms\n * Implement PyKeyboard capturing (add PyKeyboardEvent for Mac as well)\n * PyMouse dynamic delta scrolling (available in Mac and Windows, hard to standardize)\n * Make friends with more Mac developers, testing help is needed...\n\n\nMany thanks to\n--------------\n\n[Pepijn de Vos](https://github.com/pepijndevos) - For making\n[PyMouse](https://github.com/pepijndevos/PyMouse) and allowing me to modify\nand distribute it along with PyKeyboard.\n\n[Jack Grigg](https://github.com/pythonian4000) - For contributions to\ncross-platform scrolling in PyMouse.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/PyUserInput/PyUserInput", "keywords": "mouse,keyboard user input event", "license": "http://www.gnu.org/licenses/gpl-3.0.html", "maintainer": null, "maintainer_email": null, "name": "PyUserInput", "package_url": "https://pypi.org/project/PyUserInput/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/PyUserInput/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/PyUserInput/PyUserInput" }, "release_url": "https://pypi.org/project/PyUserInput/0.1.11/", "requires_dist": null, "requires_python": null, "summary": "A simple, cross-platform module for mouse and keyboard control", "version": "0.1.11" }, "last_serial": 2300818, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "fca215295fdde2582244dca8a5a5e61a", "sha256": "fc6299b89dfef0b63f653da9727d24193ad1330a08b797d64ddbf5ca06d4e500" }, "downloads": -1, "filename": "PyUserInput-0.1.tar.gz", "has_sig": false, "md5_digest": "fca215295fdde2582244dca8a5a5e61a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10393, "upload_time": "2013-03-04T21:58:08", "url": "https://files.pythonhosted.org/packages/be/46/0b42e29eb43db196c60c43d6da06d6602a79d709103aa9d41a0a377bc899/PyUserInput-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "ac0d7aa914cd908dac7fa5f764df23d6", "sha256": "7b95c9a3c16971c496943a743efb90a6950aaa6ed7a36009c38da654122e2358" }, "downloads": -1, "filename": "PyUserInput-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ac0d7aa914cd908dac7fa5f764df23d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11112, "upload_time": "2013-03-04T22:38:34", "url": "https://files.pythonhosted.org/packages/50/17/35a160231d183b92a3cf5cc2952b25bd933444a942caf7baad5c67c6772f/PyUserInput-0.1.1.tar.gz" } ], "0.1.10": [ { "comment_text": "", "digests": { "md5": "f61ead09c07f047188f573d93ef8b52e", "sha256": "308f3e97dd727c91b33f75a511366925448b4107868ccd53683afb2594940635" }, "downloads": -1, "filename": "PyUserInput-0.1.10.tar.gz", "has_sig": false, "md5_digest": "f61ead09c07f047188f573d93ef8b52e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27196, "upload_time": "2015-11-29T13:59:05", "url": "https://files.pythonhosted.org/packages/a3/96/bb519fe60526434cb7661baad7042ab2b8091a142ef41b84a60d75da4d17/PyUserInput-0.1.10.tar.gz" } ], "0.1.11": [ { "comment_text": "", "digests": { "md5": "061b539ff3783b72e42e37915c59a8ef", "sha256": "61d9c0e81331b02efa5c62c6fb9416675ae79fbd00a3e12eaa8274b103446857" }, "downloads": -1, "filename": "PyUserInput-0.1.11-py2-none-any.whl", "has_sig": false, "md5_digest": "061b539ff3783b72e42e37915c59a8ef", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 40033, "upload_time": "2016-08-24T16:39:27", "url": "https://files.pythonhosted.org/packages/fc/a7/ed646570dcbef763da66e27e6812dc6723c42e81d0b72a8ace184c40dc89/PyUserInput-0.1.11-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2095c70da5e48c2954588470444a4937", "sha256": "006b5ed06cf740eeeb2c7221e1cb8dc5ae35f16267e41262bfb0e7cfdca7fb2b" }, "downloads": -1, "filename": "PyUserInput-0.1.11.tar.gz", "has_sig": false, "md5_digest": "2095c70da5e48c2954588470444a4937", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28664, "upload_time": "2016-08-24T16:39:25", "url": "https://files.pythonhosted.org/packages/d0/09/17fe0b16c7eeb52d6c14e904596ddde82503aeee268330120b595bf22d7b/PyUserInput-0.1.11.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "890b23a9e8e3346b7649d167672fef09", "sha256": "99db6132e1be55ea31e63cfc85ba037711b4d732f76849e6a5283b4ba4ac5b91" }, "downloads": -1, "filename": "PyUserInput-0.1.2.tar.gz", "has_sig": false, "md5_digest": "890b23a9e8e3346b7649d167672fef09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11617, "upload_time": "2013-03-14T14:39:21", "url": "https://files.pythonhosted.org/packages/40/dc/9e66de76cb5ce64dc3039430c21557e7971988ada9c944a599174a605bf8/PyUserInput-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "c55222d14de13ebf3f30f7d1a0f82c8b", "sha256": "d3414cd66564442f50a1685e5f7bf42741ef5b052438c092c598ed47b77c1ea1" }, "downloads": -1, "filename": "PyUserInput-0.1.3.tar.gz", "has_sig": false, "md5_digest": "c55222d14de13ebf3f30f7d1a0f82c8b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11825, "upload_time": "2013-03-14T18:05:06", "url": "https://files.pythonhosted.org/packages/98/77/17c67965d46c2dde70a314129d04590be318654c0585380c235be93390c3/PyUserInput-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "c22d9e0271a989836187e7b81e6ab7ff", "sha256": "474ab4bf435368ac69fd6c88a45d73c777acd39ab02f079495ccf36a65b4e898" }, "downloads": -1, "filename": "PyUserInput-0.1.4.tar.gz", "has_sig": false, "md5_digest": "c22d9e0271a989836187e7b81e6ab7ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11818, "upload_time": "2013-04-08T15:39:56", "url": "https://files.pythonhosted.org/packages/72/96/92a3b9cea7628e5e94df13a247a5b4d0ef84b80c8526cbb70ee0686b0110/PyUserInput-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "935fec5d984c7bcd30f7772b398ba566", "sha256": "d1bfa104143e8dc3c0de31a49be67358735e8e8ea1e436791ed84dace56f9ec1" }, "downloads": -1, "filename": "PyUserInput-0.1.5.tar.gz", "has_sig": false, "md5_digest": "935fec5d984c7bcd30f7772b398ba566", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11850, "upload_time": "2013-05-29T15:18:28", "url": "https://files.pythonhosted.org/packages/b3/38/1375a8cb22ecad86868ddb14904f58ffb21bbcc222d980af20f130833c90/PyUserInput-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "8948f0905bee91fdda4cb9b6a5946ea0", "sha256": "1d47c5f684937de4b064cb1e6912e035f165ce571690ae11fd5b91a09f64a6b7" }, "downloads": -1, "filename": "PyUserInput-0.1.6.tar.gz", "has_sig": false, "md5_digest": "8948f0905bee91fdda4cb9b6a5946ea0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14613, "upload_time": "2013-09-23T23:10:17", "url": "https://files.pythonhosted.org/packages/17/58/979b8c13da0598b27b57d3e4a1ea9186aba619d5b0727cddac6b36f5456a/PyUserInput-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "db28d6fd6741545235939425d7d356a3", "sha256": "5c9061405d11065d2c2451cd829fde37a8a3caf8fe8f08201aac79a59ea0c35e" }, "downloads": -1, "filename": "PyUserInput-0.1.7.tar.gz", "has_sig": false, "md5_digest": "db28d6fd6741545235939425d7d356a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14631, "upload_time": "2013-09-23T23:21:16", "url": "https://files.pythonhosted.org/packages/9f/74/e06590fd2f18bd3780100214f50547b535c245214895da979998d603dae3/PyUserInput-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "0552eb445142e8ea4624c8550669b9d4", "sha256": "005a0b5fd29b5a0e56aa0de231951b5253eeffba75e723cdf0d58b85bb570f29" }, "downloads": -1, "filename": "PyUserInput-0.1.8.tar.gz", "has_sig": false, "md5_digest": "0552eb445142e8ea4624c8550669b9d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15869, "upload_time": "2013-10-09T16:57:59", "url": "https://files.pythonhosted.org/packages/96/1d/3d26721e187c943d2f6bbfa5ed3e71483cdbc32028eab54d510369a065fa/PyUserInput-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "7a0decf373a67299301afe92c8772b01", "sha256": "401c72db44d570a13c0a6e107aa8221a235dba25c6287dde8fa7fd905452716a" }, "downloads": -1, "filename": "PyUserInput-0.1.9.tar.gz", "has_sig": false, "md5_digest": "7a0decf373a67299301afe92c8772b01", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18677, "upload_time": "2013-11-07T00:17:28", "url": "https://files.pythonhosted.org/packages/de/e5/5f5222d3db12b6434558012ac0e351cf55e9eee6450249c63c638de2669a/PyUserInput-0.1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "061b539ff3783b72e42e37915c59a8ef", "sha256": "61d9c0e81331b02efa5c62c6fb9416675ae79fbd00a3e12eaa8274b103446857" }, "downloads": -1, "filename": "PyUserInput-0.1.11-py2-none-any.whl", "has_sig": false, "md5_digest": "061b539ff3783b72e42e37915c59a8ef", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 40033, "upload_time": "2016-08-24T16:39:27", "url": "https://files.pythonhosted.org/packages/fc/a7/ed646570dcbef763da66e27e6812dc6723c42e81d0b72a8ace184c40dc89/PyUserInput-0.1.11-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2095c70da5e48c2954588470444a4937", "sha256": "006b5ed06cf740eeeb2c7221e1cb8dc5ae35f16267e41262bfb0e7cfdca7fb2b" }, "downloads": -1, "filename": "PyUserInput-0.1.11.tar.gz", "has_sig": false, "md5_digest": "2095c70da5e48c2954588470444a4937", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28664, "upload_time": "2016-08-24T16:39:25", "url": "https://files.pythonhosted.org/packages/d0/09/17fe0b16c7eeb52d6c14e904596ddde82503aeee268330120b595bf22d7b/PyUserInput-0.1.11.tar.gz" } ] }