Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to support double tap key press? #325

Closed
zhiningq opened this issue Jun 27, 2024 · 4 comments
Closed

Is it possible to support double tap key press? #325

zhiningq opened this issue Jun 27, 2024 · 4 comments
Labels
enhancement New feature or request stale

Comments

@zhiningq
Copy link

zhiningq commented Jun 27, 2024

My goal is to be able to force quit an app using double tap home key and swipe up:

It can only be achieved using workaround

  • atvremote -s home home // calling this can show a list of background apps
  • atvremote -s up up // calling this can exit the current app

Is it possible to allow keyPress to take an array instead of just a single key?

async pressKey(key: NodePyATVKeys): Promise<void> {

or if we could support double tap on keyPress with InputAction https://github.com/postlund/pyatv/blob/master/pyatv/interface.py#L372

@zhiningq zhiningq changed the title Is it possible to support double tap home key Is it possible to support double tap key press? Jun 27, 2024
@sebbo2002 sebbo2002 added the enhancement New feature or request label Jun 28, 2024
@sebbo2002
Copy link
Owner

Sounds absolutely feasible, implementing InputAction would probably make more sense. Unfortunately I have a lot to do at the moment, but if it's not urgent I would take care of it in the next few weeks. Otherwise, I'm also happy to accept pull requests if it's urgent.

@sebbo2002
Copy link
Owner

I had a quick look at the whole thing. Currently InputAction does not seem to be available for atvscript (which is used by this library for most key actions), also home home or up up does not work here:

❯❯❯ atvscript -s up up
usage: atvscript [-h] [--storage {file,none}] [--storage-filename STORAGE_FILENAME] [-i ID] [--protocol PROTOCOL] [-s SCAN_HOSTS] [--output OUTPUT] [--debug]
                 [--dmap-credentials DMAP_CREDENTIALS] [--mrp-credentials MRP_CREDENTIALS] [--airplay-credentials AIRPLAY_CREDENTIALS]
                 [--companion-credentials COMPANION_CREDENTIALS] [--raop-credentials RAOP_CREDENTIALS]
                 command
atvscript: error: unrecognized arguments: up

Do you happen to know how to double-click in atvscript? Otherwise this feature would have to be implemented in pyatv's atvscript first. The best thing to do is to open a ticket there and explain your requirements.

@maxileith
Copy link
Contributor

That is how I implemented it in homebridge-appletv-enhanced. "Avadra Kedavra" closes opened apps. This is of course not very configurable and specific to my plugin but you should get an idea how it works.

https://github.com/maxileith/homebridge-appletv-enhanced/blob/e76051886273fef47abd6f24559ca6e9dfe82f58/src/RocketRemote.ts#L191-L204

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 14 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️

@github-actions github-actions bot added the stale label Sep 10, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

3 participants