gh223: Add holdInterval in keySimulator - #211
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the remote-control abstraction to support a holdInterval parameter (intended to represent holding a keypress) and updates the KeySimulator-backed remote controller to pass repeat/delay/hold options through to the underlying keySimulator command.
Changes:
- Added
holdIntervalparameter tocommonRemoteClass.sendKey()and propagated it to the selected remote controller. - Updated
remoteKeySimulator.sendKey()to invokekeySimulatoronce with-i(delay),-r(repeat), and-p(holdInterval) arguments. - Updated
remoteNone.sendKey()signature/logging to includeholdInterval.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| framework/core/remoteControllerModules/none.py | Adds holdInterval to the no-op remote controller interface/logging. |
| framework/core/remoteControllerModules/keySimulator.py | Passes repeat/delay/holdInterval via keySimulator CLI args instead of looping locally. |
| framework/core/commonRemote.py | Adds holdInterval to the public sendKey() API and forwards it to the active remote controller. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Where's the ticket for this PR? |
Created the ticket: #223 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (6)
framework/core/remoteControllerModules/skyProc.py:60
- remoteSkyProc.sendKey() uses self.session.runTargetCommand(), but remoteSkyProc never defines self.session (only self.telnet). This will raise AttributeError when sendKey() is called. Using the existing telnet-based command() helper avoids the undefined attribute and surfaces failures.
command="echo " + str(code) + " > /proc/cdi_ir"
for _ in range(repeat):
self.session.runTargetCommand(command, delay)
return True
framework/core/remoteControllerModules/remoteInterface.py:54
- holdInterval is documented as “wait between key presses”, which duplicates the meaning of delay. Based on the ticket/CLI (-p), this parameter represents the press-and-hold duration.
holdInterval (int): How long to wait between key presses.
framework/core/remoteControllerModules/none.py:53
- holdInterval is documented as “wait between key presses”, which duplicates delay. The new parameter name and ticket imply this is the key hold duration.
holdInterval (int): How long to wait between key presses.
framework/core/remoteControllerModules/arduino.py:58
- holdInterval is documented as “wait between key presses”, which duplicates delay. The ticket/CLI (-p) implies this is the key hold duration.
holdInterval (int): How long to wait between key presses.
framework/core/remoteControllerModules/keySimulator.py:59
- remoteKeySimulator.sendKey() defaults repeat to 0, which makes sendKey() a no-op when called without an explicit repeat. This is inconsistent with commonRemote.sendKey() (default repeat=1) and with the keySimulator CLI behavior (default is to send once).
def sendKey(self, key: str, repeat: int=0, delay: int=1, holdInterval: int=0):
framework/core/remoteControllerModules/keySimulator.py:66
- holdInterval is documented as “wait between key presses”, which duplicates delay. Per the ticket/CLI (-p), this should describe the press-and-hold duration.
holdInterval (int): How long to wait between key presses.
Add holdInterval parameter for holding the keypress in KeySimulator.
Also, use the keySimulator arguments for delay & repeat as well.
Ticket: #223