Commit graph

20 commits

Author SHA1 Message Date
Benoit Pierre
c37c556e91 use pyusb_libusb1_backend on Linux/macOS
This will make it easier to get libusb installed on those platforms.
2021-10-26 20:40:35 +02:00
Ted Morin
0e2ae03390
Merge pull request #3 from EPLHREU/master
reduce CPU usage from constant polling
2021-10-09 17:50:26 -04:00
Ted Morin
cdf9e1f064
Reduce sleep to 100ms 2021-10-09 17:49:23 -04:00
Emily Easteal
49facd781f reduce CPU usage from constant polling
On my computer, plover is one of the most resource intensive processes when using this plugin.
This is because the USB polling occurs in a loop with no sleep.
The code as it was, polled for USB information in excess of 1600 times a second.
This commit adds in a sleep to reduce that down to 6 to 7 polls a second.
A sleep of 0.15 seconds was chosen as this in excess of 5 strokes per second - the fastest I could find.
Additionally, the delay doesn't introduce significant lag to realtime output.
2021-06-09 12:48:17 +01:00
Benoit Pierre
9a68d58c3f add more debug traces 2021-05-29 16:08:42 +02:00
Benoit Pierre
800b761db0 cosmetic 2021-05-29 16:08:42 +02:00
Benoit Pierre
aeececf43f cleanup Stenograph._connect_machine 2021-05-29 16:08:42 +02:00
Benoit Pierre
3e536c8a21 fix pyusb implementation
The `StenographMachine` class does not have a `_error` method.
2021-05-29 16:08:42 +02:00
Benoit Pierre
d3a13abba6 fix Windows implementation
The handling of the `SP_DEVICE_INTERFACE_DETAIL_DATA_A` argument
to `SetupDiGetDeviceInterfaceDetail` is wrong: the hard-coded size
only works for 32bits.

Fix call to `CloseHandle` with an invalid (0) handle: use
`INVALID_HANDLE_VALUE` for `StenographMachine._usb_device`
initial value.
2021-05-29 16:06:48 +02:00
Benoit Pierre
b39eeca9c4 preliminary cleanup of Windows implementation 2021-05-29 16:05:36 +02:00
Benoit Pierre
0467a29d22 cleanup Stenograph._send_receive implementation 2021-05-26 19:38:25 +02:00
Benoit Pierre
4b18114dd2 lint: unnecessary-pass 2021-05-26 19:34:34 +02:00
Benoit Pierre
5cdbbd3634 lint: pointless-string-statement 2021-05-26 19:34:26 +02:00
Benoit Pierre
5e4543a6ef cleanup Python 2 leftovers 2021-05-26 19:30:19 +02:00
Ilkka Pohjalainen
92e97ab880 Add try-catch for USB device set_configuration()
Needs to be added in order to get access denied erro when
sufficient permissions. Affects Linux platform.
2019-08-02 17:18:19 +03:00
Ted Morin
43b558d8ac Pad data to 8 bytes, remove * imports 2018-05-27 21:27:19 -04:00
Ted Morin
db9fb0e32d Version 0.0.4 2018-05-22 09:38:36 -04:00
Ted Morin
32bad8706c Fix support for Protege 2018-05-21 13:40:29 -04:00
Ted Morin
4d3017912e Refactor code 2018-02-26 22:27:32 -05:00
Ted Morin
f90d4dfc94 Initial implementation of Stenograph USB 2018-02-26 22:26:43 -05:00