Skip to content

update README to match changes in ea9b71d #51

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

Merged
merged 1 commit into from
Apr 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ The ``Keycode`` class defines USB HID keycodes to send using ``Keyboard``.

.. code-block:: python

import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode

# Set up a keyboard device.
kbd = Keyboard()
kbd = Keyboard(usb_hid.devices)

# Type lowercase 'a'. Presses the 'a' key and releases it.
kbd.send(Keycode.A)
Expand Down Expand Up @@ -78,10 +79,11 @@ by various operating systems.

.. code-block:: python

import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS

kbd = Keyboard()
kbd = Keyboard(usb_hid.devices)
layout = KeyboardLayoutUS(kbd)

# Type 'abc' followed by Enter (a newline).
Expand All @@ -95,9 +97,10 @@ The ``Mouse`` class simulates a three-button mouse with a scroll wheel.

.. code-block:: python

import usb_hid
from adafruit_hid.mouse import Mouse

m = Mouse()
m = Mouse(usb_hid.devices)

# Click the left mouse button.
m.click(Mouse.LEFT_BUTTON)
Expand Down Expand Up @@ -125,10 +128,11 @@ remote controls, or the multimedia keys on certain keyboards.

.. code-block:: python

import usb_hid
from adafruit_hid.consumer_control import ConsumerControl
from adafruit_hid.consumer_control_code import ConsumerControlCode

cc = ConsumerControl()
cc = ConsumerControl(usb_hid.devices)

# Raise volume.
cc.send(ConsumerControlCode.VOLUME_INCREMENT)
Expand All @@ -142,9 +146,10 @@ The ``Gamepad`` class emulates a two-joystick gamepad with 16 buttons.

.. code-block:: python

import usb_hid
from adafruit_hid.gamepad import Gamepad

gp = Gamepad()
gp = Gamepad(usb_hid.devices)

# Click gamepad buttons.
gp.click_buttons(1, 7)
Expand Down