mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 04:53:28 +02:00
Support rotation.
This commit is contained in:
@@ -349,29 +349,37 @@ module.exports = syrup.serial()
|
||||
})
|
||||
.on(wire.KeyDownMessage, function(channel, message) {
|
||||
sendInputEvent({
|
||||
action: 0
|
||||
action: apk.agentProto.InputAction.KEYDOWN
|
||||
, keyCode: keyutil.unwire(message.keyCode)
|
||||
})
|
||||
})
|
||||
.on(wire.KeyUpMessage, function(channel, message) {
|
||||
sendInputEvent({
|
||||
action: 1
|
||||
action: apk.agentProto.InputAction.KEYUP
|
||||
, keyCode: keyutil.unwire(message.keyCode)
|
||||
})
|
||||
})
|
||||
.on(wire.KeyPressMessage, function(channel, message) {
|
||||
sendInputEvent({
|
||||
action: 2
|
||||
action: apk.agentProto.InputAction.KEYPRESS
|
||||
, keyCode: keyutil.unwire(message.keyCode)
|
||||
})
|
||||
})
|
||||
.on(wire.TypeMessage, function(channel, message) {
|
||||
sendInputEvent({
|
||||
action: 3
|
||||
action: apk.agentProto.InputAction.TYPE
|
||||
, keyCode: 0
|
||||
, text: message.text
|
||||
})
|
||||
})
|
||||
.on(wire.RotateMessage, function(channel, message) {
|
||||
sendInputEvent({
|
||||
action: message.rotation < 0
|
||||
? apk.agentProto.InputAction.THAW_ROTATION
|
||||
: apk.agentProto.InputAction.FREEZE_ROTATION
|
||||
, rotation: message.rotation
|
||||
})
|
||||
})
|
||||
|
||||
return {
|
||||
unlock: unlock
|
||||
@@ -383,7 +391,7 @@ module.exports = syrup.serial()
|
||||
return setClipboard(text)
|
||||
.then(function() {
|
||||
sendInputEvent({
|
||||
action: 2
|
||||
action: apk.agentProto.InputAction.KEYPRESS
|
||||
, keyCode: adb.Keycode.KEYCODE_V
|
||||
, ctrlKey: true
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user