ws-scrcpy icon indicating copy to clipboard operation
ws-scrcpy copied to clipboard

Requesting additional actions for iOS

Open krishtoautomate opened this issue 2 years ago • 3 comments

Double tap : post : {{DEVICE_URL}}/session/{{SESSSION_ID}}/wda/doubleTap Body: {"x":146,"y":669}

Long press: Post : {{DEVICE_URL}}/session/{{SESSSION_ID}}/wda/touchAndHold Body: {"x":132,"y":132,"duration":2}

Lock: Post : {{DEVICE_URL}}/wda/lock

Unlock: post: {{DEVICE_URL}}/wda/unlock

Rotate: post : {{DEVICE_URL}}/session/{{SESSSION_ID}}/orientation Body: {"orientation":"LANDSCAPE"} or {"orientation":"PORTRAIT"}

clear text: {{DEVICE_URL}}/session/{{SESSSION_ID}}/wda/clear

krishtoautomate avatar Jun 26 '22 22:06 krishtoautomate

click or long press time need to be added to listeners request

krishtoautomate avatar Aug 28 '22 03:08 krishtoautomate

may I know where to add keydown or keyup listeners for ios in code

krishtoautomate avatar Aug 28 '22 03:08 krishtoautomate

may I know where to add keydown or keyup listeners for ios in code

Here is how it is done for android: https://github.com/NetrisTV/ws-scrcpy/blob/f397475f03d0ec173a00163383a8af92f676941a/src/app/googDevice/client/StreamClientScrcpy.ts#L44-L46 https://github.com/NetrisTV/ws-scrcpy/blob/f397475f03d0ec173a00163383a8af92f676941a/src/app/googDevice/client/StreamClientScrcpy.ts#L358-L368

I think, you could do the same in src/app/applDevice/client/StreamClient.ts:

  • implement KeyEventListener interface in StreamClient (add onKeyEvent)
  • call KeyInputHandler.addEventListener(this); when you need it
  • (optional) move KeyInputHandler.ts from googDevice since it will be not android-specific-class and maybe change its behaviour to generate simple object instead of KeyCodeControlMessagem since we have no use for it in outside scrcpy.

You can take a look at this fork, they have done something similar: https://github.com/HardBoiledSmith/ws-scrcpy

drauggres avatar Aug 28 '22 07:08 drauggres