Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MouseJiggler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gm2g20
MouseJiggler
Commits
87e7479e
Commit
87e7479e
authored
2 years ago
by
gm2g20
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
d6021d94
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
adafruit_hid/__init__.py
+45
-0
45 additions, 0 deletions
adafruit_hid/__init__.py
with
45 additions
and
0 deletions
adafruit_hid/__init__.py
0 → 100644
+
45
−
0
View file @
87e7479e
# SPDX-FileCopyrightText: 2017 Scott Shawcroft for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_hid`
====================================================
This driver simulates USB HID devices.
* Author(s): Scott Shawcroft, Dan Halbert
Implementation Notes
--------------------
**Software and Dependencies:**
* Adafruit CircuitPython firmware for the supported boards:
https://github.com/adafruit/circuitpython/releases
"""
# imports
try
:
from
typing
import
Sequence
import
usb_hid
except
ImportError
:
pass
__version__
=
"
0.0.0-auto.0
"
__repo__
=
"
https://github.com/adafruit/Adafruit_CircuitPython_HID.git
"
def
find_device
(
devices
:
Sequence
[
usb_hid
.
Device
],
*
,
usage_page
:
int
,
usage
:
int
)
->
usb_hid
.
Device
:
"""
Search through the provided sequence of devices to find the one with the matching
usage_page and usage.
"""
if
hasattr
(
devices
,
"
send_report
"
):
devices
=
[
devices
]
for
device
in
devices
:
if
(
device
.
usage_page
==
usage_page
and
device
.
usage
==
usage
and
hasattr
(
device
,
"
send_report
"
)
):
return
device
raise
ValueError
(
"
Could not find matching HID device.
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment