{ "info": { "author": "Adafruit Industries", "author_email": "circuitpython@adafruit.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries", "Topic :: System :: Hardware" ], "description": "Introduction\n============\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-hid/badge/?version=latest\n :target: https://circuitpython.readthedocs.io/projects/hid/en/latest/\n :alt: Documentation Status\n\n.. image :: https://img.shields.io/discord/327254708534116352.svg\n :target: https://discord.gg/nBQh6qu\n :alt: Discord\n\n.. image:: https://travis-ci.com/adafruit/Adafruit_CircuitPython_HID.svg?branch=master\n :target: https://travis-ci.com/adafruit/Adafruit_CircuitPython_HID\n :alt: Build Status\n\n\nThis driver simulates USB HID devices. Currently keyboard and mouse are implemented.\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython `_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle `_.\n\nUsage Example\n=============\n\nThe ``Keyboard`` class sends keypress reports for a USB keyboard device to the host.\n\nThe ``Keycode`` class defines USB HID keycodes to send using ``Keyboard``.\n\n.. code-block:: python\n\n from adafruit_hid.keyboard import Keyboard\n from adafruit_hid.keycode import Keycode\n\n # Set up a keyboard device.\n kbd = Keyboard()\n\n # Type lowercase 'a'. Presses the 'a' key and releases it.\n kbd.send(Keycode.A)\n\n # Type capital 'A'.\n kbd.send(Keycode.SHIFT, Keycode.A)\n\n # Type control-x.\n kbd.send(Keycode.CONTROL, Keycode.X)\n\n # You can also control press and release actions separately.\n kbd.press(Keycode.CONTROL, Keycode.X)\n kbd.release_all()\n\n # Press and hold the shifted '1' key to get '!' (exclamation mark).\n kbd.press(Keycode.SHIFT, Keycode.ONE)\n # Release the ONE key and send another report.\n kbd.release(Keycode.ONE)\n # Press shifted '2' to get '@'.\n kbd.press(Keycode.TWO)\n # Release all keys.\n kbd.release_all()\n\nThe ``KeyboardLayoutUS`` sends ASCII characters using keypresses. It assumes\nthe host is set to accept keypresses from a US keyboard.\n\nIf the host is expecting a non-US keyboard, the character to key mapping provided by\n``KeyboardLayoutUS`` will not always be correct.\nDifferent keypresses will be needed in some cases. For instance, to type an ``'A'`` on\na French keyboard (AZERTY instead of QWERTY), ``Keycode.Q`` should be pressed.\n\nCurrently this package provides only ``KeyboardLayoutUS``. More ``KeyboardLayout``\nclasses could be added to handle non-US keyboards and the different input methods provided\nby various operating systems.\n\n.. code-block:: python\n\n from adafruit_hid.keyboard import Keyboard\n from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS\n\n kbd = Keyboard()\n layout = KeyboardLayoutUS(kbd)\n\n # Type 'abc' followed by Enter (a newline).\n layout.write('abc\\n')\n\n # Get the keycodes needed to type a '$'.\n # The method will return (Keycode.SHIFT, Keycode.FOUR).\n keycodes = layout.keycodes('$')\n\nThe ``Mouse`` class simulates a three-button mouse with a scroll wheel.\n\n.. code-block:: python\n\n from adafruit_hid.mouse import Mouse\n\n m = Mouse()\n\n # Click the left mouse button.\n m.click(Mouse.LEFT_BUTTON)\n\n # Move the mouse diagonally to the upper left.\n m.move(-100, -100, 0)\n\n # Roll the mouse wheel away from the user one unit.\n # Amount scrolled depends on the host.\n m.move(0, 0, -1)\n\n # Keyword arguments may also be used. Omitted arguments default to 0.\n m.move(x=-100, y=-100)\n m.move(wheel=-1)\n\n # Move the mouse while holding down the left button. (click-drag).\n m.press(Mouse.LEFT_BUTTON)\n m.move(x=50, y=20)\n m.release_all() # or m.release(Mouse.LEFT_BUTTON)\n\nThe ``ConsumerControl`` class emulates consumer control devices such as\nremote controls, or the multimedia keys on certain keyboards.\n\n*New in CircuitPython 3.0.*\n\n.. code-block:: python\n\n from adafruit_hid.consumer_control import ConsumerControl\n from adafruit_hid.consumer_control_code import ConsumerControlCode\n\n cc = ConsumerControl()\n\n # Raise volume.\n cc.send(ConsumerControlCode.VOLUME_INCREMENT)\n\n # Pause or resume playback.\n cc.send(ConsumerControlCode.PLAY_PAUSE)\n\nThe ``Gamepad`` class emulates a two-joystick gamepad with 16 buttons.\n\n*New in CircuitPython 3.0.*\n\n.. code-block:: python\n\n from adafruit_hid.gamepad import Gamepad\n\n gp = Gamepad()\n\n # Click gamepad buttons.\n gp.click_buttons(1, 7)\n\n # Move joysticks.\n gp.move_joysticks(x=2, y=0, z=-20)\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n`_\nbefore contributing to help this project stay welcoming.\n\nBuilding locally\n================\n\nTo build this library locally you'll need to install the\n`circuitpython-build-tools `_ package.\n\n.. code-block:: shell\n\n python3 -m venv .env\n source .env/bin/activate\n pip install circuitpython-build-tools\n\nOnce installed, make sure you are in the virtual environment:\n\n.. code-block:: shell\n\n source .env/bin/activate\n\nThen run the build:\n\n.. code-block:: shell\n\n circuitpython-build-bundles --filename_prefix adafruit-circuitpython-hid --library_location .\n\nSphinx documentation\n-----------------------\n\nSphinx is used to build the documentation based on rST files and comments in the code. First,\ninstall dependencies (feel free to reuse the virtual environment from above):\n\n.. code-block:: shell\n\n python3 -m venv .env\n source .env/bin/activate\n pip install Sphinx sphinx-rtd-theme\n\nNow, once you have the virtual environment activated:\n\n.. code-block:: shell\n\n cd docs\n sphinx-build -E -W -b html . _build/html\n\nThis will output the documentation to ``docs/_build/html``. Open the index.html in your browser to\nview them. It will also (due to -W) error out on any warning like Travis will. This is a good way to\nlocally verify it will pass.", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/adafruit/Adafruit_CircuitPython_HID", "keywords": "adafruit hid human interface device keyboard mouse keycode keypadhardware micropython circuitpython", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "adafruit-circuitpython-hid", "package_url": "https://pypi.org/project/adafruit-circuitpython-hid/", "platform": "", "project_url": "https://pypi.org/project/adafruit-circuitpython-hid/", "project_urls": { "Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_HID" }, "release_url": "https://pypi.org/project/adafruit-circuitpython-hid/3.3.5/", "requires_dist": null, "requires_python": "", "summary": "CircuitPython helper library for simulating HID devices.", "version": "3.3.5" }, "last_serial": 5432937, "releases": { "3.2.0": [ { "comment_text": "", "digests": { "md5": "62b4f909dd1a31fd9310532ad7362a26", "sha256": "123e9ed56bbe398651d48aac468e33c17252e28d71f778541907797188ec7893" }, "downloads": -1, "filename": "adafruit-circuitpython-hid-3.2.0.tar.gz", "has_sig": false, "md5_digest": "62b4f909dd1a31fd9310532ad7362a26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31937, "upload_time": "2018-08-09T16:04:56", "url": "https://files.pythonhosted.org/packages/75/57/e121696176adf89265c496404040903e69c478b2174e98732ca202ef5596/adafruit-circuitpython-hid-3.2.0.tar.gz" } ], "3.3.0": [ { "comment_text": "", "digests": { "md5": "b48a07c046ba572fb44d2f8f94d02a29", "sha256": "78b30f932fc4009c6f9ff2ab4deca7ec4f32ad3c6f32d97e2b53e083704bd0f3" }, "downloads": -1, "filename": "adafruit-circuitpython-hid-3.3.0.tar.gz", "has_sig": false, "md5_digest": "b48a07c046ba572fb44d2f8f94d02a29", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32013, "upload_time": "2018-11-01T17:48:53", "url": "https://files.pythonhosted.org/packages/d0/d5/f877335ece349c5cc69b3e4f42e456bfc9ca79780707da6b215745c57e9c/adafruit-circuitpython-hid-3.3.0.tar.gz" } ], "3.3.1": [ { "comment_text": "", "digests": { "md5": "10b37899e58f65956dfdf75f7d174033", "sha256": "0ba97cc7f9c2ebd375478803ee19c1d64d4d626304e1a47a038713d8ff2d0f9f" }, "downloads": -1, "filename": "adafruit-circuitpython-hid-3.3.1.tar.gz", "has_sig": false, "md5_digest": "10b37899e58f65956dfdf75f7d174033", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32033, "upload_time": "2018-12-03T21:16:46", "url": "https://files.pythonhosted.org/packages/62/b2/964d5ee061b38ab30caac7807b83f0e46aae1ca762f99e10b5d81cc5d085/adafruit-circuitpython-hid-3.3.1.tar.gz" } ], "3.3.2": [ { "comment_text": "", "digests": { "md5": "b25b47c14026b83791a79d4281ae76f2", "sha256": "f3a7aec642c063fbcc309af03c242d2ab42299322e93fb898a3db2591dd801e0" }, "downloads": -1, "filename": "adafruit-circuitpython-hid-3.3.2.tar.gz", "has_sig": false, "md5_digest": "b25b47c14026b83791a79d4281ae76f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31670, "upload_time": "2019-01-16T02:23:12", "url": "https://files.pythonhosted.org/packages/79/bc/f7203748a316b80a8ceaa467918580dcb0bb3d0f9aaf521a9a43f9d310a6/adafruit-circuitpython-hid-3.3.2.tar.gz" } ], "3.3.3": [ { "comment_text": "", "digests": { "md5": "48d0b971a77e2cdd522e4670574e0091", "sha256": "39d382fa5aa781da291bc73a011fc5f2000862100ba9580d132072aea1502ab7" }, "downloads": -1, "filename": "adafruit-circuitpython-hid-3.3.3.tar.gz", "has_sig": false, "md5_digest": "48d0b971a77e2cdd522e4670574e0091", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31674, "upload_time": "2019-03-20T22:10:57", "url": "https://files.pythonhosted.org/packages/47/43/0e9888705fe272f7d79f3e79ad6f9e88aad14e241d251b9dc3d95d9a0449/adafruit-circuitpython-hid-3.3.3.tar.gz" } ], "3.3.4": [ { "comment_text": "", "digests": { "md5": "d5030e7a214ac1fbd9b2cb3eb27cc736", "sha256": "8e62128333a30bacfe5e56a505876b20569d84afc288ac24e694ff068f07748f" }, "downloads": -1, "filename": "adafruit-circuitpython-hid-3.3.4.tar.gz", "has_sig": false, "md5_digest": "d5030e7a214ac1fbd9b2cb3eb27cc736", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31731, "upload_time": "2019-05-23T18:29:36", "url": "https://files.pythonhosted.org/packages/79/94/34f387a1462cde614e41bc67b0687fd4462636271a06e25d4780c28d8404/adafruit-circuitpython-hid-3.3.4.tar.gz" } ], "3.3.5": [ { "comment_text": "", "digests": { "md5": "6f9a35d0daac20a0100e8eeeb96f6b98", "sha256": "cb93d7758bd49e74750b30042b164186f5c7a9a404d14797c4f023da7d6d6393" }, "downloads": -1, "filename": "adafruit-circuitpython-hid-3.3.5.tar.gz", "has_sig": false, "md5_digest": "6f9a35d0daac20a0100e8eeeb96f6b98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31833, "upload_time": "2019-06-21T21:26:32", "url": "https://files.pythonhosted.org/packages/fd/69/8d0d7a466025c06abc50ff9ea672040b27f72e85c2891d40fc6518a078d0/adafruit-circuitpython-hid-3.3.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6f9a35d0daac20a0100e8eeeb96f6b98", "sha256": "cb93d7758bd49e74750b30042b164186f5c7a9a404d14797c4f023da7d6d6393" }, "downloads": -1, "filename": "adafruit-circuitpython-hid-3.3.5.tar.gz", "has_sig": false, "md5_digest": "6f9a35d0daac20a0100e8eeeb96f6b98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31833, "upload_time": "2019-06-21T21:26:32", "url": "https://files.pythonhosted.org/packages/fd/69/8d0d7a466025c06abc50ff9ea672040b27f72e85c2891d40fc6518a078d0/adafruit-circuitpython-hid-3.3.5.tar.gz" } ] }