AnalogSensePy 1.0.6__tar.gz → 1.0.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AnalogSensePy
3
- Version: 1.0.6
3
+ Version: 1.0.7
4
4
  License: MIT
5
5
  Project-URL: Homepage, https://github.com/girlglock/AnalogSense-Python-SDK
6
6
  Requires-Python: >=3.10
@@ -13,7 +13,7 @@ Dynamic: license-file
13
13
  # AnalogSense Python SDK
14
14
  Python port of [AnalogSense.js](https://github.com/AnalogSense/JavaScript-SDK/) for analog keyboard input.
15
15
  ## Supported Keyboards/Devices
16
- - Everything by Wooting
16
+ - Everything by Wooting<sup>T</sup>
17
17
  - Everything by NuPhy
18
18
  - Everything by DrunkDeer
19
19
  - Razer Huntsman V2 Analog<sup>R</sup>
@@ -29,8 +29,9 @@ Python port of [AnalogSense.js](https://github.com/AnalogSense/JavaScript-SDK/)
29
29
  - Madlions MAD60HE<sup>P</sup>
30
30
  - Madlions MAD68HE<sup>P</sup>
31
31
  - Madlions MAD68R<sup>P</sup>
32
- - Redragon K709HE<sup>P</sup>
32
+ - Redragon K709HE<sup>P, T</sup>
33
33
 
34
+ <sup>T</sup> Tested and should work. Feel free to open issues/prs about boards not being picked up properly
34
35
  <sup>R</sup> Razer Synapse needs to be installed and running for analogue inputs to be received from this keyboard.
35
36
  <sup>P</sup> The official firmware only supports polling, which can lead to lag and missed inputs.
36
37
  <sup>F</sup> [Custom firmware with full analog report functionality is available](https://analogsense.org/firmware/).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AnalogSensePy
3
- Version: 1.0.6
3
+ Version: 1.0.7
4
4
  License: MIT
5
5
  Project-URL: Homepage, https://github.com/girlglock/AnalogSense-Python-SDK
6
6
  Requires-Python: >=3.10
@@ -13,7 +13,7 @@ Dynamic: license-file
13
13
  # AnalogSense Python SDK
14
14
  Python port of [AnalogSense.js](https://github.com/AnalogSense/JavaScript-SDK/) for analog keyboard input.
15
15
  ## Supported Keyboards/Devices
16
- - Everything by Wooting
16
+ - Everything by Wooting<sup>T</sup>
17
17
  - Everything by NuPhy
18
18
  - Everything by DrunkDeer
19
19
  - Razer Huntsman V2 Analog<sup>R</sup>
@@ -29,8 +29,9 @@ Python port of [AnalogSense.js](https://github.com/AnalogSense/JavaScript-SDK/)
29
29
  - Madlions MAD60HE<sup>P</sup>
30
30
  - Madlions MAD68HE<sup>P</sup>
31
31
  - Madlions MAD68R<sup>P</sup>
32
- - Redragon K709HE<sup>P</sup>
32
+ - Redragon K709HE<sup>P, T</sup>
33
33
 
34
+ <sup>T</sup> Tested and should work. Feel free to open issues/prs about boards not being picked up properly
34
35
  <sup>R</sup> Razer Synapse needs to be installed and running for analogue inputs to be received from this keyboard.
35
36
  <sup>P</sup> The official firmware only supports polling, which can lead to lag and missed inputs.
36
37
  <sup>F</sup> [Custom firmware with full analog report functionality is available](https://analogsense.org/firmware/).
@@ -1,7 +1,7 @@
1
1
  # AnalogSense Python SDK
2
2
  Python port of [AnalogSense.js](https://github.com/AnalogSense/JavaScript-SDK/) for analog keyboard input.
3
3
  ## Supported Keyboards/Devices
4
- - Everything by Wooting
4
+ - Everything by Wooting<sup>T</sup>
5
5
  - Everything by NuPhy
6
6
  - Everything by DrunkDeer
7
7
  - Razer Huntsman V2 Analog<sup>R</sup>
@@ -17,8 +17,9 @@ Python port of [AnalogSense.js](https://github.com/AnalogSense/JavaScript-SDK/)
17
17
  - Madlions MAD60HE<sup>P</sup>
18
18
  - Madlions MAD68HE<sup>P</sup>
19
19
  - Madlions MAD68R<sup>P</sup>
20
- - Redragon K709HE<sup>P</sup>
20
+ - Redragon K709HE<sup>P, T</sup>
21
21
 
22
+ <sup>T</sup> Tested and should work. Feel free to open issues/prs about boards not being picked up properly
22
23
  <sup>R</sup> Razer Synapse needs to be installed and running for analogue inputs to be received from this keyboard.
23
24
  <sup>P</sup> The official firmware only supports polling, which can lead to lag and missed inputs.
24
25
  <sup>F</sup> [Custom firmware with full analog report functionality is available](https://analogsense.org/firmware/).
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
  import sys
3
+ import threading
3
4
  import warnings
4
5
 
5
6
  from .providers import ALL_PROVIDERS, AsProvider
@@ -51,7 +52,22 @@ class AnalogSense:
51
52
  try:
52
53
  vendor_id = f.get("vendor_id", 0)
53
54
  product_id = f.get("product_id", 0)
54
- for info in _hid.enumerate(vendor_id, product_id):
55
+ result = []
56
+ exc = []
57
+ def _enumerate(v=vendor_id, p=product_id):
58
+ try:
59
+ result.extend(_hid.enumerate(v, p))
60
+ except Exception as e:
61
+ exc.append(e)
62
+ t = threading.Thread(target=_enumerate, daemon=True)
63
+ t.start()
64
+ t.join(timeout=3.0)
65
+ if exc:
66
+ raise exc[0]
67
+ if t.is_alive():
68
+ warnings.warn(f"HID enumeration timed out for {vendor_id:#06x}:{product_id:#06x}, device may be in a bad state, try reconnecting")
69
+ continue
70
+ for info in result:
55
71
  dedup_key = (info["vendor_id"], info["product_id"], info.get("usage_page", 0), info.get("usage", 0))
56
72
  if dedup_key in seen: continue
57
73
  if "usage_page" in f and info.get("usage_page") != f["usage_page"]: continue
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "AnalogSensePy"
7
- version = "1.0.6"
7
+ version = "1.0.7"
8
8
  readme = "README.md"
9
9
  license = { text = "MIT" }
10
10
  requires-python = ">=3.10"
File without changes
File without changes