Python usb hid feature

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

USB / HID windows helper library

License

rene-aguirre/pywinusb

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Fixes off-by-one when looping over a Usage range.

Git stats

Files

Failed to load latest commit information.

README.rst

Installing and Using pywinusb.hid

Table of Contents

This project aims to be a simple USB/HID user application space (hence no system drivers needed) 100% python package (without C extensions). Initially targeting simple HID devices management.

The vision for this project is to be something similar to PySerial or PyParallel but for USB/HID hardware enthusiasts.

  • All python code, using ctypes
  • Top level handling of HID events (usage events calling hook function handlers)

Depending on your application you might find these limitations

  • Windows only (so far. )
  • Maybe speed. I’ve had feedback by some users that speed is not a problem for high data throughput, but I think you might hit some Python limits if you are require any real time processing.

The most convenient way of installing is using easy_install or pip (see below for pip install commands in Windows). I recommend you do this once you are familiar with the library as you might otherwise loose track of the example source files. However, you can always come back and take a look at the examples or the source browsing the github repository here.

from the main repository) and run the familiar setup.py install command from the command line, as this is sufficient. Note that setuptools or distribute (for python 3) are required.

So far only Windows OS it’s supported.

View the ./examples directory for some (ok, few right now) scripts. These show, for instance, how to use pywinusb.hid to handle events from HID class devices usages events.

Latest code and some Wiki information can be found on the main project code page.

  • The module pywinusb.hid.tools contains a function to check HID class devices capabilities, for now it provides a basic human readable text report (see the hid.core package, run it as main while HID class devices are connected to your system)

Feel free to contact me! use the main code project page, just tell what do you think about the project or bring me anything you think might be cool to consider.

Any participation it’s appreciated, feel free to contribute more examples or applications or just a reference to your open source project that uses the library.

About

USB / HID windows helper library

Источник

Use the Human Interface Device (HID) module

The Python hid module provides a programmatic access to a USB Human Interface Device (HID) from within a Python script.

For example, to determine information about a USB-connected keyboard:

  1. Select a device in Remote Manager that is configured to allow shell access to the admin user, and click Actions >Open Console. Alternatively, log into the LR54 local command line as a user with shell access. Depending on your device configuration, you may be presented with an Access selection menu. Type shell to access the device shell.
  2. At the shell prompt, use the python command with no parameters to enter an interactive Python session:
# python Python 3.10.1 (main, Mar 30 2023, 23:47:13) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>>

This returns information about the keyboard:

Help for the hid module

Get help for the hid module:

  1. Select a device in Remote Manager that is configured to allow shell access to the admin user, and click Actions >Open Console. Alternatively, log into the LR54 local command line as a user with shell access. Depending on your device configuration, you may be presented with an Access selection menu. Type shell to access the device shell.
  2. At the shell prompt, use the python command with no parameters to enter an interactive Python session:
# python Python 3.10.1 (main, Mar 30 2023, 23:47:13) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>>
>>> help(hid) Help on package hid: NAME hid PACKAGE CONTENTS CLASSES _ctypes.Structure(_ctypes._CData) DeviceInfo builtins.Exception(builtins.BaseException) HIDException builtins.object Device . >>>

© 2023 Digi International Inc. All rights reserved.
Use the Human Interface Device (HID) module updated on 26 Sep 2022 03:59 PM

Источник

Читайте также:  Php opt in opt out
Оцените статью