ws-scrcpy
ws-scrcpy copied to clipboard
Requesting additional actions for iOS
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
click or long press time need to be added to listeners request
may I know where to add keydown or keyup listeners for ios in code
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 inStreamClient
(addonKeyEvent
) - call
KeyInputHandler.addEventListener(this);
when you need it - (optional) move
KeyInputHandler.ts
fromgoogDevice
since it will be not android-specific-class and maybe change its behaviour to generate simple object instead ofKeyCodeControlMessage
m 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