Skip to content

gh223: Add holdInterval in keySimulator - #211

Open
mshameersm wants to merge 4 commits into
developfrom
feature/keySimulatorHoldInterval
Open

gh223: Add holdInterval in keySimulator#211
mshameersm wants to merge 4 commits into
developfrom
feature/keySimulatorHoldInterval

Conversation

@mshameersm

@mshameersm mshameersm commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Add holdInterval parameter for holding the keypress in KeySimulator.
Also, use the keySimulator arguments for delay & repeat as well.

Ticket: #223

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 holdInterval parameter to commonRemoteClass.sendKey() and propagated it to the selected remote controller.
  • Updated remoteKeySimulator.sendKey() to invoke keySimulator once with -i (delay), -r (repeat), and -p (holdInterval) arguments.
  • Updated remoteNone.sendKey() signature/logging to include holdInterval.

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.

Comment thread framework/core/commonRemote.py
Comment thread framework/core/remoteControllerModules/none.py
Comment thread framework/core/remoteControllerModules/keySimulator.py Outdated
Comment thread framework/core/remoteControllerModules/keySimulator.py
Copilot AI review requested due to automatic review settings May 6, 2026 05:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Comment thread framework/core/remoteControllerModules/remoteInterface.py
Comment thread framework/core/remoteControllerModules/none.py
Comment thread framework/core/remoteControllerModules/arduino.py
Comment thread framework/core/remoteControllerModules/keySimulator.py
Comment thread framework/core/commonRemote.py

@rishi-remju rishi-remju left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good for me

@TB-1993

TB-1993 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Where's the ticket for this PR?
Also I'm not sure if I understand the purpose? Do we not achieve the same thing using the repeats and delay?

@mshameersm mshameersm changed the title Add holdInterval in keySimulator gh223: Add holdInterval in keySimulator Jul 22, 2026
Copilot AI review requested due to automatic review settings July 22, 2026 09:53
@mshameersm

Copy link
Copy Markdown
Contributor Author

Where's the ticket for this PR? Also I'm not sure if I understand the purpose? Do we not achieve the same thing using the repeats and delay?

Created the ticket: #223
Repeat + delay is not working in apps as some apps dismisses the progress bar when we release the key. This is an additional option in keySimulator. This PR is to access that option from code.
Thank you

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread framework/core/remoteControllerModules/remoteInterface.py
Comment thread framework/core/remoteControllerModules/keySimulator.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants