Closed jdeanwallace closed 11 months ago
Related https://github.com/tiny-pilot/tinypilot/issues/1026
This PR introduces the HID Keystroke class that represents a combination of HID keycode and HID modifier. This PR replaces the use of individual keycode and modifier/control_keys variables with a single keystroke variable.
Keystroke
keycode
modifier
control_keys
keystroke
This is a non-functional change that simplifies the way we represent HID Keystrokes in anticipation for parsing text to HID keystrokes via https://github.com/tiny-pilot/tinypilot/pull/1624
text
language
request_parser
socket_api.py
if
⏳ @mtlynch please review this Pull Request
Related https://github.com/tiny-pilot/tinypilot/issues/1026
This PR introduces the HID
Keystroke
class that represents a combination of HID keycode and HID modifier. This PR replaces the use of individualkeycode
andmodifier
/control_keys
variables with a singlekeystroke
variable.This is a non-functional change that simplifies the way we represent HID Keystrokes in anticipation for parsing text to HID keystrokes via https://github.com/tiny-pilot/tinypilot/pull/1624
Notes:
text
+language
directly to HID keystrokes in arequest_parser
. Ideally, I'd like to do the same when parsing JS keystroke WebSocket messages which are pollutingsocket_api.py
with JS-to-HID conversion logic. This kind of change would cause some churn, so I did not implement that here.if
statement can never be truthy. https://github.com/tiny-pilot/tinypilot/blob/c972446e5301b0720d518dd76963fc94ec1f00f8/app/socket_api.py#L35-L38